示例#1
0
 static DoubleUpDown()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(DoubleUpDown), new FrameworkPropertyMetadata(typeof(DoubleUpDown)));
     DefaultValueProperty.OverrideMetadata(typeof(DoubleUpDown), new FrameworkPropertyMetadata(default(double)));
     IncrementProperty.OverrideMetadata(typeof(DoubleUpDown), new FrameworkPropertyMetadata(1d));
     MaximumProperty.OverrideMetadata(typeof(DoubleUpDown), new FrameworkPropertyMetadata(double.MaxValue));
     MinimumProperty.OverrideMetadata(typeof(DoubleUpDown), new FrameworkPropertyMetadata(double.MinValue));
 }
示例#2
0
 static DecimalUpDown()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(DecimalUpDown), new FrameworkPropertyMetadata(typeof(DecimalUpDown)));
     DefaultValueProperty.OverrideMetadata(typeof(DecimalUpDown), new FrameworkPropertyMetadata(default(decimal)));
     IncrementProperty.OverrideMetadata(typeof(DecimalUpDown), new FrameworkPropertyMetadata(1m));
     MaximumProperty.OverrideMetadata(typeof(DecimalUpDown), new FrameworkPropertyMetadata(decimal.MaxValue));
     MinimumProperty.OverrideMetadata(typeof(DecimalUpDown), new FrameworkPropertyMetadata(decimal.MinValue));
 }
 static IntegerUpDown()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(IntegerUpDown), new FrameworkPropertyMetadata(typeof(IntegerUpDown)));
     DefaultValueProperty.OverrideMetadata(typeof(IntegerUpDown), new FrameworkPropertyMetadata(0));
     IncrementProperty.OverrideMetadata(typeof(IntegerUpDown), new FrameworkPropertyMetadata(1));
     MaximumProperty.OverrideMetadata(typeof(IntegerUpDown), new FrameworkPropertyMetadata(int.MaxValue));
     MinimumProperty.OverrideMetadata(typeof(IntegerUpDown), new FrameworkPropertyMetadata(int.MinValue));
 }
示例#4
0
 static ColorSlider()
 {
     FromColorProperty = DependencyProperty.Register("FromColor", typeof(Color), typeof(ColorSlider), new PropertyMetadata(null));
     ToColorProperty   = DependencyProperty.Register("ToColor", typeof(Color), typeof(ColorSlider), new PropertyMetadata(null));
     DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorSlider), new FrameworkPropertyMetadata(typeof(ColorSlider)));
     MaximumProperty.OverrideMetadata(typeof(ColorSlider), new FrameworkPropertyMetadata(255d));
     MinimumProperty.OverrideMetadata(typeof(ColorSlider), new FrameworkPropertyMetadata(0d));
     IsMoveToPointEnabledProperty.OverrideMetadata(typeof(ColorSlider), new FrameworkPropertyMetadata(true));
 }
示例#5
0
 static SpectrumSlider()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(SpectrumSlider), new FrameworkPropertyMetadata(typeof(SpectrumSlider)));
     HueProperty = DependencyProperty.Register("Hue", typeof(double), typeof(SpectrumSlider), new PropertyMetadata(0d, OnHuePropertyChanged));
     OrientationProperty.OverrideMetadata(typeof(SpectrumSlider), new FrameworkPropertyMetadata(System.Windows.Controls.Orientation.Vertical));
     MaximumProperty.OverrideMetadata(typeof(SpectrumSlider), new FrameworkPropertyMetadata(360d));
     MinimumProperty.OverrideMetadata(typeof(SpectrumSlider), new FrameworkPropertyMetadata(0d));
     IsMoveToPointEnabledProperty.OverrideMetadata(typeof(SpectrumSlider), new FrameworkPropertyMetadata(true));
 }
示例#6
0
 static Rating()
 {
     MinimumProperty.OverrideMetadata(typeof(Rating),
                                      new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
     MaximumProperty.OverrideMetadata(typeof(Rating),
                                      new FrameworkPropertyMetadata(5.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
     IsSnapToTickEnabledProperty.OverrideMetadata(typeof(Rating), new FrameworkPropertyMetadata(true));
     SmallChangeProperty.OverrideMetadata(typeof(Rating), new FrameworkPropertyMetadata(1.0));
     DefaultStyleKeyProperty.OverrideMetadata(typeof(Rating), new FrameworkPropertyMetadata(typeof(Rating)));
 }
        static RectangleProgressBar()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RectangleProgressBar), new FrameworkPropertyMetadata(typeof(RectangleProgressBar)));

            MinimumProperty.OverrideMetadata(typeof(RectangleProgressBar), new FrameworkPropertyMetadata(0.0d));
            MaximumProperty.OverrideMetadata(typeof(RectangleProgressBar), new FrameworkPropertyMetadata(100.0d));
            ValueProperty.OverrideMetadata(typeof(RectangleProgressBar), new FrameworkPropertyMetadata(0d));

            EventManager.RegisterClassHandler(typeof(RectangleProgressBar), FrameworkElement.SizeChangedEvent, new SizeChangedEventHandler(OnSizeChanged));
        }
