public static SharpDX.DirectWrite.FontStyle ToDxFontStyle(this Xamarin.Forms.FontAttributes fontAttributes) { var result = SharpDX.DirectWrite.FontStyle.Normal; if ((fontAttributes & Xamarin.Forms.FontAttributes.Bold) > 0) result = SharpDX.DirectWrite.FontStyle.Oblique; if ((fontAttributes & Xamarin.Forms.FontAttributes.Italic) > 0) result |= SharpDX.DirectWrite.FontStyle.Italic; return result; }
private static void fontAttributesPropertyChanged(BindableObject bindable, object oldValue, object newValue) { Xamarin.Forms.FontAttributes value = (Xamarin.Forms.FontAttributes)newValue; if ((Xamarin.Forms.FontAttributes)oldValue == value) { return; } (bindable as Btn).label.FontAttributes = value; }