Bindung in XAML, XAML Parse-Ausnahme
-
14-11-2019 - |
Frage
Ich benutze derzeit den WPF .NET 3.5 für die Entwicklung, mithilfe des Math-Konverters von IKRIV entschied ich mich, eine mathematische Aufgabe in meinem Design zu erstellen: generasacodicetagpre.
+ Ausnahmeassistent sagt:
innerexception: system.invalidcastException
message= Objekt des Typs des Typs 'system.windows.templateBindingExpression' zum Typ 'System.String' nicht gegossen.
danke.
Lösung
Yes, there is an error in that line. Please give some more information about where is the button you refer to in that binding.
If it's the control that you create template for, you can try to remove the line:
<!-- this line causes an error -->
<Binding Path="Object" ElementName="{TemplateBinding Property=Button.Height}" />
and replace it with a new one:
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Height" />
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow