xamarin.android - Xamarin Forms - passing value from Xaml.cs to custom renderer -
i have page called mappage.xaml.cs , on page's constructor have argument called bool isfirehazard
. in custom renderer custommaprenderer.cs
in android project, want check boolean
see whether true.
how reference boolean custom renderer?
you need store isfirehazard passed constructor in custommap object member. in custommaprenderer can access
protected override void onelementchanged (elementchangedeventargs<xxx> e) { base.onelementchanged(e); if (e.newelement != null) { var formsmap = (cusommap)e.newelement; if(formsmap.isfirehazard) { } } }
Comments
Post a Comment