diff --git a/Perspex.Controls/Border.cs b/Perspex.Controls/Border.cs index 282dbd94ff..89b5b78886 100644 --- a/Perspex.Controls/Border.cs +++ b/Perspex.Controls/Border.cs @@ -16,6 +16,12 @@ namespace Perspex.Controls public static readonly PerspexProperty BackgroundProperty = PerspexProperty.Register("Background"); + public static readonly PerspexProperty BorderBrushProperty = + PerspexProperty.Register("BorderBrush"); + + public static readonly PerspexProperty BorderThicknessProperty = + PerspexProperty.Register("BorderThickness"); + static Border() { Control.AffectsRender(Border.BackgroundProperty); @@ -28,6 +34,18 @@ namespace Perspex.Controls set { this.SetValue(BackgroundProperty, value); } } + public Brush BorderBrush + { + get { return this.GetValue(BorderBrushProperty); } + set { this.SetValue(BorderBrushProperty, value); } + } + + public double BorderThickness + { + get { return this.GetValue(BorderThicknessProperty); } + set { this.SetValue(BorderThicknessProperty, value); } + } + public override void Render(IDrawingContext context) { Brush background = this.Background; diff --git a/Perspex.Controls/Control.cs b/Perspex.Controls/Control.cs index e364b7519d..047d06ca24 100644 --- a/Perspex.Controls/Control.cs +++ b/Perspex.Controls/Control.cs @@ -20,15 +20,6 @@ namespace Perspex.Controls public class Control : InputElement, ILogical, IStyleable, IStyleHost { - public static readonly PerspexProperty BorderBrushProperty = - PerspexProperty.Register("BorderBrush"); - - public static readonly PerspexProperty BorderThicknessProperty = - PerspexProperty.Register("BorderThickness"); - - public static readonly PerspexProperty ForegroundProperty = - PerspexProperty.Register("Foreground", new SolidColorBrush(0xff000000), inherits: true); - public static readonly PerspexProperty ParentProperty = PerspexProperty.Register("Parent"); @@ -59,18 +50,6 @@ namespace Perspex.Controls PseudoClass(InputElement.IsPointerOverProperty, ":pointerover"); } - public Brush BorderBrush - { - get { return this.GetValue(BorderBrushProperty); } - set { this.SetValue(BorderBrushProperty, value); } - } - - public double BorderThickness - { - get { return this.GetValue(BorderThicknessProperty); } - set { this.SetValue(BorderThicknessProperty, value); } - } - public Classes Classes { get @@ -106,12 +85,6 @@ namespace Perspex.Controls } } - public Brush Foreground - { - get { return this.GetValue(ForegroundProperty); } - set { this.SetValue(ForegroundProperty, value); } - } - public string Id { get diff --git a/Perspex.Controls/Primitives/TemplatedControl.cs b/Perspex.Controls/Primitives/TemplatedControl.cs index 547d7cd605..42aa8667de 100644 --- a/Perspex.Controls/Primitives/TemplatedControl.cs +++ b/Perspex.Controls/Primitives/TemplatedControl.cs @@ -18,6 +18,12 @@ namespace Perspex.Controls.Primitives public static readonly PerspexProperty BackgroundProperty = Border.BackgroundProperty.AddOwner(); + public static readonly PerspexProperty BorderBrushProperty = + Border.BorderBrushProperty.AddOwner(); + + public static readonly PerspexProperty BorderThicknessProperty = + Border.BorderThicknessProperty.AddOwner(); + public static readonly PerspexProperty FontFamilyProperty = TextBlock.FontFamilyProperty.AddOwner(); @@ -27,6 +33,9 @@ namespace Perspex.Controls.Primitives public static readonly PerspexProperty FontStyleProperty = TextBlock.FontStyleProperty.AddOwner(); + public static readonly PerspexProperty ForegroundProperty = + TextBlock.ForegroundProperty.AddOwner(); + public static readonly PerspexProperty TemplateProperty = PerspexProperty.Register("Template"); @@ -48,6 +57,18 @@ namespace Perspex.Controls.Primitives set { this.SetValue(BackgroundProperty, value); } } + public Brush BorderBrush + { + get { return this.GetValue(BorderBrushProperty); } + set { this.SetValue(BorderBrushProperty, value); } + } + + public double BorderThickness + { + get { return this.GetValue(BorderThicknessProperty); } + set { this.SetValue(BorderThicknessProperty, value); } + } + public string FontFamily { get { return this.GetValue(FontFamilyProperty); } @@ -66,6 +87,12 @@ namespace Perspex.Controls.Primitives set { this.SetValue(FontStyleProperty, value); } } + public Brush Foreground + { + get { return this.GetValue(ForegroundProperty); } + set { this.SetValue(ForegroundProperty, value); } + } + public ControlTemplate Template { get { return this.GetValue(TemplateProperty); } diff --git a/Perspex.Controls/TextBlock.cs b/Perspex.Controls/TextBlock.cs index 6a5de19961..aad14067d2 100644 --- a/Perspex.Controls/TextBlock.cs +++ b/Perspex.Controls/TextBlock.cs @@ -25,6 +25,9 @@ namespace Perspex.Controls public static readonly PerspexProperty FontStyleProperty = PerspexProperty.Register("FontStyle", inherits: true); + public static readonly PerspexProperty ForegroundProperty = + PerspexProperty.Register("Foreground", new SolidColorBrush(0xff000000), inherits: true); + public static readonly PerspexProperty TextProperty = PerspexProperty.Register("Text"); @@ -77,6 +80,12 @@ namespace Perspex.Controls set { this.SetValue(FontStyleProperty, value); } } + public Brush Foreground + { + get { return this.GetValue(ForegroundProperty); } + set { this.SetValue(ForegroundProperty, value); } + } + public TextWrapping TextWrapping { get { return this.GetValue(TextWrappingProperty); } diff --git a/Perspex.Themes.Default/TabItemStyle.cs b/Perspex.Themes.Default/TabItemStyle.cs index b3dcba8f76..c7bfc90c81 100644 --- a/Perspex.Themes.Default/TabItemStyle.cs +++ b/Perspex.Themes.Default/TabItemStyle.cs @@ -22,8 +22,8 @@ namespace Perspex.Themes.Default { Setters = new[] { - new Setter(TextBlock.FontSizeProperty, 28.7), - new Setter(Control.ForegroundProperty, Brushes.Gray), + new Setter(TabItem.FontSizeProperty, 28.7), + new Setter(TabItem.ForegroundProperty, Brushes.Gray), new Setter(TabItem.TemplateProperty, ControlTemplate.Create(this.Template)), }, }, @@ -31,7 +31,7 @@ namespace Perspex.Themes.Default { Setters = new[] { - new Setter(Control.ForegroundProperty, Brushes.Black), + new Setter(TabItem.ForegroundProperty, Brushes.Black), }, }, });