Beispiel #1
0
        public static Regex GetMaskExpression(TextBox textBox)
        {
            if (textBox == null)
                throw new ArgumentNullException("textBox");

            return textBox.GetValue(MaskExpressionProperty) as Regex;
        }
Beispiel #2
0
        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;
        }
Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #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");
		}
Beispiel #9
0
 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);
Beispiel #12
0
 public static string GetRealTimeText(TextBox obj)
 {
     return (string)obj.GetValue(RealTimeTextProperty);
 }
 public static UpdateTextBoxOnKeyPress GetUpdateTextBoxOnKeyPress(TextBox element) { return (UpdateTextBoxOnKeyPress)element.GetValue(UpdateTextBoxOnKeyPressProperty); }
Beispiel #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);
 }
Beispiel #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;
 }
 public static ICommand GetTextChangedCommand(TextBox element)
 {
     return (ICommand)element.GetValue(TextChangedCommandProperty);
 }
 private static string GetLastValidInput(TextBox obj)
 {
     return (string)obj.GetValue(LastValidInputProperty);
 }
Beispiel #20
0
 public static ICommand GetCommand(TextBox selector)
 {
     return (ICommand)selector.GetValue(CommandProperty);
 }
Beispiel #21
0
 public static ICommand GetTextChanged(TextBox target)
 {
     return (ICommand)target.GetValue(TextChangedCommandProperty);
 }
Beispiel #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");
        }
Beispiel #23
0
		public static bool GetCommitOnEnter(TextBox target)
		{
			return (bool) target.GetValue(CommitOnEnterProperty);
		}
Beispiel #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;
 }
Beispiel #25
0
		public static bool GetCommitOnTyping(TextBox target)
		{
			return (bool) target.GetValue(CommitOnTypingProperty);
		}
 public static string GetPlaceHolderText(TextBox textBox)
 {
     return textBox.GetValue(PlaceHolderTextProperty) as string;
 }
Beispiel #27
0
		public static bool GetCommitOnFocusLost(TextBox target)
		{
			return (bool)target.GetValue(CommitOnFocusLostProperty);
		}
Beispiel #28
0
 public static ICommand GetTextChangedCommand(TextBox textBox)
 {
     return (ICommand)textBox.GetValue(TextChangedCommandProperty);
 }
Beispiel #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;
     }
 }
Beispiel #30
0
 public static bool GetIsAutoUpdate(TextBox obj)
 {
     return (bool)obj.GetValue(IsAutoUpdateProperty);
 }