From d68131c488356ee714223fd38bf2166dcc33241e Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 6 Oct 2015 12:39:13 +0200 Subject: [PATCH] Added getters/setters for TextBlock attached props Closes #252. --- src/Perspex.Controls/TextBlock.cs | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/Perspex.Controls/TextBlock.cs b/src/Perspex.Controls/TextBlock.cs index b6bec05240..a1df8c77ed 100644 --- a/src/Perspex.Controls/TextBlock.cs +++ b/src/Perspex.Controls/TextBlock.cs @@ -210,6 +210,90 @@ namespace Perspex.Controls set { SetValue(TextAlignmentProperty, value); } } + /// + /// Gets the value of the attached on a control. + /// + /// The control. + /// The font family. + public static string GetFontFamily(Control control) + { + return control.GetValue(FontFamilyProperty); + } + + /// + /// Gets the value of the attached on a control. + /// + /// The control. + /// The font family. + public static double GetFontSize(Control control) + { + return control.GetValue(FontSizeProperty); + } + + /// + /// Gets the value of the attached on a control. + /// + /// The control. + /// The font family. + public static FontStyle GetFontStyle(Control control) + { + return control.GetValue(FontStyleProperty); + } + + /// + /// Gets the value of the attached on a control. + /// + /// The control. + /// The font family. + public static FontWeight GetFontWeight(Control control) + { + return control.GetValue(FontWeightProperty); + } + + /// + /// Sets the value of the attached on a control. + /// + /// The control. + /// The property value to set. + /// The font family. + public static void SetFontFamily(Control control, string value) + { + control.SetValue(FontFamilyProperty, value); + } + + /// + /// Sets the value of the attached on a control. + /// + /// The control. + /// The property value to set. + /// The font family. + public static void SetFontSize(Control control, double value) + { + control.SetValue(FontSizeProperty, value); + } + + /// + /// Sets the value of the attached on a control. + /// + /// The control. + /// The property value to set. + /// The font family. + public static void SetFontStyle(Control control, FontStyle value) + { + control.SetValue(FontStyleProperty, value); + } + + /// + /// Sets the value of the attached on a control. + /// + /// The control. + /// The property value to set. + /// The font family. + public static void SetFontWeight(Control control, FontWeight value) + { + control.SetValue(FontWeightProperty, value); + } + /// /// Renders the to a drawing context. ///