Browse Source

Moved FontSize to Control.

pull/4/head
Steven Kirk 12 years ago
parent
commit
990d5c8c8c
  1. 12
      Perspex/Controls/Control.cs
  2. 12
      Perspex/Controls/TextBlock.cs

12
Perspex/Controls/Control.cs

@ -44,6 +44,12 @@ namespace Perspex.Controls
public static readonly PerspexProperty<double> BorderThicknessProperty =
PerspexProperty.Register<Control, double>("BorderThickness");
public static readonly PerspexProperty<double> FontSizeProperty =
PerspexProperty.Register<Control, double>(
"FontSize",
defaultValue: 12.0,
inherits: true);
public static readonly PerspexProperty<Brush> ForegroundProperty =
PerspexProperty.Register<Control, Brush>("Foreground", new SolidColorBrush(0xff000000), true);
@ -195,6 +201,12 @@ namespace Perspex.Controls
set;
}
public double FontSize
{
get { return this.GetValue(FontSizeProperty); }
set { this.SetValue(FontSizeProperty, value); }
}
public Brush Foreground
{
get { return this.GetValue(ForegroundProperty); }

12
Perspex/Controls/TextBlock.cs

@ -13,12 +13,6 @@ namespace Perspex.Controls
public class TextBlock : Control
{
public static readonly PerspexProperty<double> FontSizeProperty =
PerspexProperty.Register<TextBlock, double>(
"FontSize",
defaultValue: 12.0,
inherits: true);
public static readonly PerspexProperty<string> TextProperty =
PerspexProperty.Register<TextBlock, string>("Text");
@ -27,12 +21,6 @@ namespace Perspex.Controls
this.GetObservable(TextProperty).Subscribe(_ => this.InvalidateVisual());
}
public double FontSize
{
get { return this.GetValue(FontSizeProperty); }
set { this.SetValue(FontSizeProperty, value); }
}
public string Text
{
get { return this.GetValue(TextProperty); }

Loading…
Cancel
Save