public static Regex GetMaskExpression(TextBox textBox) { if (textBox == null) throw new ArgumentNullException("textBox"); return textBox.GetValue(MaskExpressionProperty) as Regex; }
public static string GetMask(TextBox textBox) { if (textBox == null) throw new ArgumentNullException("textBox"); return textBox.GetValue(MaskProperty) as string; }
public static bool GetAlwaysScrollToEnd(TextBox textBox) { if (textBox == null) { throw new ArgumentNullException("textBox"); } return (bool)textBox.GetValue(AlwaysScrollToEndProperty); }
public static string GetDefaultTextAfterCommandExecution(TextBox textBox) { if (textBox == null) { throw new ArgumentNullException("textBox"); } return textBox.GetValue(DefaultTextAfterCommandExecutionProperty) as string; }
public static ICommand GetCommand(TextBox textBox) { if (textBox == null) { throw new ArgumentNullException("textBox"); } return textBox.GetValue(CommandProperty) as ICommand; }
private static ReturnCommandBehavior GetOrCreateBehavior(TextBox textBox) { ReturnCommandBehavior behavior = textBox.GetValue(ReturnCommandBehaviorProperty) as ReturnCommandBehavior; if (behavior == null) { behavior = new ReturnCommandBehavior(textBox); textBox.SetValue(ReturnCommandBehaviorProperty, behavior); } return behavior; }
private static TextBoxTextChangedCommandBehavior GetOrCreateBehavior(TextBox textBox) { TextBoxTextChangedCommandBehavior behavior = textBox.GetValue(TextChangedCommandBehaviorProperty) as TextBoxTextChangedCommandBehavior; if (behavior == null) { behavior = new TextBoxTextChangedCommandBehavior(textBox); textBox.SetValue(TextChangedCommandBehaviorProperty, behavior); } return behavior; }
public void GetValue () { ConcreteDependencyObject cdo = new ConcreteDependencyObject (); Assert.Throws<Exception> (delegate { cdo.GetValue (InputMethod.IsInputMethodEnabledProperty); }, "GetValue"); TextBox tb = new TextBox (); Assert.IsTrue ((bool) tb.GetValue (InputMethod.IsInputMethodEnabledProperty), "TextBox"); MyTextBox mtb = new MyTextBox (); Assert.IsTrue ((bool) mtb.GetValue (InputMethod.IsInputMethodEnabledProperty), "MyTextBox"); }
public static bool GetOnlyDecimal(TextBox textBox) { return (bool)textBox.GetValue(OnlyDecimalProperty); }
public static SelectTextOnFocus GetSelectTextOnFocus(TextBox element) { return (SelectTextOnFocus)element.GetValue(SelectTextOnFocusProperty); }
public static bool GetSelectAllTextOnFocus(TextBox textBox) => (bool) textBox.GetValue(SelectAllTextOnFocusProperty);
public static string GetRealTimeText(TextBox obj) { return (string)obj.GetValue(RealTimeTextProperty); }
public static UpdateTextBoxOnKeyPress GetUpdateTextBoxOnKeyPress(TextBox element) { return (UpdateTextBoxOnKeyPress)element.GetValue(UpdateTextBoxOnKeyPressProperty); }
public static bool GetRollbackOnEscape(TextBox target) { return (bool) target.GetValue(RollbackOnEscapeProperty); }
/// <summary> /// Gets the regex pattern set for limiting the text of a given text box. /// </summary> /// <param name="obj">Text box whose LimitText property you're getting.</param> /// <returns>String pattern that the regex engine uses on this text box.</returns> public static string GetLimitTextRegex(TextBox obj) { return (string)obj.GetValue(LimitTextRegexProperty); }
/// <summary> /// Gets the pattern, a character class, used by LimitText property for removing multiple occurences /// of certain characters in succession. /// </summary> public static string GetExcessCharactersRegex(TextBox obj) { return (string)obj.GetValue(ExcessCharactersRegexProperty); }
/// <summary> /// Returns the error message used when validation fails for the /// specified TextBox. /// </summary> /// <param name="textBox">The TextBox whose error message is returned.</param> public static string GetErrorMessage(TextBox textBox) { return textBox.GetValue(ErrorMessageProperty) as string; }
public static ICommand GetTextChangedCommand(TextBox element) { return (ICommand)element.GetValue(TextChangedCommandProperty); }
private static string GetLastValidInput(TextBox obj) { return (string)obj.GetValue(LastValidInputProperty); }
public static ICommand GetCommand(TextBox selector) { return (ICommand)selector.GetValue(CommandProperty); }
public static ICommand GetTextChanged(TextBox target) { return (ICommand)target.GetValue(TextChangedCommandProperty); }
public void SetText2 () { TextBox box = new TextBox { Text = "Blah" }; Assert.AreEqual ("Blah", box.GetValue (TextBox.TextProperty), "#1"); box.SetValue (TextBox.TextProperty, null); Assert.AreEqual ("", box.GetValue (TextBox.TextProperty), "#2"); box.Text = "o hi"; box.ClearValue (TextBox.TextProperty); Assert.AreEqual ("", box.GetValue (TextBox.TextProperty), "#3"); }
public static bool GetCommitOnEnter(TextBox target) { return (bool) target.GetValue(CommitOnEnterProperty); }
/// <summary> /// Returns the regular expression used to validate the specified TextBox. /// </summary> /// <param name="textBox">The TextBox whose regular expression is returned.</param> public static string GetRegexText(TextBox textBox) { return textBox.GetValue(RegexTextProperty) as string; }
public static bool GetCommitOnTyping(TextBox target) { return (bool) target.GetValue(CommitOnTypingProperty); }
public static string GetPlaceHolderText(TextBox textBox) { return textBox.GetValue(PlaceHolderTextProperty) as string; }
public static bool GetCommitOnFocusLost(TextBox target) { return (bool)target.GetValue(CommitOnFocusLostProperty); }
public static ICommand GetTextChangedCommand(TextBox textBox) { return (ICommand)textBox.GetValue(TextChangedCommandProperty); }
/// <summary> /// Creates or modifies the RegexValidationRule in the TextBox's Text property binding /// to use the current values of the attached properties exposed by this class. /// </summary> /// <param name="textBox">The TextBox being validated.</param> private static void VerifyRegexValidationRule(TextBox textBox) { RegexValidationRule regexRule = GetRegexValidationRuleForTextBox(textBox); if (regexRule != null) { regexRule.RegexText = textBox.GetValue(RegexTextProperty) as string; regexRule.ErrorMessage = textBox.GetValue(ErrorMessageProperty) as string; } }
public static bool GetIsAutoUpdate(TextBox obj) { return (bool)obj.GetValue(IsAutoUpdateProperty); }