예제 #1
0
        static CommandBar()
        {
            IsOpenProperty = DependencyProperty.Register("IsOpen", typeof(bool), typeof(CommandBar),
                                                         new FrameworkPropertyMetadata(false,
                                                                                       FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
                                                                                       FrameworkPropertyMetadataOptions.AffectsRender, OnIsOpenChanged));
            IsStickyProperty = DependencyProperty.Register("IsSticky", typeof(bool), typeof(CommandBar),
                                                           new FrameworkPropertyMetadata(false,
                                                                                         FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
            ClosedDisplayModeProperty = DependencyProperty.Register("ClosedDisplayMode", typeof(BarClosedDisplayMode), typeof(CommandBar),
                                                                    new FrameworkPropertyMetadata(BarClosedDisplayMode.Compact,
                                                                                                  FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
                                                                                                  FrameworkPropertyMetadataOptions.AffectsRender, OnCloseDisplayModeChanged));
            TemplateSettingsProperty = DependencyProperty.Register("TemplateSettings", typeof(CommandBarTemplateSettings),
                                                                   typeof(CommandBar), new PropertyMetadata(null));
            PlaceProperty = DependencyProperty.Register("Place", typeof(CommandPlace), typeof(CommandBar),
                                                        new FrameworkPropertyMetadata(CommandPlace.Bottom,
                                                                                      FrameworkPropertyMetadataOptions.AffectsRender,
                                                                                      OnPlaceChanged));
            HeightProperty.OverrideMetadata(typeof(CommandBar), new FrameworkPropertyMetadata(40d,
                                                                                              FrameworkPropertyMetadataOptions.AffectsRender));

            FocusManager.IsFocusScopeProperty.OverrideMetadata(typeof(CommandBar), new FrameworkPropertyMetadata(true));
            KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(CommandBar), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle));

            DefaultStyleKeyProperty.OverrideMetadata(typeof(CommandBar), new FrameworkPropertyMetadata(typeof(CommandBar)));
        }
예제 #2
0
        static BottomWallpaperRenderer()
        {
            Type ownerType = typeof(BottomWallpaperRenderer);

            IsEnabledProperty
            .OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false, OnIsEnabledChanged));

            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
            });

            ClipToBoundsProperty.OverrideMetadata(ownerType,
                                                  new FrameworkPropertyMetadata(true, null, (o, value) => true));
            WidthProperty.OverrideMetadata(ownerType,
                                           new FrameworkPropertyMetadata((double)BOT_SCR_WIDTH, null, (o, value) => (double)BOT_SCR_WIDTH));
            HeightProperty.OverrideMetadata(ownerType,
                                            new FrameworkPropertyMetadata((double)BOT_SCR_HEIGHT, null, (o, value) => (double)BOT_SCR_HEIGHT));
        }
예제 #3
0
        /// <summary>
        /// Updates the layout of the scrollbar.
        /// </summary>
        public override bool UpdateLayout(bool notifyParent = true)
        {
            bool defaultDisableLayoutUpdate = DisableLayoutUpdate;

            DisableLayoutUpdate = true;

            // set properties based on orientation of scrollbar
            if (AlignmentProperty.IsUndefined(this))
            {
                Alignment = Orientation == ElementOrientation.Horizontal ? ElementAlignment.Bottom : ElementAlignment.Right;
            }

            if (WidthProperty.IsUndefined(this))
            {
                OverrideWidth = Orientation == ElementOrientation.Horizontal ? Length : Breadth;
            }

            if (HeightProperty.IsUndefined(this))
            {
                OverrideHeight = Orientation == ElementOrientation.Horizontal ? Breadth : Length;
            }

            if (Orientation == ElementOrientation.Horizontal)
            {
                Handle.Alignment = ElementAlignment.Left;
            }
            else
            {
                Handle.Alignment = ElementAlignment.Top;
            }

            DisableLayoutUpdate = defaultDisableLayoutUpdate;
            return(base.UpdateLayout(notifyParent));
        }
        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, new CoerceValueCallback(
                                                                                                     (s, v) =>
            {
                if (!DesignerProperties.GetIsInDesignMode(s as DependencyObject))
                {
                    return(double.NaN);
                }

                return(v);
            })));
            HeightProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(double.NaN, null, new CoerceValueCallback(
                                                                                                      (s, v) =>
            {
                if (!DesignerProperties.GetIsInDesignMode(s as DependencyObject))
                {
                    return(double.NaN);
                }

                return(v);
            })));

            FocusableProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(true));
        }
