xamarin.forms - How to make a behaviors collection a resource in XAML -


how make behaviors collection resource in xaml using xamarin.forms?

i tried following:

xmlns:b="clr-namespace:xamarin.behaviors;assembly=xamarin.behaviors" xmlns:behaviors="clr-namespace:viewoptions.behaviors;assembly=viewoptions" 

. .

  <contentpage.resources>     <resourcedictionary>       <b:behaviorcollection x:key="behaviorcollection">         <behaviors:textboxfocusbehavior />       </b:behaviorcollection>     </resourcedictionary>   </contentpage.resources> 

here's behavior:

namespace viewoptions.behaviors {     public class textboxfocusbehavior : behavior<entry>     {            protected override void onattachedto(entry entry)         {          }         protected override void ondetachingfrom(entry bindable)         {          }     } } 

the implementation gives me runtime exception.

any suggestions?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -