コード例 #1
0
 protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
 {
     if (args.PropertyName == ChangeFontEffect.FontProperty.PropertyName)
     {
         var val = ChangeFontEffect.GetFont(Element);
         if (val != null)
         {
             Typeface font = Typeface.CreateFromAsset(Forms.Context.ApplicationContext.Assets, ChangeFontEffect.GetFont(Element));
             control.Typeface = font;
         }
     }
 }
コード例 #2
0
 protected override void OnAttached()
 {
     try
     {
         control = Control as TextView;
         Typeface font = Typeface.CreateFromAsset(Forms.Context.ApplicationContext.Assets, ChangeFontEffect.GetFont(Element));
         control.Typeface = font;
     }
     catch (Exception e)
     {
     }
 }