Пример #1
0
 /// <summary>
 /// Initializes static members of the <see cref="Slider"/> class.
 /// </summary>
 static Slider()
 {
     OrientationProperty.OverrideDefaultValue(typeof(Slider), Orientation.Horizontal);
     Thumb.DragStartedEvent.AddClassHandler <Slider>(x => x.OnThumbDragStarted, RoutingStrategies.Bubble);
     Thumb.DragDeltaEvent.AddClassHandler <Slider>(x => x.OnThumbDragDelta, RoutingStrategies.Bubble);
     Thumb.DragCompletedEvent.AddClassHandler <Slider>(x => x.OnThumbDragCompleted, RoutingStrategies.Bubble);
     SmallChangeProperty.OverrideDefaultValue <Slider>(1);
     LargeChangeProperty.OverrideDefaultValue <Slider>(10);
 }
Пример #2
0
 /// <summary>
 /// Initializes static members of the <see cref="Slider"/> class.
 /// </summary>
 static Slider()
 {
     PseudoClass(OrientationProperty, o => o == Avalonia.Controls.Orientation.Vertical, ":vertical");
     PseudoClass(OrientationProperty, o => o == Avalonia.Controls.Orientation.Horizontal, ":horizontal");
     Thumb.DragStartedEvent.AddClassHandler <Slider>(x => x.OnThumbDragStarted, RoutingStrategies.Bubble);
     Thumb.DragDeltaEvent.AddClassHandler <Slider>(x => x.OnThumbDragDelta, RoutingStrategies.Bubble);
     Thumb.DragCompletedEvent.AddClassHandler <Slider>(x => x.OnThumbDragCompleted, RoutingStrategies.Bubble);
     SmallChangeProperty.OverrideDefaultValue <Slider>(1);
     LargeChangeProperty.OverrideDefaultValue <Slider>(10);
 }