Browse Source

Display scrollbar value in test app.

Value is currently wrong, surprise!
pull/4/head
Steven Kirk 11 years ago
parent
commit
785f89f14b
  1. 2
      Perspex.Themes.Default/ScrollBarStyle.cs
  2. 34
      TestApplication/Program.cs

2
Perspex.Themes.Default/ScrollBarStyle.cs

@ -54,7 +54,7 @@ namespace Perspex.Themes.Default
{
[~Track.MinimumProperty] = control[~ScrollBar.MinimumProperty],
[~Track.MaximumProperty] = control[~ScrollBar.MaximumProperty],
[~Track.ValueProperty] = control[~ScrollBar.ValueProperty],
[~~Track.ValueProperty] = control[~ScrollBar.ValueProperty],
[~Track.ViewportSizeProperty] = control[~ScrollBar.ViewportSizeProperty],
[~Track.OrientationProperty] = control[~ScrollBar.OrientationProperty],
Thumb = new Thumb

34
TestApplication/Program.cs

@ -1,4 +1,5 @@
using Perspex;
using System.Reactive.Linq;
using Perspex;
using Perspex.Controls;
using Perspex.Controls.Primitives;
using Perspex.Diagnostics;
@ -248,15 +249,25 @@ namespace TestApplication
private static TabItem SlidersTab()
{
ScrollBar sb;
return new TabItem
{
Header = "Sliders",
Content = new StackPanel
Content = new Grid
{
Orientation = Orientation.Horizontal,
ColumnDefinitions = new ColumnDefinitions
{
new ColumnDefinition(GridLength.Auto),
new ColumnDefinition(GridLength.Auto),
},
RowDefinitions = new RowDefinitions
{
new RowDefinition(GridLength.Auto),
new RowDefinition(GridLength.Auto),
},
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Children = new Controls
{
new ScrollBar
@ -265,14 +276,25 @@ namespace TestApplication
ViewportSize = 25,
Value = 25,
Height = 300,
[Grid.ColumnProperty] = 0,
[Grid.RowProperty] = 1,
},
new ScrollBar
(sb = new ScrollBar
{
Orientation = Orientation.Horizontal,
ViewportSize = 25,
Value = 25,
Width = 300,
},
[Grid.ColumnProperty] = 1,
[Grid.RowProperty] = 0,
}),
new TextBlock
{
HorizontalAlignment = HorizontalAlignment.Center,
[!TextBlock.TextProperty] = sb[!ScrollBar.ValueProperty].Cast<double>().Select(x => x.ToString("0")),
[Grid.ColumnProperty] = 1,
[Grid.RowProperty] = 1,
}
},
}
};

Loading…
Cancel
Save