コード例 #1
0
 /// <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));
 }
コード例 #2
0
 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));
 }
コード例 #3
0
ファイル: TimeSpanView.cs プロジェクト: leontius/Ragnarok
 /// <summary>
 /// 静的コンストラクタ
 /// </summary>
 static TimeSpanView()
 {
     DefaultStyleKeyProperty.OverrideMetadata(
         typeof(TimeSpanView),
         new FrameworkPropertyMetadata(typeof(TimeSpanView)));
     FontSizeProperty.OverrideMetadata(
         typeof(TimeSpanView),
         new FrameworkPropertyMetadata(OnFontSizeChanged));
 }
コード例 #4
0
 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));
 }
コード例 #5
0
 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)));
 }
コード例 #6
0
ファイル: HexBox.cs プロジェクト: fengye87626/HexView
        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));
        }
コード例 #7
0
        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;
        }
コード例 #8
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)));
 }
コード例 #9
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)));
        }
コード例 #10
0
 static HtmlPreview()
 {
     FontSizeProperty.OverrideMetadata(typeof(HtmlPreview), new FrameworkPropertyMetadata(FonSizeChanged));
 }
コード例 #11
0
 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));
 }