예제 #5
0
 static StyleDialog()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(StyleDialog), new FrameworkPropertyMetadata(typeof(StyleDialog)));
     ContentProperty.OverrideMetadata(typeof(StyleDialog), new FrameworkPropertyMetadata(new PropertyChangedCallback(Changed)));
     WidthProperty.OverrideMetadata(typeof(StyleDialog), new FrameworkPropertyMetadata(new PropertyChangedCallback(Changed)));
     HeightProperty.OverrideMetadata(typeof(StyleDialog), new FrameworkPropertyMetadata(new PropertyChangedCallback(Changed)));
 }
예제 #6
0
        static ACMButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ACMButton), new FrameworkPropertyMetadata(typeof(ACMButton)));

            WidthProperty.OverrideMetadata(typeof(ACMButton), new FrameworkPropertyMetadata(double.NaN, null, OnWithOrHeightCoerceCallback));
            HeightProperty.OverrideMetadata(typeof(ACMButton), new FrameworkPropertyMetadata(double.NaN, null, OnWithOrHeightCoerceCallback));
        }
예제 #7
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));
 }
예제 #8
0
    static Window()
    {
        WidthProperty.OverrideMetadata(typeof(Window),
                                       new FrameworkPropertyMetadata(float.NaN, OnWidthChanged));

        HeightProperty.OverrideMetadata(typeof(Window),
                                        new FrameworkPropertyMetadata(float.NaN, OnHeightChanged));
    }
예제 #9
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));
 }
 static VisibleRowDefinition()
 {
     HeightProperty.AddOwner(typeof(VisibleRowDefinition),
                             new FrameworkPropertyMetadata(HeightProperty.DefaultMetadata.DefaultValue, OnHeightChanged));
     MinHeightProperty.AddOwner(typeof(VisibleRowDefinition),
                                new FrameworkPropertyMetadata(MinHeightProperty.DefaultMetadata.DefaultValue, OnMinHeightChanged));
     MaxHeightProperty.AddOwner(typeof(VisibleRowDefinition),
                                new FrameworkPropertyMetadata(MaxHeightProperty.DefaultMetadata.DefaultValue, OnMaxHeightChanged));
 }
예제 #11
0
 static CountdownRect()
 {
     WidthProperty.OverrideMetadata(typeof(CountdownRect),
                                    new FrameworkPropertyMetadata((o, e) => ((CountdownRect)o).GeometryChanged()));
     HeightProperty.OverrideMetadata(typeof(CountdownRect),
                                     new FrameworkPropertyMetadata((o, e) => ((CountdownRect)o).GeometryChanged()));
     StrokeLineJoinProperty.OverrideMetadata(typeof(CountdownRect),
                                             new FrameworkPropertyMetadata(PenLineJoin.Round));
 }
예제 #12
0
 static RowDefinitionExtended()
 {
     VisibleProperty = DependencyProperty.Register("Visible", typeof(bool), typeof(RowDefinitionExtended),
                                                   new PropertyMetadata(true, new PropertyChangedCallback(OnVisibleChanged)));
     HeightProperty.OverrideMetadata(typeof(RowDefinitionExtended),
                                     new FrameworkPropertyMetadata(new GridLength(1, GridUnitType.Star), null, new CoerceValueCallback(CoerceHeight)));
     MinHeightProperty.OverrideMetadata(typeof(RowDefinitionExtended),
                                        new FrameworkPropertyMetadata((double)0, null, new CoerceValueCallback(CoerceMinHeight)));
 }
예제 #13
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes static members of the <see cref="Icon"/> class.
        /// </summary>
        static Icon()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Icon), new FrameworkPropertyMetadata(typeof(Icon)));

            // Add PropertyChangedCallbacks for IsEnabled and Source.
            IsEnabledProperty.OverrideMetadata(typeof(Icon), new FrameworkPropertyMetadata(Boxed.BooleanTrue, OnImageEffectChanged));
            WidthProperty.OverrideMetadata(typeof(Icon), new FrameworkPropertyMetadata(16.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
            HeightProperty.OverrideMetadata(typeof(Icon), new FrameworkPropertyMetadata(16.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
        }
예제 #14
0
 static WhiteKey()
 {
     BackgroundProperty.OverrideMetadata(typeof(WhiteKey), new FrameworkPropertyMetadata(Brushes.Snow));
     DefaultStyleKeyProperty.OverrideMetadata(typeof(WhiteKey), new FrameworkPropertyMetadata(typeof(WhiteKey)));
     HeightProperty.OverrideMetadata(typeof(WhiteKey), new FrameworkPropertyMetadata(150.0));
     MarginProperty.OverrideMetadata(typeof(WhiteKey), new FrameworkPropertyMetadata(new Thickness(-2.0, 0, 0.0, 0.0)));
     WidthProperty.OverrideMetadata(typeof(WhiteKey), new FrameworkPropertyMetadata(23.0));
     //TextBlock.FontSizeProperty.OverrideMetadata(typeof(WhiteKey), new FrameworkPropertyMetadata(10.0));
 }
예제 #15
0
 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));
 }
