/// <summary> /// Static constructor. The OverrideMetadata calls can only happen in this constructor. They will cause undefined /// behavior if run elsewhere (and from C we all know undefined behavior is meh). /// </summary> static Compass() { // Calculations that need to occur when default dependency properties change. HeightProperty.OverrideMetadata(typeof(Compass), new FrameworkPropertyMetadata(0.0, HeightChanged)); WidthProperty.OverrideMetadata(typeof(Compass), new FrameworkPropertyMetadata(0.0, WidthChanged)); FontSizeProperty.OverrideMetadata(typeof(Compass), new FrameworkPropertyMetadata(20.0, FontSizeChanged)); }
static HitTextBlock() { FontFamilyProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); FontSizeProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); FontWeightProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); FontStyleProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); ForegroundProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); }
/// <summary> /// 静的コンストラクタ /// </summary> static TimeSpanView() { DefaultStyleKeyProperty.OverrideMetadata( typeof(TimeSpanView), new FrameworkPropertyMetadata(typeof(TimeSpanView))); FontSizeProperty.OverrideMetadata( typeof(TimeSpanView), new FrameworkPropertyMetadata(OnFontSizeChanged)); }
static ConsoleView() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(typeof(ConsoleView))); DataContextProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(DocumentPropertyChanged)); FontFamilyProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(RenderPropertyChanged)); FontSizeProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(RenderPropertyChanged)); FontStretchProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(RenderPropertyChanged)); FontStyleProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(RenderPropertyChanged)); FontWeightProperty.OverrideMetadata(typeof(ConsoleView), new FrameworkPropertyMetadata(RenderPropertyChanged)); }
static UnreadTip() { DefaultStyleKeyProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(typeof(UnreadTip))); ClipToBoundsProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(true)); VisibilityProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(Visibility.Collapsed)); HeightProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(10.00)); WidthProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(15.00)); FontSizeProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(8.00)); BackgroundProperty.OverrideMetadata(typeof(UnreadTip), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Red))); }
static HexBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(typeof(HexBox))); FontFamilyProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontStyleProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontWeightProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontStretchProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontSizeProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); ForegroundProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); }
public Compass() { this.InitializeComponent(); this.DataContext = this; // Calculations that need to occur when default dependency properties change. HeightProperty.OverrideMetadata(typeof(Compass), new FrameworkPropertyMetadata(0.0, HeightChanged)); WidthProperty.OverrideMetadata(typeof(Compass), new FrameworkPropertyMetadata(0.0, WidthChanged)); FontSizeProperty.OverrideMetadata(typeof(Compass), new FrameworkPropertyMetadata(20.0, FontSizeChanged)); this.Angle = 0; }
static TextView() { ClipToBoundsProperty.OverrideMetadata(typeof(TextView), new PropertyMetadata(true)); FontFamilyProperty.OverrideMetadata(typeof(TextView), new FrameworkPropertyMetadata( new FontFamily("Consolas") //new FontFamily("Courier New") //new FontFamily("Lucida Console") //new FontFamily("Lucida Sans Typewriter") )); FontSizeProperty.OverrideMetadata(typeof(TextView), new FrameworkPropertyMetadata(13 * (96.0 / 72.0))); }
static TextBlock() { TextProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( (string)Controls.TextBlock.TextProperty.GetMetadata(typeof(Controls.TextBlock)).DefaultValue, (o, e) => (o as TextBlock).OnTextChanged(e.NewValue as string))); ForegroundProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( (Brush)ForegroundProperty.GetMetadata(typeof(Controls.TextBlock)).DefaultValue, (o, e) => (o as TextBlock).OnForegroundChanged(e.NewValue as Brush))); FontSizeProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( (double)FontSizeProperty.GetMetadata(typeof(Controls.TextBlock)).DefaultValue, (o, e) => (o as TextBlock).OnFontSizeChanged((double)e.NewValue))); }
static HtmlPreview() { FontSizeProperty.OverrideMetadata(typeof(HtmlPreview), new FrameworkPropertyMetadata(FonSizeChanged)); }
static Page() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(typeof(Page))); BackgroundProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(Brushes.Transparent)); FontSizeProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(14d)); }