private void MyTextBox_ValidateKey(object sender, ValidateKeyEventArgs e) { QuantifiedTextViewModel vm = DataContext as QuantifiedTextViewModel; if (vm != null) { e.IsValid = e.TextKey != vm.CultureTextVM.TextKeyVM.TextKey && vm.CultureTextVM.TextKeyVM.MainWindowVM.TextKeys.ContainsKey(e.TextKey); } }
private void DecoratedTextBox_ValidateKey(object sender, ValidateKeyEventArgs args) { CultureTextViewModel vm = DataContext as CultureTextViewModel; if (vm != null) { args.IsValid = args.TextKey != vm.TextKeyVM.TextKey && vm.TextKeyVM.MainWindowVM.TextKeys.ContainsKey(args.TextKey); } }
private void DecoratedTextBox_ValidateKey(object sender, ValidateKeyEventArgs args) { args.IsValid = MainViewModel.Instance.TextKeys.ContainsKey(args.TextKey); }