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 IconImage() { IsEnabledProperty.OverrideMetadata(typeof(IconImage), new FrameworkPropertyMetadata(true, new PropertyChangedCallback( OnGrayImage))); WidthProperty.OverrideMetadata(typeof(IconImage), new FrameworkPropertyMetadata(16d)); HeightProperty.OverrideMetadata(typeof(IconImage), new FrameworkPropertyMetadata(16d)); }
static BlackKey() { BackgroundProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(Brushes.Black)); DefaultStyleKeyProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(typeof(BlackKey))); ForegroundProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(Brushes.White)); HeightProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(95.0)); MarginProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(new Thickness(-100.0, 0, -100.0, 0.0))); VerticalAlignmentProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(VerticalAlignment.Top)); WidthProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(11.0)); Panel.ZIndexProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(1)); }
static BlankRect() { WidthProperty.OverrideMetadata(typeof(BlankRect), new FrameworkPropertyMetadata((o, e) => ((BlankRect)o).UpdateGeometry())); HeightProperty.OverrideMetadata(typeof(BlankRect), new FrameworkPropertyMetadata((o, e) => ((BlankRect)o).UpdateGeometry())); StrokeLineJoinProperty.OverrideMetadata(typeof(BlankRect), new FrameworkPropertyMetadata(PenLineJoin.Round)); }
static RatingSlider() { ValueProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 0d, RecalculateRelativeValues)); MinimumProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 0d, RecalculateRelativeValues)); MaximumProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 10d, RecalculateRelativeValues)); WidthProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 0d, RecalculateWidth)); ForegroundProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: null, ResolveForeground)); BackgroundProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: null, ResolveBackground)); }
static DataGridColumnFloatingHeader() { DefaultStyleKeyProperty.OverrideMetadata(typeof(DataGridColumnFloatingHeader), new FrameworkPropertyMetadata(typeof(DataGridColumnFloatingHeader))); WidthProperty.OverrideMetadata( typeof(DataGridColumnFloatingHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnWidthChanged), new CoerceValueCallback(OnCoerceWidth))); HeightProperty.OverrideMetadata( typeof(DataGridColumnFloatingHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnHeightChanged), new CoerceValueCallback(OnCoerceHeight))); }
public DeckView() { InitializeComponent(); // force default size for instances if (!hasMetadataOverride) { hasMetadataOverride = true; WidthProperty.OverrideMetadata(typeof(DeckView), new FrameworkPropertyMetadata((double)280)); HeightProperty.OverrideMetadata(typeof(DeckView), new FrameworkPropertyMetadata((double)50)); } }
/// <summary> /// Initialises static members of the <see cref="Icon"/> class. /// </summary> static Icon() { DefaultStyleKeyProperty.OverrideMetadata( typeof(Icon), new FrameworkPropertyMetadata(typeof(Icon))); HeightProperty.OverrideMetadata( typeof(Icon), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnHeightPropertyChanged))); WidthProperty.OverrideMetadata( typeof(Icon), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnWidthPropertyChanged))); }
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 LegacyBorderWindow() { //DefaultStyleKeyProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(typeof(BorderWindow))); WindowStyleProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(false)); AllowsTransparencyProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(true)); ShowActivatedProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(false)); // override to make border less visible initially for slow machines //WindowStateProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(WindowState.Minimized)); WidthProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(1d)); HeightProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(1d)); }
static BorderWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(typeof(BorderWindow))); WindowStyleProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(false)); AllowsTransparencyProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(true)); ShowActivatedProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(false)); ResizeModeProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); BorderBrushProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(Brushes.DimGray)); // override to make border less visible initially for slow machines WidthProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(1d)); HeightProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(1d)); }
static ColumnDefinitionCollapsable() { WidthProperty.OverrideMetadata( typeof(ColumnDefinitionCollapsable), new FrameworkPropertyMetadata( new GridLength(1, GridUnitType.Star), null, (d, v) => ((ColumnDefinitionCollapsable)d).Visible ? v : new GridLength(0))); MinWidthProperty.OverrideMetadata( typeof(ColumnDefinitionCollapsable), new FrameworkPropertyMetadata(0d, null, (d, v) => ((ColumnDefinitionCollapsable)d).Visible ? v : 0d)); }
static DataGridRowHeader() { DefaultStyleKeyProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(typeof(DataGridRowHeader))); ContentProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceContent)); ContentTemplateProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceContentTemplate)); ContentTemplateSelectorProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceContentTemplateSelector)); StyleProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceStyle)); WidthProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceWidth)); ClickModeProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(ClickMode.Press)); FocusableProperty.OverrideMetadata(typeof(DataGridRowHeader), new FrameworkPropertyMetadata(false)); }
static TopWallpaperRenderer() { ScreenArea = new Rect(0, 0, 412, 240); RenderToolFactory.RegisterTool <PenTool, Pen> (key => new Pen(new SolidColorBrush(key.Color) { Opacity = key.Opacity }, key.Width)); RenderToolFactory.RegisterTool <SolidColorBrushTool, Brush> (key => new SolidColorBrush(key.Color) { Opacity = key.Opacity }); RenderToolFactory.RegisterTool <LinearGradientBrushTool, Brush> (key => new LinearGradientBrush(key.ColorA, key.ColorB, key.Angle) { Opacity = key.Opacity }); RenderToolFactory.RegisterTool <ImageBrushTool, Brush> (key => new ImageBrush(key.Image) { TileMode = key.Mode, ViewportUnits = key.ViewportUnits, Viewport = key.Viewport, Opacity = key.Opacity }); Type ownerType = typeof(TopWallpaperRenderer); IsEnabledProperty .OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false, OnIsEnabledChanged)); ClipToBoundsProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(true, null, (o, value) => true)); WidthProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(412.0, null, (o, value) => 412.0)); HeightProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(240.0, null, (o, value) => 240.0)); /* * EffectProperty.OverrideMetadata(ownerType, * new FrameworkPropertyMetadata(default(WarpEffect), * null, * (o, value) => ((TopWallpaperRenderer) o).GetWarpEffectInstance())); */ }
static DataGridColumnDropSeparator() { DefaultStyleKeyProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(DataGridColumnHeader.ColumnHeaderDropSeparatorStyleKey)); WidthProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceWidth))); HeightProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceHeight))); }
// Constructors static ColumnDefinitionExtension() { VisibleProperty = DependencyProperty.Register("Visible", typeof(Boolean), typeof(ColumnDefinitionExtension), new PropertyMetadata(true, OnVisibleChanged)); WidthProperty.OverrideMetadata(typeof(ColumnDefinitionExtension), new FrameworkPropertyMetadata(new GridLength(1, GridUnitType.Star), null, CoerceWidth)); MinWidthProperty.OverrideMetadata(typeof(ColumnDefinitionExtension), new FrameworkPropertyMetadata((Double)0, null, CoerceMinWidth)); }
static CollapsibleColumnDefinition() { VisibleProperty = DependencyProperty.Register("Visible", typeof(bool), typeof(CollapsibleColumnDefinition), new PropertyMetadata(true, new PropertyChangedCallback(OnVisibleChanged))); WidthProperty.OverrideMetadata(typeof(CollapsibleColumnDefinition), new FrameworkPropertyMetadata(new GridLength(1, GridUnitType.Star), null, new CoerceValueCallback(CoerceWidth))); MinWidthProperty.OverrideMetadata(typeof(CollapsibleColumnDefinition), new FrameworkPropertyMetadata((double)0, null, new CoerceValueCallback(CoerceMinWidth))); }
// Constructors static GridViewColumnExtended() { VisibleProperty = DependencyProperty.Register("Visible", typeof(Boolean), typeof(GridViewColumnExtended), new PropertyMetadata(true, OnVisibleChanged)); WidthProperty.OverrideMetadata(typeof(GridViewColumnExtended), new FrameworkPropertyMetadata((Double)0, null, CoerceWidth)); //MinWidthProperty.OverrideMetadata(typeof(ColumnDefinitionExtended), // new FrameworkPropertyMetadata((Double)0, null, // new CoerceValueCallback(CoerceMinWidth))); }
static TimeScale() { WidthProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(Double.NaN)); HeightProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(30d)); ClipToBoundsProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(true)); ForegroundProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(Brushes.Gray)); BackgroundProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(Brushes.Transparent)); IntervalTextColorProperty = DependencyProperty.Register("IntervalTextColor", typeof(Brush), typeof(TimeScale), new FrameworkPropertyMetadata { DefaultValue = Brushes.Gray, AffectsRender = true }); DefaultStyleKeyProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(typeof(TimeScale))); }
static SideAppBar() { NameProperty .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata("SideAppBar1")); DefaultStyleKeyProperty .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(typeof(SideAppBar))); WidthProperty .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(Convert.ToDouble(48))); HorizontalAlignmentProperty .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(HorizontalAlignment.Left)); VerticalAlignmentProperty .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); MarginProperty .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(new Thickness(0, 40, 0, 0))); ///////////////////////////////////////////////////////////////////////////////// /// Routed Events: ///////////////////////////////////////////////////////////////////////////////// EventManager.RegisterClassHandler(typeof(SideAppBar), SizeChangedEvent, new RoutedEventHandler(OnLoaded)); }
static ManagedContent() { //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. //This style is defined in themes\generic.xaml DefaultStyleKeyProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(typeof(ManagedContent))); WidthProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(double.NaN, null, (s, v) => { if ( !DesignerProperties . GetIsInDesignMode (s)) { return(double.NaN); } return(v); })); HeightProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(double.NaN, null, (s, v) => { if ( !DesignerProperties . GetIsInDesignMode (s)) { return (double.NaN); } return(v); })); FocusableProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(true)); }
static TetrisCanvas() { WidthProperty.OverrideMetadata(typeof(TetrisCanvas), new FrameworkPropertyMetadata(WidthChanged)); HeightProperty.OverrideMetadata(typeof(TetrisCanvas), new FrameworkPropertyMetadata(HeightChanged)); }
static CompletionWindow() { WidthProperty.OverrideMetadata(typeof(CompletionWindow), new FrameworkPropertyMetadata(200.0)); HeightProperty.OverrideMetadata(typeof(CompletionWindow), new FrameworkPropertyMetadata(120.0)); }
/// <summary> /// Initializes static members of the <see cref="SACS.Windows.ExtentedControls.FixedWidthColumn"/> class. /// </summary> static FixedWidthColumn() { WidthProperty.OverrideMetadata( typeof(FixedWidthColumn), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceWidth))); }
static ImageButton() { WidthProperty.OverrideMetadata(typeof(ImageButton), new FrameworkPropertyMetadata(20.0)); HeightProperty.OverrideMetadata(typeof(ImageButton), new FrameworkPropertyMetadata(20.0)); }
static FixedWidthGridViewColumn() { WidthProperty.OverrideMetadata(typeof(FixedWidthGridViewColumn), new FrameworkPropertyMetadata(null, OnCoerceWidth)); }
/// <summary> /// Initializes static members of the <see cref="Magnifier"/> class. /// </summary> static Magnifier() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Magnifier), new FrameworkPropertyMetadata(typeof(Magnifier))); HeightProperty.OverrideMetadata(typeof(Magnifier), new FrameworkPropertyMetadata(Magnifier.DEFAULT_SIZE)); WidthProperty.OverrideMetadata(typeof(Magnifier), new FrameworkPropertyMetadata(Magnifier.DEFAULT_SIZE)); }
static UnresizableGridViewColumn() { WidthProperty.OverrideMetadata(typeof(UnresizableGridViewColumn), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceWidth))); }
//<SnippetInvalidateProperty> static AreaButton() { WidthProperty.OverrideMetadata(typeof(AreaButton), new FrameworkPropertyMetadata(new PropertyChangedCallback(InvalidateAreaProperty))); HeightProperty.OverrideMetadata(typeof(AreaButton), new FrameworkPropertyMetadata(new PropertyChangedCallback(InvalidateAreaProperty))); }
static Window() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata(typeof(Window))); WidthProperty.OverrideMetadata(typeof(Window), new PropertyMetadata(WidthChanged)); HeightProperty.OverrideMetadata(typeof(Window), new PropertyMetadata(HeightChanged)); }