static Separator()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(typeof(Separator)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Separator));

            IsEnabledProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
        }
Esempio n. 2
0
 /// <summary>
 /// Class ctor
 /// </summary>
 static ToolBarButton()
 {
     ImageProperty = DependencyProperty.Register("Image",
                                                 typeof(ImageSource),
                                                 typeof(ToolBarButton),
                                                 new FrameworkPropertyMetadata((ImageSource)null,
                                                                               FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure,
                                                                               ImageChanged));
     DisabledImageProperty = DependencyProperty.Register("DisabledImage",
                                                         typeof(ImageSource),
                                                         typeof(ToolBarButton),
                                                         new FrameworkPropertyMetadata((ImageSource)null,
                                                                                       FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure,
                                                                                       DisabledImageChanged));
     FlipProperty = DependencyProperty.Register("Flip",
                                                typeof(bool),
                                                typeof(ToolBarButton),
                                                new FrameworkPropertyMetadata(false,
                                                                              FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure,
                                                                              FlipChanged));
     TextProperty = DependencyProperty.Register("Text",
                                                typeof(String),
                                                typeof(ToolBarButton),
                                                new FrameworkPropertyMetadata("",
                                                                              FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.Inherits,
                                                                              TextChanged));
     DisplayStyleProperty = DependencyProperty.RegisterAttached("DisplayStyle",
                                                                typeof(DisplayStyleE),
                                                                typeof(ToolBarButton),
                                                                new FrameworkPropertyMetadata(DisplayStyleE.Text,
                                                                                              FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsParentArrange | FrameworkPropertyMetadataOptions.AffectsParentMeasure | FrameworkPropertyMetadataOptions.Inherits,
                                                                                              DisplayStyleChanged));
     IsEnabledProperty.OverrideMetadata(typeof(ToolBarButton), new FrameworkPropertyMetadata(true, new PropertyChangedCallback(IsEnabledChanged)));
 }
        /// <summary>
        /// Get the dependency property tests.
        /// </summary>
        /// <returns>The dependency property tests.</returns>
        public override IEnumerable <DependencyPropertyTestMethod> GetDependencyPropertyTests()
        {
            // Get the base Control dependency property tests
            IList <DependencyPropertyTestMethod> tests = TagInherited(base.GetDependencyPropertyTests());

            tests.Add(IsEnabledProperty.ChangesVisualStateTest(false, true, "Normal"));
            tests.Add(IsEnabledProperty.ChangesVisualStateTest(true, false, "Disabled"));
            tests.Add(IsEnabledProperty.DoesNotChangeVisualStateTest(true, true));
            tests.Add(IsEnabledProperty.DoesNotChangeVisualStateTest(false, false));

            tests.Add(IsReadOnlyProperty.IsReadOnlyTest);

            BorderBrushProperty.DefaultValue = new SolidColorBrush(Color.FromArgb(0xff, 0x54, 0x54, 0x54));

            // reactivate these if possible
            tests.RemoveTests(ForegroundProperty.CheckDefaultValueTest);
            tests.RemoveTests(ForegroundProperty.ClearValueResetsDefaultTest);
            tests.RemoveTests(HorizontalContentAlignmentProperty.CheckDefaultValueTest);
            tests.RemoveTests(HorizontalContentAlignmentProperty.ClearValueResetsDefaultTest);
            tests.RemoveTests(VerticalContentAlignmentProperty.CheckDefaultValueTest);
            tests.RemoveTests(VerticalContentAlignmentProperty.ClearValueResetsDefaultTest);

            // DisplayValue tests
            tests.Add(DisplayValueProperty.CheckDefaultValueTest);
            tests.Add(DisplayValueProperty.IsReadOnlyTest);
            return(tests);
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AutoGreyableImage"/> class.
 /// </summary>
 static AutoGreyableImage()
 {
     // Override the metadata of the IsEnabled property.
     IsEnabledProperty.OverrideMetadata(typeof(AutoGreyableImage),
                                        new FrameworkPropertyMetadata(true,
                                                                      new PropertyChangedCallback(OnAutoGreyScaleImageIsEnabledPropertyChanged)));
 }
        static TopFolderPreview()
        {
            Type ownerType = typeof(TopFolderPreview);

            IsEnabledProperty
            .OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false, OnIsEnabledChanged));
        }
 void Detach()
 {
     _keyProperty.Detach(OnBindingConcerningPropertyChanged);
     _descriptionProperty.Detach(OnBindingConcerningPropertyChanged);
     IsEnabledProperty.Detach(OnBindingConcerningPropertyChanged);
     ScreenProperty.Detach(OnBindingConcerningPropertyChanged);
 }
