static IconPresenter() { FocusableProperty.OverrideMetadata(typeof(IconPresenter), new FrameworkPropertyMetadata(false)); ContentTemplateSelectorProperty.OverrideMetadata(typeof(IconPresenter), new FrameworkPropertyMetadata(new IconPresenterContentTemplateSelector())); VerticalAlignmentProperty.OverrideMetadata(typeof(IconPresenter), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); HorizontalAlignmentProperty.OverrideMetadata(typeof(IconPresenter), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); }
static ApplicationBar() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(typeof(ApplicationBar))); var itemsPanelTemplate = new ItemsPanelTemplate(new FrameworkElementFactory(typeof(ApplicationBarPanel))); itemsPanelTemplate.Seal(); ItemsPanelProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(itemsPanelTemplate)); IsTabStopProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(false)); FocusableProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(false)); FocusManager.IsFocusScopeProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(true)); KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata( typeof(ApplicationBar), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle)); KeyboardNavigation.TabNavigationProperty.OverrideMetadata( typeof(ApplicationBar), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle)); KeyboardNavigation.ControlTabNavigationProperty.OverrideMetadata( typeof(ApplicationBar), new FrameworkPropertyMetadata(KeyboardNavigationMode.Once)); HorizontalAlignmentProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalAlignmentProperty.OverrideMetadata(typeof(ApplicationBar), new FrameworkPropertyMetadata(VerticalAlignment.Bottom)); EventManager.RegisterClassHandler(typeof(ApplicationBar), Mouse.LostMouseCaptureEvent, new MouseEventHandler(OnLostMouseCapture)); EventManager.RegisterClassHandler(typeof(ApplicationBar), Mouse.PreviewMouseUpOutsideCapturedElementEvent, new MouseButtonEventHandler(OnPreviewMouseButtonOutsideCapturedElement)); }
/// <summary> /// Static constructor /// </summary> static WindowSteeringHelperControl() { BackgroundProperty.OverrideMetadata(typeof(WindowSteeringHelperControl), new FrameworkPropertyMetadata(Brushes.Transparent)); IsHitTestVisibleProperty.OverrideMetadata(typeof(WindowSteeringHelperControl), new FrameworkPropertyMetadata(BooleanBoxes.TrueBox)); HorizontalAlignmentProperty.OverrideMetadata(typeof(WindowSteeringHelperControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalAlignmentProperty.OverrideMetadata(typeof(WindowSteeringHelperControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); }
static MyComboBoxItem() { HorizontalAlignmentProperty.OverrideMetadata(typeof(MyComboBoxItem), new FrameworkPropertyMetadata(HorizontalAlignment.Left)); VerticalAlignmentProperty.OverrideMetadata(typeof(MyComboBoxItem), new FrameworkPropertyMetadata(VerticalAlignment.Center)); EventManager.RegisterClassHandler(typeof(MyComboBoxItem), LoadedEvent, new RoutedEventHandler(OnLoaded)); }
static ShinyImageControl() { VerticalAlignmentProperty.OverrideMetadata(typeof(ShinyImageControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); HorizontalAlignmentProperty.OverrideMetadata(typeof(ShinyImageControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); RenderOptions.BitmapScalingModeProperty.OverrideMetadata(typeof(ShinyImageControl), new FrameworkPropertyMetadata(BitmapScalingMode.Linear)); _glareBrush = new LinearGradientBrush() { StartPoint = new Point(0.5, 0.4), EndPoint = new Point(0.65, 0.85), GradientStops = { new GradientStop(Color.FromArgb(51, 255, 255, 255), 0.0), new GradientStop(Color.FromArgb(51, 255, 255, 255), 0.6), new GradientStop(Color.FromArgb(0, 0, 0, 0), 0.6), }, }; var bi = new BitmapImage(); bi.BeginInit(); bi.CacheOption = BitmapCacheOption.OnLoad; bi.DecodePixelWidth = 100; bi.UriSource = new Uri(@"pack://application:,,,/Resources/Images/avatar_background.png"); bi.EndInit(); _avatarBrush = new ImageBrush(bi); _avatarBrush.Freeze(); }
static MediaPlayer() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MediaPlayer), new FrameworkPropertyMetadata(typeof(MediaPlayer))); BackgroundProperty.OverrideMetadata(typeof(MediaPlayer), new FrameworkPropertyMetadata(Brushes.Black)); HorizontalAlignmentProperty.OverrideMetadata(typeof(MediaPlayer), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalAlignmentProperty.OverrideMetadata(typeof(MediaPlayer), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); ContentProperty.OverrideMetadata(typeof(MediaPlayer), new FrameworkPropertyMetadata(ContentChanged, CoerceContent)); }
static RangePanel() { ClipToBoundsProperty.OverrideMetadata(typeof(RangePanel), new FrameworkPropertyMetadata(true)); HorizontalAlignmentProperty.OverrideMetadata(typeof(RangePanel), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalAlignmentProperty.OverrideMetadata(typeof(RangePanel), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Windows.Controls.Control"/> class. /// </summary> /// <remarks></remarks> static QrCodeImgControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(QrCodeImgControl), new FrameworkPropertyMetadata(typeof(QrCodeImgControl))); HorizontalAlignmentProperty.OverrideMetadata(typeof(QrCodeImgControl), new FrameworkPropertyMetadata(HorizontalAlignment.Center)); VerticalAlignmentProperty.OverrideMetadata(typeof(QrCodeImgControl), new FrameworkPropertyMetadata(VerticalAlignment.Center)); }
static JumpSideAppBar() { DefaultStyleKeyProperty.OverrideMetadata(typeof(JumpSideAppBar), new FrameworkPropertyMetadata(typeof(JumpSideAppBar))); WidthProperty.OverrideMetadata(typeof(JumpSideAppBar), new FrameworkPropertyMetadata(Convert.ToDouble(48))); HorizontalAlignmentProperty.OverrideMetadata(typeof(JumpSideAppBar), new FrameworkPropertyMetadata(HorizontalAlignment.Left)); VerticalAlignmentProperty.OverrideMetadata(typeof(JumpSideAppBar), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); MarginProperty.OverrideMetadata(typeof(JumpSideAppBar), new FrameworkPropertyMetadata(new Thickness(0, 40, 0, 0))); EventManager.RegisterClassHandler(typeof(JumpSideAppBar), SizeChangedEvent, new RoutedEventHandler(OnLoaded)); }
static JumpComboBox() { // Specify veritical margins in the root Stackpanel. MarginProperty.OverrideMetadata(typeof(JumpComboBox), new FrameworkPropertyMetadata(new Thickness(0, 4, 4, 4))); HorizontalAlignmentProperty.OverrideMetadata(typeof(JumpComboBox), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalAlignmentProperty.OverrideMetadata(typeof(JumpComboBox), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); //BackgroundProperty.OverrideMetadata(typeof(JumpComboBox), new FrameworkPropertyMetadata(Brushes.Transparent)); EventManager.RegisterClassHandler(typeof(JumpComboBox), SizeChangedEvent, new RoutedEventHandler(OnSizeChanged)); }
static MapScale() { IsHitTestVisibleProperty.OverrideMetadata(typeof(MapScale), new FrameworkPropertyMetadata(false)); MinWidthProperty.OverrideMetadata(typeof(MapScale), new FrameworkPropertyMetadata(100d)); HorizontalAlignmentProperty.OverrideMetadata(typeof(MapScale), new FrameworkPropertyMetadata(HorizontalAlignment.Right)); VerticalAlignmentProperty.OverrideMetadata(typeof(MapScale), new FrameworkPropertyMetadata(VerticalAlignment.Bottom)); StrokeStartLineCapProperty.OverrideMetadata(typeof(MapScale), new FrameworkPropertyMetadata(PenLineCap.Round)); StrokeEndLineCapProperty.OverrideMetadata(typeof(MapScale), new FrameworkPropertyMetadata(PenLineCap.Round)); }
static MediaPlayer() { BackgroundProperty.OverrideMetadata(typeof(MediaPlayer), new StyledPropertyMetadata <IBrush?>(new Optional <IBrush?>(Brushes.Black))); HorizontalAlignmentProperty.OverrideMetadata(typeof(MediaPlayer), new StyledPropertyMetadata <HorizontalAlignment>(HorizontalAlignment.Stretch)); VerticalAlignmentProperty.OverrideMetadata(typeof(MediaPlayer), new StyledPropertyMetadata <VerticalAlignment>(VerticalAlignment.Stretch)); ContentProperty.Changed.Subscribe(ContentChanged); }
static Resizer() { //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(Resizer), new FrameworkPropertyMetadata(typeof(Resizer))); MinWidthProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); MinHeightProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); HorizontalAlignmentProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); VerticalAlignmentProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); }
static FlexPanel() { DefaultStyleKeyProperty.OverrideMetadata(typeof(FlexPanel), new FrameworkPropertyMetadata(typeof(FlexPanel))); HorizontalAlignmentProperty.OverrideMetadata(typeof(FlexPanel), new FrameworkPropertyMetadata(HorizontalAlignment.Left)); VerticalAlignmentProperty.OverrideMetadata(typeof(FlexPanel), new FrameworkPropertyMetadata(VerticalAlignment.Top)); }
static LayoutGridResizerControl() { //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(LayoutGridResizerControl), new FrameworkPropertyMetadata(typeof(LayoutGridResizerControl))); HorizontalAlignmentProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); VerticalAlignmentProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); BackgroundProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(Brushes.Transparent)); IsHitTestVisibleProperty.OverrideMetadata(typeof(LayoutGridResizerControl), new FrameworkPropertyMetadata(true, null)); }
static TabItem() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TabItem), new FrameworkPropertyMetadata(typeof(TabItem))); HorizontalAlignmentProperty.OverrideMetadata(typeof(TabItem), new FrameworkPropertyMetadata() { DefaultValue = HorizontalAlignment.Stretch, CoerceValueCallback = OnCoerceHorizontalAlignment }); VerticalAlignmentProperty.OverrideMetadata(typeof(TabItem), new FrameworkPropertyMetadata() { DefaultValue = VerticalAlignment.Bottom, CoerceValueCallback = OnCoerceVerticalAlignment, }); }
static JumpTopAppBar() { DefaultStyleKeyProperty .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(typeof(JumpTopAppBar))); BackgroundProperty .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(Brushes.Transparent)); HeightProperty .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(Convert.ToDouble(40))); HorizontalAlignmentProperty .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalAlignmentProperty .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(VerticalAlignment.Top)); ///////////////////////////////////////////////////////////////////////////////// /// Routed Events: ///////////////////////////////////////////////////////////////////////////////// EventManager.RegisterClassHandler(typeof(JumpTopAppBar), SizeChangedEvent, new RoutedEventHandler(OnLoaded)); }
static StatBox() { // Change defaults for inherited dependency properties... HorizontalAlignmentProperty.OverrideMetadata(typeof(StatBox), new FrameworkPropertyMetadata(HorizontalAlignment.Left)); VerticalAlignmentProperty.OverrideMetadata(typeof(StatBox), new FrameworkPropertyMetadata(VerticalAlignment.Top)); }
static StaggeredPanel() { HorizontalAlignmentProperty.OverrideMetadata(typeof(StaggeredPanel), new FrameworkPropertyMetadata((s, e) => OnHorizontalAlignmentChanged(s, e))); }
static ItemsContainerControl() { HorizontalAlignmentProperty.OverrideMetadata( typeof(ItemsContainerControl), new FrameworkPropertyMetadata(HorizontalAlignment.Center)); }
static GridSheet() { HorizontalAlignmentProperty.OverrideMetadata(typeof(GridSheet), new FrameworkPropertyMetadata(HorizontalAlignment.Left)); VerticalAlignmentProperty.OverrideMetadata(typeof(GridSheet), new FrameworkPropertyMetadata(VerticalAlignment.Top)); }