From 990d5c8c8cc43b3b9fee52c2b6bf1312455bd6f4 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 24 Jun 2014 16:43:21 +0200 Subject: [PATCH] Moved FontSize to Control. --- Perspex/Controls/Control.cs | 12 ++++++++++++ Perspex/Controls/TextBlock.cs | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Perspex/Controls/Control.cs b/Perspex/Controls/Control.cs index bbdfddfc5a..3ab8b3449b 100644 --- a/Perspex/Controls/Control.cs +++ b/Perspex/Controls/Control.cs @@ -44,6 +44,12 @@ namespace Perspex.Controls public static readonly PerspexProperty BorderThicknessProperty = PerspexProperty.Register("BorderThickness"); + public static readonly PerspexProperty FontSizeProperty = + PerspexProperty.Register( + "FontSize", + defaultValue: 12.0, + inherits: true); + public static readonly PerspexProperty ForegroundProperty = PerspexProperty.Register("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); } diff --git a/Perspex/Controls/TextBlock.cs b/Perspex/Controls/TextBlock.cs index 7d0e7bdd99..a96f711aea 100644 --- a/Perspex/Controls/TextBlock.cs +++ b/Perspex/Controls/TextBlock.cs @@ -13,12 +13,6 @@ namespace Perspex.Controls public class TextBlock : Control { - public static readonly PerspexProperty FontSizeProperty = - PerspexProperty.Register( - "FontSize", - defaultValue: 12.0, - inherits: true); - public static readonly PerspexProperty TextProperty = PerspexProperty.Register("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); }