| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using Muchinfo.MTPClient.Bank.ViewModels;
- using System.Windows;
- using System.Windows.Input;
- namespace Muchinfo.MTPClient.Bank.Views
- {
- /// <summary>
- /// BankUpdateView.xaml 的交互逻辑
- /// </summary>
- public partial class BankUpdateView : Window
- {
- public BankUpdateView()
- {
- InitializeComponent();
- this.DataContext = new BankUpdateViewModel(this);
- }
- private void NewBankAccountTextBox_OnKeyDown(object sender, KeyEventArgs e)
- {
- if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || (e.Key >= Key.D0 && e.Key <= Key.D9))
- {
- e.Handled = false;
- }
- else
- {
- e.Handled = true;
- }
- }
- private void NewBankAccountConfirmTextBox_OnKeyDown(object sender, KeyEventArgs e)
- {
- if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || (e.Key >= Key.D0 && e.Key <= Key.D9))
- {
- e.Handled = false;
- }
- else
- {
- e.Handled = true;
- }
- }
- /// <summary>
- /// 禁用Ctrl+V粘贴
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
- {
- if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.V)
- {
- e.Handled = true;
- }
- }
- }
- }
|