private void HidePassword()
        {
            var start  = _revealTextBox.SelectionStart;
            var length = _revealTextBox.SelectionLength;

            _revealTextBox.Visibility = Visibility.Collapsed;
            AttachedFrameworkElement.Focus();

            AttachedFrameworkElement.GetType().GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
            .Invoke(AttachedFrameworkElement, new object[] { start, length });
        }
Exemple #2
0
        public override void OnApplyRequestedTheme(ElementTheme requestedTheme)
        {
            var elementType = AttachedFrameworkElement.GetType();
            var style       = RequestedThemeFactory.Current.Create(elementType, requestedTheme);

            AttachedFrameworkElement.SetValue(FrameworkElement.StyleProperty, style);
            AttachedFrameworkElement.UpdateLayout();
            AttachedFrameworkElement.UpdateDefaultStyle();

            OnApplyTemplate();
            ChangeVisualState(true);
        }