示例#8
0
        static NumericUpDown()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(typeof(NumericUpDown)));
            MinimumProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(double.MinValue, null, CoerceMinimum));
            SmallChangeProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(DefaultInterval, IntervalChanged));
            LargeChangeProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(100 * DefaultInterval));
            MaximumProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(double.MaxValue));

            VerticalContentAlignmentProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(VerticalAlignment.Center));
            HorizontalContentAlignmentProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(HorizontalAlignment.Right));
        }
        /// <summary>
        /// Initializes the <see cref="NumericUpDown"/> type.
        /// </summary>
        static NumericUpDown()
        {
            EventManager.RegisterClassHandler(typeof(NumericUpDown), Mouse.PreviewMouseWheelEvent, new UpfMouseWheelEventHandler(HandlePreviewMouseWheel));
            EventManager.RegisterClassHandler(typeof(NumericUpDown), Keyboard.PreviewKeyDownEvent, new UpfKeyDownEventHandler(HandlePreviewKeyDown));
            EventManager.RegisterClassHandler(typeof(NumericUpDown), TextEditor.TextEntryValidationEvent, new UpfTextEntryValidationHandler(HandleTextEntryValidation));

            FocusableProperty.OverrideMetadata(typeof(NumericUpDown), new PropertyMetadata <Boolean>(false));
            MinimumProperty.OverrideMetadata(typeof(NumericUpDown), new PropertyMetadata <Double>(0.0));
            MaximumProperty.OverrideMetadata(typeof(NumericUpDown), new PropertyMetadata <Double>(100.0));
            SmallChangeProperty.OverrideMetadata(typeof(NumericUpDown), new PropertyMetadata <Double>(1.0));
        }
示例#10
0
        static CircularProgressBar()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(typeof(CircularProgressBar)));

            MinimumProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(0D));
            MaximumProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(100D));
            SmallChangeProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(1D));
            LargeChangeProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(10D));
            BorderBrushProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(Brushes.LightGray));
            BorderThicknessProperty.OverrideMetadata(typeof(CircularProgressBar), new FrameworkPropertyMetadata(new Thickness(10), OnBorderThicknessChanged));
        }
示例#11
0
        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));
        }
示例#12
0
        static ProgressRing()
        {
            MaximumProperty.Changed.Subscribe(CalibrateAngles);
            MinimumProperty.Changed.Subscribe(CalibrateAngles);
            ValueProperty.Changed.Subscribe(CalibrateAngles);

            MaximumProperty.OverrideMetadata <ProgressRing>(new DirectPropertyMetadata <double>(100));
            MinimumProperty.OverrideMetadata <ProgressRing>(new DirectPropertyMetadata <double>(0));
            ValueProperty.OverrideMetadata <ProgressRing>(new DirectPropertyMetadata <double>(25));

            AffectsRender <ProgressRing>(XAngleProperty, YAngleProperty);
        }
