Exemplo n.º 1
0
        public void ScrollBar_Should_Not_AutoHide_When_ViewportSize_Is_NaN()
        {
            var target = new ScrollBar();

            target.Visibility = ScrollBarVisibility.Auto;
            target.Minimum = 0;
            target.Maximum = 100;
            target.ViewportSize = double.NaN;

            Assert.True(target.IsVisible);
        }
Exemplo n.º 2
0
        public void ScrollBar_Can_AutoHide()
        {
            var target = new ScrollBar();

            target.Visibility = ScrollBarVisibility.Auto;
            target.Minimum = 0;
            target.Maximum = 100;
            target.ViewportSize = 100;

            Assert.False(target.IsVisible);
        }
Exemplo n.º 3
0
        public void Setting_Track_Value_Should_Update_Value()
        {
            var target = new ScrollBar
            {
                Template = new FuncControlTemplate<ScrollBar>(Template),
            };

            target.ApplyTemplate();
            var track = (Track)target.GetTemplateChildren().First(x => x.Name == "track");
            track.Value = 50;

            Assert.Equal(target.Value, 50);
        }
Exemplo n.º 4
0
        public void ScrollBar_Should_Not_AutoHide_When_Visibility_Set_To_Visible()
        {
            var target = new ScrollBar();

            target.Visibility = ScrollBarVisibility.Visible;
            target.Minimum = 0;
            target.Maximum = 100;
            target.ViewportSize = 100;

            Assert.True(target.IsVisible);
        }
Exemplo n.º 5
0
 private static Control Template(ScrollBar control)
 {
     return new Border
     {
         Child = new Track
         {
             Name = "track",
             [!Track.MinimumProperty] = control[!RangeBase.MinimumProperty],
             [!Track.MaximumProperty] = control[!RangeBase.MaximumProperty],
             [!!Track.ValueProperty] = control[!!RangeBase.ValueProperty],
             [!Track.ViewportSizeProperty] = control[!ScrollBar.ViewportSizeProperty],
             [!Track.OrientationProperty] = control[!ScrollBar.OrientationProperty],
             Thumb = new Thumb
             {
                 Template = new FuncControlTemplate<Thumb>(ThumbTemplate),
             },
         },
     };
 }
Exemplo n.º 6
0
        public void ScrollBar_Should_Hide_When_Visibility_Set_To_Hidden()
        {
            var target = new ScrollBar();

            target.Visibility = ScrollBarVisibility.Hidden;
            target.Minimum = 0;
            target.Maximum = 100;
            target.ViewportSize = 10;

            Assert.False(target.IsVisible);
        }