[SOLVED] Unable to cast object of type 'Xamarin. Forms. Xaml. ElementNode' to type 'Xamarin. Forms. Xaml. ValueNode'.
When writing XAML for Xamarin Forms, you may across the error: Unable to cast object of type 'Xamarin.Forms.Xaml.ElementNode' to type 'Xamarin.Forms.Xaml.ValueNode'
This is nearly always caused by assigning a value to an event in XAML, instead of specifying a method name. A common example is: <Switch Toggled="{Binding IsToggled}" />
Toggled
is the name of an event. The property that was probably intended is called IsToggled
. <Switch IsToggled="{Binding IsToggled}" />