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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -