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
Post a Comment