示例#13
0
        /// <summary>
        /// Initializes the <see cref="ScrollBar"/> type.
        /// </summary>
        static ScrollBar()
        {
            // Dependency property overrides
            ValueProperty.OverrideMetadata(typeof(ScrollBar), new PropertyMetadata <Double>(HandleValueChanged));
            MinimumProperty.OverrideMetadata(typeof(ScrollBar), new PropertyMetadata <Double>(HandleMinimumChanged));
            MaximumProperty.OverrideMetadata(typeof(ScrollBar), new PropertyMetadata <Double>(HandleMaximumChanged));
            SmallChangeProperty.OverrideMetadata(typeof(ScrollBar), new PropertyMetadata <Double>(HandleSmallChangeChanged));
            LargeChangeProperty.OverrideMetadata(typeof(ScrollBar), new PropertyMetadata <Double>(HandleLargeChangeChanged));
            FocusableProperty.OverrideMetadata(typeof(ScrollBar), new PropertyMetadata <Boolean>(CommonBoxedValues.Boolean.False));

            // Event handlers
            EventManager.RegisterClassHandler(typeof(ScrollBar), ScrollEvent, new UpfScrollEventHandler(HandleScrollEvent));

            // Commands - vertical scroll
            CommandManager.RegisterClassBindings(typeof(ScrollBar), LineDownCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.Down, ModifierKeys.None, "Down"),
                                                 new GamePadGesture(GamePadButton.LeftStickDown, 0, "LeftStickDown"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), LineUpCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.Up, ModifierKeys.None, "Up"),
                                                 new GamePadGesture(GamePadButton.LeftStickUp, 0, "LeftStickUp"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), PageDownCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.PageDown, ModifierKeys.None, "PageDown"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), PageUpCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.PageUp, ModifierKeys.None, "PageUp"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), ScrollToBottomCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.End, ModifierKeys.Control, "Ctrl+End"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), ScrollToTopCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.Home, ModifierKeys.Control, "Ctrl+Home"));

            // Commands - horizontal scroll
            CommandManager.RegisterClassBindings(typeof(ScrollBar), LineRightCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.Right, ModifierKeys.None, "Right"),
                                                 new GamePadGesture(GamePadButton.LeftStickRight, 0, "LeftStickRight"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), LineLeftCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.Left, ModifierKeys.None, "Left"),
                                                 new GamePadGesture(GamePadButton.LeftStickLeft, 0, "LeftStickLeft"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), PageRightCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 null);
            CommandManager.RegisterClassBindings(typeof(ScrollBar), PageLeftCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 null);
            CommandManager.RegisterClassBindings(typeof(ScrollBar), ScrollToRightEndCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.End, ModifierKeys.None, "End"));
            CommandManager.RegisterClassBindings(typeof(ScrollBar), ScrollToLeftEndCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 new KeyGesture(Key.Home, ModifierKeys.None, "Home"));

            // Commands - misc
            CommandManager.RegisterClassBindings(typeof(ScrollBar), ScrollHereCommand, ExecutedScrollCommand, CanExecuteScrollCommand,
                                                 null);
        }
示例#14
0
        static DateTimeRangeTrack()
        {
            Type thisType = typeof(DateTimeRangeTrack);

            DateTime from = new DateTime(1900, 1, 1), to = new DateTime(2000, 1, 1);

            MinimumProperty.OverrideMetadata(thisType,
                                             new FrameworkPropertyMetadata(from, FrameworkPropertyMetadataOptions.AffectsArrange));
            MaximumProperty.OverrideMetadata(thisType,
                                             new FrameworkPropertyMetadata(to, FrameworkPropertyMetadataOptions.AffectsArrange));
            StartValueProperty.OverrideMetadata(thisType,
                                                new FrameworkPropertyMetadata(from, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsArrange));
            EndValueProperty.OverrideMetadata(thisType,
                                              new FrameworkPropertyMetadata(to, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsArrange));
        }
示例#15
0
        static RadialSlider()
        {
            MaximumProperty.Changed.Subscribe(CalibrateAngles);
            MinimumProperty.Changed.Subscribe(CalibrateAngles);
            ValueProperty.Changed.Subscribe(CalibrateAngles);

            BoundsProperty.Changed.Subscribe(UpdateRadius);
            StrokeWidthProperty.Changed.Subscribe(UpdateRadius);


            MaximumProperty.OverrideMetadata <RadialSlider>(new DirectPropertyMetadata <double>(100));
            MinimumProperty.OverrideMetadata <RadialSlider>(new DirectPropertyMetadata <double>(0));
            ValueProperty.OverrideMetadata <RadialSlider>(new DirectPropertyMetadata <double>(25));

            AffectsRender <RadialSlider>(XAngleProperty, YAngleProperty);
        }
示例#16
0
        // Static constructor.
        static Slider3D()
        {
            OrientationProperty.OverrideMetadata(typeof(Slider3D),
                                                 new FrameworkPropertyMetadata(PropertyChanged));

            ValueProperty.OverrideMetadata(typeof(Slider3D),
                                           new FrameworkPropertyMetadata(PropertyChanged));

            MinimumProperty.OverrideMetadata(typeof(Slider3D),
                                             new FrameworkPropertyMetadata(PropertyChanged));

            MaximumProperty.OverrideMetadata(typeof(Slider3D),
                                             new FrameworkPropertyMetadata(PropertyChanged));

            IsDirectionReversedProperty.OverrideMetadata(typeof(Slider3D),
                                                         new FrameworkPropertyMetadata(PropertyChanged));
        }
