Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. [ Category( "Text" ) ]
  2. public FontFamily FontFamily
  3. {
  4. get => (FontFamily)GetValue( FontFamilyProperty );
  5. set => SetValue( FontFamilyProperty, value );
  6. }
  7.  
  8. // Using a DependencyProperty as the backing store for FontFamily. This enables animation, styling, binding, etc...
  9. public static readonly DependencyProperty FontFamilyProperty =
  10. TextElement.FontFamilyProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontFamily, FrameworkPropertyMetadataOptions.Inherits ) );
  11.  
  12. [ Category( "Text" ) ]
  13. [ TypeConverter( typeof( FontSizeConverter ) ) ]
  14. public double FontSize
  15. {
  16. get => (double)GetValue( FontSizeProperty );
  17. set => SetValue( FontSizeProperty, value );
  18. }
  19.  
  20. // Using a DependencyProperty as the backing store for FontSize. This enables animation, styling, binding, etc...
  21. public static readonly DependencyProperty FontSizeProperty =
  22. TextElement.FontSizeProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontSize, FrameworkPropertyMetadataOptions.Inherits ) );
  23.  
  24. [ Category( "Text" ) ]
  25. public FontStretch FontStretch
  26. {
  27. get => (FontStretch)GetValue( FontStretchProperty );
  28. set => SetValue( FontStretchProperty, value );
  29. }
  30.  
  31. // Using a DependencyProperty as the backing store for FontStretch. This enables animation, styling, binding, etc...
  32. public static readonly DependencyProperty FontStretchProperty =
  33. TextElement.FontStretchProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( TextElement.FontStretchProperty.DefaultMetadata.DefaultValue, FrameworkPropertyMetadataOptions.Inherits ) );
  34.  
  35. [ Category( "Text" ) ]
  36. public FontStyle FontStyle
  37. {
  38. get => (FontStyle)GetValue( FontStyleProperty );
  39. set => SetValue( FontStyleProperty, value );
  40. }
  41.  
  42. // Using a DependencyProperty as the backing store for FontStyle. This enables animation, styling, binding, etc...
  43. public static readonly DependencyProperty FontStyleProperty = TextElement.FontStyleProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontStyle, FrameworkPropertyMetadataOptions.Inherits ) );
  44.  
  45. [ Category( "Text" ) ]
  46. public FontWeight FontWeight
  47. {
  48. get => (FontWeight)GetValue( FontWeightProperty );
  49. set => SetValue( FontWeightProperty, value );
  50. }
  51.  
  52. // Using a DependencyProperty as the backing store for FontWeight. This enables animation, styling, binding, etc...
  53. public static readonly DependencyProperty FontWeightProperty = TextElement.FontWeightProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontWeight, FrameworkPropertyMetadataOptions.Inherits ) );
Add Comment
Please, Sign In to add comment