Esempio n. 1
0
 void OnNativeTextChanged(object sender, global::Windows.UI.Xaml.Controls.TextChangedEventArgs args)
 {
     if (Control.Text == _transformedText)
     {
         return;
     }
     _transformedText = Element.UpdateFormsText(Control.Text, Element.TextTransform);
     Element.SetValueCore(Entry.TextProperty, _transformedText);
 }
Esempio n. 2
0
        void OnTextChanged(object sender, global::Windows.UI.Xaml.Controls.TextChangedEventArgs textChangedEventArgs)
        {
            if (IsPassword)
            {
                // If we are on the phone, we might need to delay obfuscating the last character
                if (Device.Idiom == TargetIdiom.Phone)
                {
                    DelayObfuscation();
                    return;
                }

                // If we're not on a phone, we can just obfuscate any input
                string updatedRealText     = DetermineTextFromPassword(Text, SelectionStart, base.Text);
                string updatedText         = Obfuscate(updatedRealText);
                var    savedSelectionStart = SelectionStart;

                if (Text != updatedRealText)
                {
                    Text = updatedRealText;
                }

                if (base.Text != updatedText)
                {
                    base.Text = updatedText;
                }

                SelectionStart = savedSelectionStart;
            }
            else if (base.Text != Text)
            {
                // Not in password mode, so we just need to make the "real" text match
                // what's in the textbox; the internalChange flag keeps the TextProperty
                // synchronization from happening
                _internalChangeFlag = true;
                Text = base.Text;
                _internalChangeFlag = false;
            }
        }