Esempio n. 7
0
 static CanEnableTextBox()
 {
     IsEnabledProperty.OverrideMetadata(typeof(CanEnableTextBox),
                                        new UIPropertyMetadata(true,
                                                               IsEnabledPropertyChanged,
                                                               CoerceIsEnabled));
 }
Esempio n. 8
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));
        }
Esempio n. 9
0
        static AppBarButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(AppBarButton),
                                                     new FrameworkPropertyMetadata(typeof(AppBarButton)));

            IsEnabledProperty.OverrideMetadata(typeof(AppBarButton),
                                               new FrameworkPropertyMetadata(OnIsEnabledChanged));

            CommandProperty.OverrideMetadata(typeof(AppBarButton),
                                             new FrameworkPropertyMetadata(OnCommandPropertyChanged));

            ToolTipProperty.OverrideMetadata(typeof(AppBarButton),
                                             new FrameworkPropertyMetadata {
                CoerceValueCallback = AppBarElementProperties.CoerceToolTip
            });

            ToolBar.OverflowModeProperty.OverrideMetadata(typeof(AppBarButton),
                                                          new FrameworkPropertyMetadata(OnOverflowModePropertyChanged));

            CommandBarToolBar.DefaultLabelPositionProperty.OverrideMetadata(typeof(AppBarButton),
                                                                            new FrameworkPropertyMetadata(OnDefaultLabelPositionPropertyChanged));

            AppBarElementProperties.IsInOverflowPropertyKey.OverrideMetadata(typeof(AppBarButton),
                                                                             new FrameworkPropertyMetadata(OnIsInOverflowChanged));

            AppBarElementProperties.ShowKeyboardAcceleratorTextProperty.OverrideMetadata(typeof(AppBarButton),
                                                                                         new FrameworkPropertyMetadata(OnShowKeyboardAcceleratorTextPropertyChanged));
        }
Esempio n. 10
0
        static customTabItem()
        {
            FrameworkPropertyMetadata IsSecectMetaData = new FrameworkPropertyMetadata();

            IsSecectMetaData.DefaultValue             = false;
            IsSecectMetaData.PropertyChangedCallback += new PropertyChangedCallback(OnIsSelect_Changed);
            IsSelectProperty =
                DependencyProperty.Register(
                    "IsSelect",
                    typeof(Boolean),
                    typeof(customTabItem),
                    IsSecectMetaData);

            TextProperty =
                DependencyProperty.Register(
                    "Text",
                    typeof(string),
                    typeof(customTabItem));

            IsEnabledProperty.OverrideMetadata(typeof(customTabItem),
                                               new FrameworkPropertyMetadata(true, new PropertyChangedCallback(OnIsEnabled_Changed)));

            btnClickEvent =
                EventManager.RegisterRoutedEvent("btnClick", RoutingStrategy.Bubble,
                                                 typeof(RoutedEventHandler), typeof(customTabItem));
        }
Esempio n. 11
0
 static ColorPicker()
 {
     IsEnabledProperty.OverrideMetadata(typeof(ColorPicker), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (d, e) => ((ColorPicker)d).UpdateVisibility()
     });
     DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorPicker), new FrameworkPropertyMetadata(typeof(ColorPicker)));
 }
Esempio n. 12
0
 /// <summary>
 /// Static constructor
 /// </summary>
 static DatePicker()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(DatePicker), new FrameworkPropertyMetadata(typeof(DatePicker)));
     EventManager.RegisterClassHandler(typeof(DatePicker), UIElement.GotFocusEvent, new RoutedEventHandler(OnGotFocus));
     KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(DatePicker), new FrameworkPropertyMetadata(KeyboardNavigationMode.Once));
     KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(DatePicker), new FrameworkPropertyMetadata(false));
     IsEnabledProperty.OverrideMetadata(typeof(DatePicker), new UIPropertyMetadata(new PropertyChangedCallback(OnIsEnabledChanged)));
 }
        static GroupSeparatorMenuItem()
        {
            var type = typeof(GroupSeparatorMenuItem);

            DefaultStyleKeyProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(type));
            IsEnabledProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, null, CoerceIsEnabledAndTabStop));
            IsTabStopProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, null, CoerceIsEnabledAndTabStop));
        }