示例#17
0
        /// <summary>
        /// Static constructor.
        /// </summary>
        static Knob3D()
        {
            ValueProperty.OverrideMetadata(
                typeof(Knob3D),
                new UIPropertyMetadata(
                    ValuePropertyChanged));

            MinimumProperty.OverrideMetadata(
                typeof(Knob3D),
                new UIPropertyMetadata(
                    MinimumPropertyChanged));

            MaximumProperty.OverrideMetadata(
                typeof(Knob3D),
                new UIPropertyMetadata(
                    MaximumPropertyChanged));
        }
示例#18
0
        static NumericRangeTrack()
        {
            Type thisType = typeof(NumericRangeTrack);

            MinimumProperty.OverrideMetadata(
                thisType,
                new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsArrange));
            MaximumProperty.OverrideMetadata(
                thisType,
                new FrameworkPropertyMetadata(1.0, FrameworkPropertyMetadataOptions.AffectsArrange));
            StartValueProperty.OverrideMetadata(
                thisType,
                new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsArrange));
            EndValueProperty.OverrideMetadata(
                thisType,
                new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsArrange));
        }
    static RangeSlider()
    {
        InitializeCommands();

        MinimumProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
        MaximumProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
        ValueStartProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
        ValueEndProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));

        // Register Event Handler for the Thumb
        EventManager.RegisterClassHandler(typeof(RangeSlider), Thumb.DragStartedEvent, new DragStartedEventHandler(OnThumbDragStarted));
        EventManager.RegisterClassHandler(typeof(RangeSlider), Thumb.DragDeltaEvent, new DragDeltaEventHandler(OnThumbDragDelta));
        EventManager.RegisterClassHandler(typeof(RangeSlider), Thumb.DragCompletedEvent, new DragCompletedEventHandler(OnThumbDragCompleted));

        // Listen to MouseLeftButtonDown event to determine if slide should move focus to itself
        EventManager.RegisterClassHandler(typeof(RangeSlider), Mouse.MouseDownEvent, new MouseButtonEventHandler(OnMouseLeftButtonDown), true);
    }
示例#20
0
        static RadialColorSlider()
        {
            MinimumProperty.OverrideMetadata <RadialColorSlider>(new DirectPropertyMetadata <double>(0));
            MaximumProperty.OverrideMetadata <RadialColorSlider>(new DirectPropertyMetadata <double>(360));

            BoundsProperty.Changed.Subscribe(x =>
            {
                if (x.Sender is RadialColorSlider r)
                {
                    r.InternalWidth = r.Bounds.Width - (r.StrokeWidth * 2);
                }
            });

            ValueProperty.Changed.Subscribe(x =>
            {
                if (x.Sender is RadialColorSlider r)
                {
                    r.HueColor = new HSV(r.Value, 1, 1).ToColor();
                }
            });
        }
示例#21
0
        /// <summary>
        /// Static constructor.
        /// </summary>
        static Knob()
        {
            DefaultStyleKeyProperty.OverrideMetadata(
                typeof(Knob),
                new FrameworkPropertyMetadata(typeof(Knob))); // FrameworkPropertyMetadata is required

            ValueProperty.OverrideMetadata(
                typeof(Knob),
                new FrameworkPropertyMetadata(
                    OnValueChanged));

            MinimumProperty.OverrideMetadata(
                typeof(Knob),
                new FrameworkPropertyMetadata(
                    OnMinimumChanged));

            MaximumProperty.OverrideMetadata(
                typeof(Knob),
                new FrameworkPropertyMetadata(
                    OnMaximumChanged));
        }
