MahApps.Metro by Jan Karger, Dennis Daume, Brendan Forster, Paul Jenkins, Jake Ginnivan, Alex Mitchell

<PackageReference Include="MahApps.Metro" Version="2.1.1" />

.NET API 3,425,904 bytes

 TextBoxHelper

public class TextBoxHelper
A helper class that provides various attached properties for the TextBox control.

This property can be used to retrieve the watermark using the DisplayAttribute of bound property.

public static readonly DependencyProperty ButtonWidthProperty

This property can be used to set the button width (PART_ClearText) of TextBox, PasswordBox, ComboBox, NumericUpDown

public static readonly DependencyProperty HasTextProperty

The clear text button behavior property. It sets a click event to the button if the value is true.

public static readonly DependencyProperty TextButtonProperty

public static readonly DependencyProperty TextLengthProperty

public static readonly DependencyProperty WatermarkProperty

public TextBoxHelper()

public static void ButtonClicked(object sender, RoutedEventArgs e)

public static bool GetAutoWatermark(DependencyObject element)

public static object GetButtonContent(DependencyObject d)

ButtonContentTemplate is the template used to display the content of the ClearText button.

public static double GetButtonFontSize(DependencyObject d)

Gets the buttons placement variant.

public static double GetButtonWidth(DependencyObject obj)

public static bool GetClearTextButton(DependencyObject d)

Gets the clear text button visibility / feature. Can be used to enable text deletion.

public static bool GetHasText(DependencyObject obj)

Gets if the attached TextBox has text.

Gets the clear text button behavior.

public static bool GetIsSpellCheckContextMenuEnabled(UIElement element)

Indicates if a TextBox or RichTextBox should use SpellCheck context menu

public static bool GetIsWaitingForData(DependencyObject obj)

public static bool GetSelectAllOnFocus(DependencyObject obj)

public static bool GetTextButton(DependencyObject d)

Gets the text button visibility.

public static bool GetUseFloatingWatermark(DependencyObject obj)

public static string GetWatermark(DependencyObject obj)

Gets a value that indicates the horizontal alignment of the watermark.

Gets the text trimming behavior to employ when watermark overflows the content area.

Gets how the watermark should wrap text.

public static void SetAutoWatermark(DependencyObject element, bool value)

Indicates if the watermark is automatically retrieved by using the DisplayAttribute of the bound property.

public static void SetButtonCommand(DependencyObject obj, ICommand value)

public static void SetButtonCommandParameter(DependencyObject obj, object value)

public static void SetButtonContent(DependencyObject obj, object value)

public static void SetButtonFontFamily(DependencyObject obj, FontFamily value)

public static void SetButtonFontSize(DependencyObject obj, double value)

public static void SetButtonsAlignment(DependencyObject obj, ButtonsAlignment value)

Sets the buttons placement variant.

public static void SetButtonTemplate(DependencyObject obj, ControlTemplate value)

public static void SetButtonWidth(DependencyObject obj, double value)

public static void SetClearTextButton(DependencyObject obj, bool value)

Sets the clear text button visibility / feature. Can be used to enable text deletion.

public static void SetHasText(DependencyObject obj, bool value)

public static void SetIsClearTextButtonBehaviorEnabled(Button obj, bool value)

Sets the clear text button behavior.

public static void SetIsMonitoring(DependencyObject obj, bool value)

public static void SetIsSpellCheckContextMenuEnabled(UIElement element, bool value)

public static void SetIsWaitingForData(DependencyObject obj, bool value)

public static void SetSelectAllOnFocus(DependencyObject obj, bool value)

public static void SetTextButton(DependencyObject obj, bool value)

Sets the text button visibility.

public static void SetUseFloatingWatermark(DependencyObject obj, bool value)

public static void SetWatermark(DependencyObject obj, string value)

public static void SetWatermarkAlignment(DependencyObject obj, TextAlignment value)

Sets a value that indicates the horizontal alignment of the watermark.

public static void SetWatermarkTrimming(DependencyObject obj, TextTrimming value)

Sets the text trimming behavior to employ when watermark overflows the content area.

public static void SetWatermarkWrapping(DependencyObject obj, TextWrapping value)

Sets how the watermark should wrap text.