Beispiel #1
0
        static Boolean ShouldShowCueBanner(TextBoxBase c)
        {
            var value     = c.GetValue(TextBox.TextProperty) as String;
            var isVisible = Convert.ToBoolean(c.GetValue(TextBox.IsVisibleProperty));

            return(isVisible && String.IsNullOrEmpty(value));
        }
Beispiel #2
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="Placeholder"/> class.
 /// </summary>
 /// <param name="adornedElement">
 ///   The element to bind the adorner to.
 /// </param>
 /// <exception cref="T:System.ArgumentNullException">
 ///   Raised when adornedElement is null.
 /// </exception>
 public Placeholder(TextBoxBase adornedElement)
     : this((Control)adornedElement)
 {
     if (!(adornedElement.IsFocused && (bool)adornedElement.GetValue(HideOnFocusProperty)))
     {
         adornedElement.TextChanged += this.AdornedElement_ContentChanged;
     }
 }
 /// <summary>Returns a value that indicates whether the spelling checker is enabled on the specified text-editing control.</summary>
 /// <param name="textBoxBase">The text-editing control to check. Example controls include <see cref="T:System.Windows.Controls.TextBox" /> and <see cref="T:System.Windows.Controls.RichTextBox" />.</param>
 /// <returns>
 ///     <see langword="true" /> if the spelling checker is enabled on the text-editing control; otherwise, <see langword="false" />.</returns>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="textBoxBase " />is <see langword="null" />.</exception>
 // Token: 0x0600565E RID: 22110 RVA: 0x0017E863 File Offset: 0x0017CA63
 public static bool GetIsEnabled(TextBoxBase textBoxBase)
 {
     if (textBoxBase == null)
     {
         throw new ArgumentNullException("textBoxBase");
     }
     return((bool)textBoxBase.GetValue(SpellCheck.IsEnabledProperty));
 }
 /// <summary>
 /// Gets the collection of custom dictionaries used for spell checking of custom words.
 /// </summary>
 /// <param name="textBoxBase"></param>
 /// <returns></returns>
 public static IList GetCustomDictionaries(TextBoxBase textBoxBase)
 {
     if (textBoxBase == null)
     {
         throw new ArgumentNullException("textBoxBase");
     }
     return((IList)textBoxBase.GetValue(CustomDictionariesProperty));
 }
Beispiel #5
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="T:T:ReactNative.Views.TextInput.PlaceholderAdorner"/> class.
        /// </summary>
        /// <param name="adornedElement">
        ///   The element to bind the adorner to.
        /// </param>
        /// <exception cref="T:System.ArgumentNullException">
        ///   Raised when adornedElement is null.
        /// </exception>
        public PlaceholderAdorner(TextBoxBase adornedElement)
            : this((Control)adornedElement)
        {
            //if ((bool) adornedElement.GetValue(ShowWhenContentEmptyProperty))
            //{
            //    adornedElement.TextChanged += this.AdornedElement_ContentChanged;
            //}

            if (!(adornedElement.IsFocused && (bool)adornedElement.GetValue(HideOnFocusProperty)))
            {
                adornedElement.TextChanged += this.AdornedElement_ContentChanged;
            }
        }
Beispiel #6
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="T:T:ReactNative.Views.TextInput.PlaceholderAdorner"/> class.
        /// </summary>
        /// <param name="adornedElement">
        ///   The element to bind the adorner to.
        /// </param>
        /// <param name="textControl"></param>
        /// <exception cref="T:System.ArgumentNullException">
        ///   Raised when adornedElement is null.
        /// </exception>
        public PlaceholderAdorner(UIElement adornedElement, TextBoxBase textControl)
            : this(adornedElement, (Control)textControl)
        {
            //if ((bool) adornedElement.GetValue(ShowWhenContentEmptyProperty))
            //{
            //    adornedElement.TextChanged += this.AdornedElement_ContentChanged;
            //}

            if (!(textControl.IsFocused && (bool)textControl.GetValue(HideOnFocusProperty)))
            {
                textControl.TextChanged += this.AdornedElement_ContentChanged;
            }
        }
Beispiel #7
0
 public static bool GetIsEnabled([NotNull] TextBoxBase item)
 {
     return(item.GetValue <bool>(IsEnabledProperty));
 }
Beispiel #8
0
 public static bool GetOnGotFocus(TextBoxBase obj)
 {
     return((bool)obj.GetValue(OnGotFocusProperty));
 }
Beispiel #9
0
 public static bool GetIsEnabled(TextBoxBase obj)
 {
     Contract.Requires(obj != null);
     return(obj.GetValue <bool>(IsEnabledProperty));
 }
Beispiel #10
0
 public static object GetScrollToBottomOnTextChanged(TextBoxBase target)
 {
     return(target.GetValue(ScrollToBottomOnTextChangedProperty));
 }
Beispiel #11
0
 public static Object GetCueBanner(TextBoxBase control)
 {
     return(control.GetValue(CueBannerProperty));
 }
 public static object?GetContent(TextBoxBase control) => control?.GetValue(Watermarking.ContentProperty);
Beispiel #13
0
 public static bool GetSelectOnFocus(TextBoxBase textBox) => textBox != null && (bool)textBox.GetValue(TextBoxSelect.SelectOnFocusProperty);
 public static bool GetSelectAllOnKeyboardFocus(TextBoxBase element)
 {
     return((bool)element.GetValue(SelectAllOnKeyboardFocusProperty));
 }
Beispiel #15
0
 public static bool GetSelectAllOnFocus(TextBoxBase elem) => (bool)elem.GetValue(SelectAllOnFocusProperty);
Beispiel #16
0
        /// <summary>
        /// Gets a value indicating whether to select all contents in the specified <see cref="TextBoxBase"/> when it receives focus.
        /// </summary>
        /// <param name="textBox">The <see cref="TextBoxBase"/> for which to get whether to select all contents when focus is got.</param>
        /// <returns><c>true</c> if to select all contents for the <paramref name="textBox"/> when focus is got; otherwise, <c>false</c>.</returns>
        public static bool GetSelectAllOnGotFocus(TextBoxBase textBox)
        {
            Requires.NotNull(textBox, nameof(textBox));

            return((bool)textBox.GetValue(SelectAllOnGotFocusProperty));
        }
Beispiel #17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="d"></param>
 /// <returns></returns>
 public static bool GetEnableCutCommand(TextBoxBase d)
 {
     return((bool)d.GetValue(EnableCutCommandProperty));
 }
 private static WatermarkAdorner?GetAdorner(TextBoxBase textBox) => (WatermarkAdorner?)textBox.GetValue(Watermarking._adornerProperty);
 public static DataTemplate?GetContentTemplate(TextBoxBase textBox) => (DataTemplate?)textBox?.GetValue(Watermarking.ContentTemplateProperty);
Beispiel #20
0
 public static bool GetIncludeSpellingSuggestions(TextBoxBase element) => (bool)element.GetValue(IncludeSpellingSuggestionsProperty);
Beispiel #21
0
 public static bool GetAutoSelectAll(TextBoxBase d)
 {
     return((bool)d.GetValue(AutoSelectAllProperty));
 }