Exemplo n.º 1
0
        public static Regex GetMaskExpression(TextBox textBox)
        {
            if (textBox == null)
                throw new ArgumentNullException("textBox");

            return textBox.GetValue(MaskExpressionProperty) as Regex;
        }
Exemplo n.º 2
0
        public static string GetMask(TextBox textBox)
        {
            if (textBox == null)
                throw new ArgumentNullException("textBox");

            return textBox.GetValue(MaskProperty) as string;
        }
Exemplo n.º 3
0
        public static bool GetAlwaysScrollToEnd(TextBox textBox)
        {
            if (textBox == null)
            {
                throw new ArgumentNullException("textBox");
            }

            return (bool)textBox.GetValue(AlwaysScrollToEndProperty);
        }
Exemplo n.º 4
0
        public static string GetDefaultTextAfterCommandExecution(TextBox textBox)
        {
            if (textBox == null)
            {
                throw new ArgumentNullException("textBox");
            }

            return textBox.GetValue(DefaultTextAfterCommandExecutionProperty) as string;
        }
Exemplo n.º 5
0
        public static ICommand GetCommand(TextBox textBox)
        {
            if (textBox == null)
            {
                throw new ArgumentNullException("textBox");
            }

            return textBox.GetValue(CommandProperty) as ICommand;
        }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
		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");
		}
Exemplo n.º 9
0
 public static bool GetOnlyDecimal(TextBox textBox)
 {
     return (bool)textBox.GetValue(OnlyDecimalProperty);
 }
Exemplo n.º 10
0
 public static SelectTextOnFocus GetSelectTextOnFocus(TextBox element) { return (SelectTextOnFocus)element.GetValue(SelectTextOnFocusProperty); }
Exemplo n.º 11
0
 public static bool GetSelectAllTextOnFocus(TextBox textBox)
     => (bool) textBox.GetValue(SelectAllTextOnFocusProperty);
Exemplo n.º 12
0
 public static string GetRealTimeText(TextBox obj)
 {
     return (string)obj.GetValue(RealTimeTextProperty);
 }
Exemplo n.º 13
0
 public static UpdateTextBoxOnKeyPress GetUpdateTextBoxOnKeyPress(TextBox element) { return (UpdateTextBoxOnKeyPress)element.GetValue(UpdateTextBoxOnKeyPressProperty); }
Exemplo n.º 14
0
		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);
 }
Exemplo n.º 17
0
 /// <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;
 }
Exemplo n.º 18
0
 public static ICommand GetTextChangedCommand(TextBox element)
 {
     return (ICommand)element.GetValue(TextChangedCommandProperty);
 }
 private static string GetLastValidInput(TextBox obj)
 {
     return (string)obj.GetValue(LastValidInputProperty);
 }
Exemplo n.º 20
0
 public static ICommand GetCommand(TextBox selector)
 {
     return (ICommand)selector.GetValue(CommandProperty);
 }
Exemplo n.º 21
0
 public static ICommand GetTextChanged(TextBox target)
 {
     return (ICommand)target.GetValue(TextChangedCommandProperty);
 }
Exemplo n.º 22
0
        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");
        }
Exemplo n.º 23
0
		public static bool GetCommitOnEnter(TextBox target)
		{
			return (bool) target.GetValue(CommitOnEnterProperty);
		}
Exemplo n.º 24
0
 /// <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;
 }
Exemplo n.º 25
0
		public static bool GetCommitOnTyping(TextBox target)
		{
			return (bool) target.GetValue(CommitOnTypingProperty);
		}
Exemplo n.º 26
0
 public static string GetPlaceHolderText(TextBox textBox)
 {
     return textBox.GetValue(PlaceHolderTextProperty) as string;
 }
Exemplo n.º 27
0
		public static bool GetCommitOnFocusLost(TextBox target)
		{
			return (bool)target.GetValue(CommitOnFocusLostProperty);
		}
Exemplo n.º 28
0
 public static ICommand GetTextChangedCommand(TextBox textBox)
 {
     return (ICommand)textBox.GetValue(TextChangedCommandProperty);
 }
Exemplo n.º 29
0
 /// <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;
     }
 }
Exemplo n.º 30
0
 public static bool GetIsAutoUpdate(TextBox obj)
 {
     return (bool)obj.GetValue(IsAutoUpdateProperty);
 }