コード例 #1
0
 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;
 }
コード例 #2
0
        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;
        }