Beispiel #1
0
        public static void OnIsEyeVisiblePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PassowrdBox pb = d as PassowrdBox;

            bool value = (bool)e.NewValue;

            if (!value)
            {
                pb.tbtnEye.IsChecked = false;
            }
            pb.tbtnEye.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
        }
Beispiel #2
0
        public static void OnPasswordPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PassowrdBox pb = d as PassowrdBox;

            string newValue = string.Format("{0}", e.NewValue);

            if (pb.IsEyeVisible)
            {
                if (pb.txtUserPwd.Text != newValue)
                {
                    pb.txtUserPwd.Text = newValue;
                    pb.pbBox.Password  = newValue;
                }
            }
            else
            {
                if (pb.pbBox.Password != newValue)
                {
                    pb.txtUserPwd.Text = newValue;
                    pb.pbBox.Password  = newValue;
                }
            }
        }
Beispiel #3
0
        public static void OnMaxLengthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PassowrdBox pb = d as PassowrdBox;

            pb.txtUserPwd.MaxLength = pb.pbBox.MaxLength = (int)e.NewValue;
        }