12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace edit_ctrl_demo
- {
- /// <summary>
- /// PasswordDialog.xaml 的交互逻辑
- /// </summary>
- public partial class PasswordDialog : UserControl
- {
- public event EventHandler Closed;
- public event EventHandler Canceled;
- public event EventHandler<string> Confirmed;
- public PasswordDialog()
- {
- InitializeComponent();
- }
- public void SetShowText(string newText)
- {
- FileEncryptText.Text = newText;
- }
- private void PasswordDialogClose_Click(object sender, RoutedEventArgs e)
- {
- Closed?.Invoke(this, EventArgs.Empty);
- }
- private void PasswordDialogCancel_Click(object sender, RoutedEventArgs e)
- {
- Canceled?.Invoke(this, EventArgs.Empty);
- }
- private void PasswordDialogConfirm_Click(object sender, RoutedEventArgs e)
- {
- Confirmed?.Invoke(this, PasswordBoxText.Password);
- }
- public void SetShowError(string errorText,Visibility visible)
- {
- ErrorTipsText.Text = errorText;
- ErrorTipsText.Visibility = visible;
- }
- public void ClearPassword()
- {
- PasswordBoxText.Password = string.Empty;
- }
- }
- }
|