Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ Category( "Text" ) ]
- public FontFamily FontFamily
- {
- get => (FontFamily)GetValue( FontFamilyProperty );
- set => SetValue( FontFamilyProperty, value );
- }
- // Using a DependencyProperty as the backing store for FontFamily. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty FontFamilyProperty =
- TextElement.FontFamilyProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontFamily, FrameworkPropertyMetadataOptions.Inherits ) );
- [ Category( "Text" ) ]
- [ TypeConverter( typeof( FontSizeConverter ) ) ]
- public double FontSize
- {
- get => (double)GetValue( FontSizeProperty );
- set => SetValue( FontSizeProperty, value );
- }
- // Using a DependencyProperty as the backing store for FontSize. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty FontSizeProperty =
- TextElement.FontSizeProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontSize, FrameworkPropertyMetadataOptions.Inherits ) );
- [ Category( "Text" ) ]
- public FontStretch FontStretch
- {
- get => (FontStretch)GetValue( FontStretchProperty );
- set => SetValue( FontStretchProperty, value );
- }
- // Using a DependencyProperty as the backing store for FontStretch. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty FontStretchProperty =
- TextElement.FontStretchProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( TextElement.FontStretchProperty.DefaultMetadata.DefaultValue, FrameworkPropertyMetadataOptions.Inherits ) );
- [ Category( "Text" ) ]
- public FontStyle FontStyle
- {
- get => (FontStyle)GetValue( FontStyleProperty );
- set => SetValue( FontStyleProperty, value );
- }
- // Using a DependencyProperty as the backing store for FontStyle. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty FontStyleProperty = TextElement.FontStyleProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontStyle, FrameworkPropertyMetadataOptions.Inherits ) );
- [ Category( "Text" ) ]
- public FontWeight FontWeight
- {
- get => (FontWeight)GetValue( FontWeightProperty );
- set => SetValue( FontWeightProperty, value );
- }
- // Using a DependencyProperty as the backing store for FontWeight. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty FontWeightProperty = TextElement.FontWeightProperty.AddOwner( typeof( MyControl ), new FrameworkPropertyMetadata( SystemFonts.MessageFontWeight, FrameworkPropertyMetadataOptions.Inherits ) );
Add Comment
Please, Sign In to add comment