예제 #16
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)));
 }
예제 #17
0
        static TickBar()
        {
            WidthProperty.OverrideDefaultValue <TickBar>(100);
            HeightProperty.OverrideDefaultValue <TickBar>(1);

            IsVisibleProperty.Changed.AddClassHandler <TickBar>((o, e) => OnIsVivibleChanged(o, e));
            PlacementProperty.Changed.AddClassHandler <TickBar>((o, e) => OnPlacementChanged(o, e));
            //AffectsRender<TickBar>(FillProperty, IsVisibleProperty, PlacementProperty);
            //AffectsArrange<TickBar>(IsVisibleProperty);
        }
예제 #18
0
파일: Image.cs 프로젝트: bradparks/Delight
        /// <summary>
        /// Called whenever properties affecting the image are changed.
        /// </summary>
        public virtual void ImageChanged()
        {
            if (ImageComponent == null)
            {
                return;
            }

            if (ColorProperty.IsUndefined(this))
            {
                if (ImageComponent.sprite != null || ImageComponent.overrideSprite != null)
                {
                    // use white color by default if image is set
                    ImageComponent.color = Color.white;
                }
                else
                {
                    // use clear color by default if image isn't set
                    ImageComponent.color = Color.clear;
                }
            }

            var sprite = ImageComponent.overrideSprite ?? ImageComponent.sprite;

            if (WidthProperty.IsUndefined(this) && HeightProperty.IsUndefined(this))
            {
                // if width and height is undefined, adjust size to native size of sprite
                if (sprite != null)
                {
                    ImageComponent.SetNativeSize();
                    OverrideWidth  = ElementSize.FromPixels(ImageComponent.rectTransform.sizeDelta.x);
                    OverrideHeight = ElementSize.FromPixels(ImageComponent.rectTransform.sizeDelta.y);
                    if (OverrideHeight.Pixels != 0)
                    {
                        _nativeAspectRatio = OverrideWidth.Pixels / OverrideHeight.Pixels;
                    }
                }
            }
            else
            {
                _nativeAspectRatio = -1;
            }

            bool isLoading = Sprite != null && !Sprite.IsLoaded;

            if (isLoading && sprite == null)
            {
                // always disable image while loading
                ImageComponent.enabled = false;
            }
            else
            {
                // disable raycast blocks if image is transparent
                ImageComponent.enabled = RaycastBlockMode == RaycastBlockMode.Always ? true : ImageComponent.color.a > 0;
            }
        }
예제 #19
0
        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));
        }
예제 #20
0
 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));
 }
예제 #21
0
        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)));
        }
예제 #22
0
		public StyleBase()
		{
			Width = new WidthProperty();
			Height= new HeightProperty();
			Padding = new PaddingProperty();
			Margin = new MarginProperty();
			FontSize = new FontSizeProperty();

			Color=string.Empty;
			BackgroundColor=string.Empty;
			Hidden=false;
		}
예제 #23
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;
        }
예제 #24
0
파일: Icon.cs 프로젝트: zalid/Elysium-Extra
 /// <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)));
 }
예제 #25
0
        void Detach()
        {
            _sourceProperty.Detach(OnSourceChanged);
            _fallbackSourceProperty.Detach(OnFallbackSourceChanged);
            _stretchProperty.Detach(OnArrangeGetsInvalid);
            _stretchDirectionProperty.Detach(OnArrangeGetsInvalid);
            _thumbnailProperty.Detach(OnArrangeGetsInvalid);
            _skinNeutralProperty.Detach(OnArrangeGetsInvalid);

            WidthProperty.Detach(OnImageSizeChanged);
            HeightProperty.Detach(OnImageSizeChanged);
        }
예제 #26
0
        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));
            }
        }
예제 #27
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));
 }
예제 #28
0
 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));
 }
예제 #29
0
        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)));
        }
예제 #31
0
        static DataGridColumnHeader()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(typeof(DataGridColumnHeader)));

            ContentProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceContent));
            ContentTemplateProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(null, OnNotifyPropertyChanged, OnCoerceContentTemplate));
            ContentTemplateSelectorProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(null, OnNotifyPropertyChanged, OnCoerceContentTemplateSelector));
            ContentStringFormatProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(null, OnNotifyPropertyChanged, OnCoerceStringFormat));
            StyleProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(null, OnNotifyPropertyChanged, OnCoerceStyle));
            HeightProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(OnNotifyPropertyChanged, OnCoerceHeight));

            FocusableProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(false));
            ClipProperty.OverrideMetadata(typeof(DataGridColumnHeader), new FrameworkPropertyMetadata(null, OnCoerceClip));
        }