Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

"object".SetValue(IsVisibleProperty, false)returns System.InvalidCastException: Specified cast is n

$
0
0

"Unhandled Exception:

System.InvalidCastException: Specified cast is not valid."

private void SwitchCell_OnChanged(object sender, ToggledEventArgs e)
{
if (tæ.On.Equals(true))
{
abcde.SetValue(IsVisibleProperty, true);
//abcde.SetValue(IsVisibleProperty, false);
}
else
{
abcde.SetValue(IsVisibleProperty, false); //xamarin forms is marking this code, and informing me that it causes the error, but how do I make it work, without the application crashing? (BTW, "abcde" is a imagecell that has the x:name="abcde" in the xaml code.
}
}


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>