Esempio n. 14
0
 static DateTimePicker()
 {
     IsEnabledProperty.OverrideMetadata(typeof(DateTimePicker), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = new PropertyChangedCallback(UpdateVisibility)
     });
     DefaultStyleKeyProperty.OverrideMetadata(typeof(DateTimePicker), new FrameworkPropertyMetadata(typeof(DateTimePicker)));
 }
Esempio n. 15
0
 static EnabledContentPresenter()
 {
     IsEnabledProperty.OverrideMetadata(
         typeof(EnabledContentPresenter),
         new UIPropertyMetadata(
             defaultValue: true,
             EnabledContentPresenter_IsEnabledChanged,
             CoerceIsEnabled));
 }
Esempio n. 16
0
        static TabControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(typeof(TabControl)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(TabControl));
            IsTabStopProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(MS.Internal.KnownBoxes.BooleanBoxes.FalseBox));
            KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(KeyboardNavigationMode.Contained));

            IsEnabledProperty.OverrideMetadata(typeof(TabControl), new UIPropertyMetadata(new PropertyChangedCallback(OnVisualStatePropertyChanged)));
        }
Esempio n. 17
0
        static EnableImage()
        {
            SnapsToDevicePixelsProperty.OverrideMetadata(typeof(EnableImage), new FrameworkPropertyMetadata(true));
            //UseLayoutRoundingProperty.OverrideMetadata(typeof(EnableImage), new FrameworkPropertyMetadata(false));
            RenderOptions.EdgeModeProperty.OverrideMetadata(typeof(EnableImage), new FrameworkPropertyMetadata(EdgeMode.Aliased));

            SourceProperty.OverrideMetadata(typeof(EnableImage), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnSourceChanged)));
            IsEnabledProperty.OverrideMetadata(typeof(EnableImage), new FrameworkPropertyMetadata(true, new PropertyChangedCallback(OnIsEnabledChanged)));
        }
        public LoadingButton()
        {
            IsEnabledProperty.OverrideMetadata(typeof(LoadingButton),
                                               new FrameworkPropertyMetadata(true,
                                                                             new PropertyChangedCallback(IsEnabledPropertyChanged),
                                                                             new CoerceValueCallback(CoerceIsEnabled)));

            InitializeComponent();
        }
Esempio n. 19
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));
        }
Esempio n. 20
0
        /// <summary>
        /// Static constructor
        /// </summary>
        static SeparatorTabItem()
        {
            var type = typeof(SeparatorTabItem);

            DefaultStyleKeyProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(type));
            IsEnabledProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, null, CoerceIsEnabledAndTabStop));
            IsTabStopProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, null, CoerceIsEnabledAndTabStop));
            IsSelectedProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, OnIsSelectedChanged));
        }
Esempio n. 21
0
        /// <summary>
        /// Initializes the <see cref="ComboBox"/> type.
        /// </summary>
        static ComboBox()
        {
            EventManager.RegisterClassHandler(typeof(ComboBox), LoadedEvent, new UpfRoutedEventHandler(HandleLoaded));

            EventManager.RegisterClassHandler(typeof(ComboBox), Mouse.LostMouseCaptureEvent, new UpfRoutedEventHandler(HandleLostMouseCapture));
            EventManager.RegisterClassHandler(typeof(ComboBox), Mouse.MouseDownEvent, new UpfMouseButtonEventHandler(HandleMouseDown));

            IsEnabledProperty.OverrideMetadata(typeof(ComboBox), new PropertyMetadata <Boolean>(HandleIsEnabledChanged));
        }
        static GroupSeparatorMenuItem()
        {
            Type type = typeof(GroupSeparatorMenuItem);

            DefaultStyleKeyProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(type));
            StyleProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceStyle)));
            IsEnabledProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(false, null, CoerceIsEnabledAndTabStop));
            IsTabStopProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(false, null, CoerceIsEnabledAndTabStop));
        }