示例#22
0
        //-------------------------------------------------------------------
        //
        //  Private Members
        //
        //-------------------------------------------------------------------

        #region Private Members

        #endregion

        //-------------------------------------------------------------------
        //
        //  Static Constructor & Delegates
        //
        //-------------------------------------------------------------------

        #region Static Constructor & Delegates

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

            var onScrollCommand      = new ExecutedRoutedEventHandler(OnScrollCommand);
            var onQueryScrollCommand = new CanExecuteRoutedEventHandler(OnQueryScrollCommand);

            FocusableProperty.OverrideMetadata(typeof(ScrollBar), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));

            // Register Event Handler for the Thumb
            EventManager.RegisterClassHandler(typeof(ScrollBar), Thumb.DragStartedEvent, new DragStartedEventHandler(OnThumbDragStarted));
            EventManager.RegisterClassHandler(typeof(ScrollBar), Thumb.DragDeltaEvent, new DragDeltaEventHandler(OnThumbDragDelta));
            EventManager.RegisterClassHandler(typeof(ScrollBar), Thumb.DragCompletedEvent, new DragCompletedEventHandler(OnThumbDragCompleted));

            // ScrollBar has common handler for ScrollHere command.
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.ScrollHereCommand, onScrollCommand, new CanExecuteRoutedEventHandler(OnQueryScrollHereCommand));
            // Vertical Commands
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.LineUpCommand, onScrollCommand, onQueryScrollCommand, Key.Up);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.LineDownCommand, onScrollCommand, onQueryScrollCommand, Key.Down);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.PageUpCommand, onScrollCommand, onQueryScrollCommand, Key.PageUp);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.PageDownCommand, onScrollCommand, onQueryScrollCommand, Key.PageDown);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.ScrollToTopCommand, onScrollCommand, onQueryScrollCommand, new KeyGesture(Key.Home, ModifierKeys.Control));
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.ScrollToBottomCommand, onScrollCommand, onQueryScrollCommand, new KeyGesture(Key.End, ModifierKeys.Control));
            // Horizontal Commands
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.LineLeftCommand, onScrollCommand, onQueryScrollCommand, Key.Left);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.LineRightCommand, onScrollCommand, onQueryScrollCommand, Key.Right);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.PageLeftCommand, onScrollCommand, onQueryScrollCommand);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.PageRightCommand, onScrollCommand, onQueryScrollCommand);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.ScrollToLeftEndCommand, onScrollCommand, onQueryScrollCommand, Key.Home);
            CommandHelpers.RegisterCommandHandler(typeof(ScrollBar), ScrollBar.ScrollToRightEndCommand, onScrollCommand, onQueryScrollCommand, Key.End);

            MaximumProperty.OverrideMetadata(typeof(ScrollBar), new FrameworkPropertyMetadata(new PropertyChangedCallback(ViewChanged)));
            MinimumProperty.OverrideMetadata(typeof(ScrollBar), new FrameworkPropertyMetadata(new PropertyChangedCallback(ViewChanged)));

            ContextMenuProperty.OverrideMetadata(typeof(ScrollBar), new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceContextMenu)));

            ControlsTraceLogger.AddControl(TelemetryControls.ScrollBar);
        }
示例#23
0
 /// <summary>
 /// Initializes static members of the <see cref="NumericUpDown"/> class.
 /// </summary>
 static NumericUpDown()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(typeof(NumericUpDown)));
     MinimumProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(double.NegativeInfinity));
     MaximumProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(double.PositiveInfinity));
 }
示例#24
0
 private static void UpdateMetadataCommon(Type type, T?increment, T?minValue, T?maxValue)
 {
     IncrementProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(increment));
     MaximumProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(maxValue));
     MinimumProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(minValue));
 }
示例#25
0
 static LogSlider()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(LogSlider), new FrameworkPropertyMetadata(typeof(LogSlider)));
     MinimumProperty.OverrideMetadata(typeof(LogSlider), new FrameworkPropertyMetadata(1.0d));
 }
示例#26
0
 /// <summary>
 /// Updates the class metadata.
 /// </summary>
 /// <param name="pType">The type of the concrete editor.</param>
 /// <param name="pIncrement">The increment value.</param>
 /// <param name="pMinValue">The minimum value.</param>
 /// <param name="pMaxValue">The maximum value.</param>
 private static void UpdateMetadataCommon(Type pType, T?pIncrement, T?pMinValue, T?pMaxValue)
 {
     IncrementProperty.OverrideMetadata(pType, new FrameworkPropertyMetadata(pIncrement));
     MinimumProperty.OverrideMetadata(pType, new FrameworkPropertyMetadata(pMinValue));
     MaximumProperty.OverrideMetadata(pType, new FrameworkPropertyMetadata(pMaxValue));
 }
示例#27
0
 static DateTimeUpDown()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(DateTimeUpDown), new FrameworkPropertyMetadata(typeof(DateTimeUpDown)));
     MaximumProperty.OverrideMetadata(typeof(DateTimeUpDown), new FrameworkPropertyMetadata(DateTime.MaxValue));
     MinimumProperty.OverrideMetadata(typeof(DateTimeUpDown), new FrameworkPropertyMetadata(DateTime.MinValue));
 }
示例#28
0
 static LabeledSlider()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(LabeledSlider), new FrameworkPropertyMetadata(typeof(LabeledSlider)));
     MinimumProperty.OverrideMetadata(typeof(LabeledSlider), new FrameworkPropertyMetadata(LogarithmicScalePropertyChangedCallback));
     MaximumProperty.OverrideMetadata(typeof(LabeledSlider), new FrameworkPropertyMetadata(LogarithmicScalePropertyChangedCallback));
 }