private void OnContextChanged() { if (vm != null) { vm.PropertyChanged -= PropertyChanged; } vm = DataContext as ChannelViewModelBase; if (vm == null) { return; } shortcuts = new ShortcutManager(Entry, vm); vm.PropertyChanged += PropertyChanged; }
public ShortcutManager(TextBox entry, ChannelViewModelBase vm) : this(entry) { this.vm = vm; }
private void OnContextChanged() { if (vm != null) vm.PropertyChanged -= PropertyChanged; vm = DataContext as ChannelViewModelBase; if (vm == null) return; shortcuts = new ShortcutManager(Entry, vm); vm.PropertyChanged += PropertyChanged; }