Esempio n. 23
0
        //-------------------------------------------------------------------
        //
        //  Constructors
        //
        //-------------------------------------------------------------------

        #region Constructors

        static Expander()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Expander), new FrameworkPropertyMetadata(typeof(Expander)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Expander));

            IsTabStopProperty.OverrideMetadata(typeof(Expander), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));

            IsMouseOverPropertyKey.OverrideMetadata(typeof(Expander), new UIPropertyMetadata(new PropertyChangedCallback(OnVisualStatePropertyChanged)));
            IsEnabledProperty.OverrideMetadata(typeof(Expander), new UIPropertyMetadata(new PropertyChangedCallback(OnVisualStatePropertyChanged)));
        }
Esempio n. 24
0
        static SeparatorTabItem()
        {
            Type type = typeof(SeparatorTabItem);

            DefaultStyleKeyProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(type));
            IsEnabledProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(false, null, CoerceIsEnabledAndTabStop));
            IsTabStopProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(false, null, CoerceIsEnabledAndTabStop));
            IsSelectedProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(false, OnIsSelectedChanged));
            StyleProperty.OverrideMetadata(typeof(SeparatorTabItem), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceStyle)));
        }
Esempio n. 25
0
        static RotatingButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RotatingButton), new FrameworkPropertyMetadata(typeof(RotatingButton)));

            //FocusableProperty.OverrideMetadata(typeof(RotatingButton), new UIPropertyMetadata(true));
            //_dType = DependencyObjectType.FromSystemTypeInternal(typeof(RepeatButton));
            ClickModeProperty.OverrideMetadata(typeof(RotatingButton), new FrameworkPropertyMetadata(ClickMode.Press));

            IsEnabledProperty.OverrideMetadata(typeof(RotatingButton), new FrameworkPropertyMetadata(true));
        }
Esempio n. 26
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));
 }
Esempio n. 27
0
        /// <summary>
        ///     Static constructor
        /// </summary>
        static MyDatePicker()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(DatePicker), new FrameworkPropertyMetadata(typeof(DatePicker)));
            EventManager.RegisterClassHandler(typeof(DatePicker), GotFocusEvent, new RoutedEventHandler(OnGotFocus));
            KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(DatePicker), new FrameworkPropertyMetadata(KeyboardNavigationMode.Once));
            KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(DatePicker), new FrameworkPropertyMetadata(false));
            IsEnabledProperty.OverrideMetadata(typeof(DatePicker), new UIPropertyMetadata(OnIsEnabledChanged));

            ControlsTraceLogger.AddControl(TelemetryControls.DatePicker);
        }
Esempio n. 28
0
 static ButtonBase()
 {
     IsEnabledProperty.OverrideMetadata(
         typeof(ButtonBase),
         new FrameworkPropertyMetadata(
             defaultValue: true,
             propertyChangedCallback: null,
             coerceValueCallback: CoerceIsEnabled
             )
         );
 }
Esempio n. 29
0
 static RangeTrack()
 {
     IsEnabledProperty.OverrideMetadata(
         typeof(RangeTrack <T, TInterval>),
         new UIPropertyMetadata((d, e) =>
     {
         if ((bool)e.NewValue)
         {
             Mouse.Synchronize();
         }
     }));
 }
Esempio n. 30
0
        static Thumb()
        {
            // Register metadata for dependency properties
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Thumb), new FrameworkPropertyMetadata(typeof(Thumb)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Thumb));
            FocusableProperty.OverrideMetadata(typeof(Thumb), new FrameworkPropertyMetadata(MS.Internal.KnownBoxes.BooleanBoxes.FalseBox));

            EventManager.RegisterClassHandler(typeof(Thumb), Mouse.LostMouseCaptureEvent, new MouseEventHandler(OnLostMouseCapture));

            IsEnabledProperty.OverrideMetadata(typeof(Thumb), new UIPropertyMetadata(new PropertyChangedCallback(OnVisualStatePropertyChanged)));
            IsMouseOverPropertyKey.OverrideMetadata(typeof(Thumb), new UIPropertyMetadata(new PropertyChangedCallback(OnVisualStatePropertyChanged)));
        }