Browse Source

Remove ScrollBar pseudoclasses.

pull/63/head
Steven Kirk 11 years ago
parent
commit
4d56d2a440
  1. 9
      Perspex.Controls/Primitives/ScrollBar.cs
  2. 8
      Perspex.Themes.Default/ScrollBarStyle.cs

9
Perspex.Controls/Primitives/ScrollBar.cs

@ -34,15 +34,6 @@ namespace Perspex.Controls.Primitives
public static readonly PerspexProperty<Orientation> OrientationProperty = public static readonly PerspexProperty<Orientation> OrientationProperty =
PerspexProperty.Register<ScrollBar, Orientation>(nameof(Orientation)); PerspexProperty.Register<ScrollBar, Orientation>(nameof(Orientation));
/// <summary>
/// Initializes static members of the <see cref="ScrollBar"/> class.
/// </summary>
static ScrollBar()
{
Control.PseudoClass(OrientationProperty, x => x == Orientation.Horizontal, ":horizontal");
Control.PseudoClass(OrientationProperty, x => x == Orientation.Vertical, ":vertical");
}
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ScrollBar"/> class. /// Initializes a new instance of the <see cref="ScrollBar"/> class.
/// </summary> /// </summary>

8
Perspex.Themes.Default/ScrollBarStyle.cs

@ -26,7 +26,7 @@ namespace Perspex.Themes.Default
new Setter(ScrollBar.TemplateProperty, ControlTemplate.Create<ScrollBar>(this.Template)), new Setter(ScrollBar.TemplateProperty, ControlTemplate.Create<ScrollBar>(this.Template)),
}, },
}, },
new Style(x => x.OfType<ScrollBar>().Class(":horizontal")) new Style(x => x.OfType<ScrollBar>().PropertyEquals(ScrollBar.OrientationProperty, Orientation.Horizontal))
{ {
Setters = new[] Setters = new[]
{ {
@ -34,14 +34,14 @@ namespace Perspex.Themes.Default
new Setter(ScrollBar.HeightProperty, 10.0), new Setter(ScrollBar.HeightProperty, 10.0),
}, },
}, },
new Style(x => x.OfType<ScrollBar>().Class(":horizontal").Template().Name("thumb")) new Style(x => x.OfType<ScrollBar>().PropertyEquals(ScrollBar.OrientationProperty, Orientation.Horizontal).Template().Name("thumb"))
{ {
Setters = new[] Setters = new[]
{ {
new Setter(Thumb.MinWidthProperty, 10.0), new Setter(Thumb.MinWidthProperty, 10.0),
}, },
}, },
new Style(x => x.OfType<ScrollBar>().Class(":vertical")) new Style(x => x.OfType<ScrollBar>().PropertyEquals(ScrollBar.OrientationProperty, Orientation.Vertical))
{ {
Setters = new[] Setters = new[]
{ {
@ -49,7 +49,7 @@ namespace Perspex.Themes.Default
new Setter(ScrollBar.WidthProperty, 10.0), new Setter(ScrollBar.WidthProperty, 10.0),
}, },
}, },
new Style(x => x.OfType<ScrollBar>().Class(":vertical").Template().Name("thumb")) new Style(x => x.OfType<ScrollBar>().PropertyEquals(ScrollBar.OrientationProperty, Orientation.Vertical).Template().Name("thumb"))
{ {
Setters = new[] Setters = new[]
{ {

Loading…
Cancel
Save