protected TransportViewModel(DataTransport <T> dataTransport) { _dataTransport = dataTransport; _dataTransport.CanOpenChanged += delegate { OpenCommand.RaiseCanExecuteChanged(); }; _dataTransport.CanCloseChanged += delegate { CloseCommand.RaiseCanExecuteChanged(); }; _dataTransport.IsOpenChanged += (sender, args) => { RaisePropertyChanged(nameof(IsOpen)); }; }
protected override void RaiseCanExecuteCommands() { OpenCommand.RaiseCanExecuteChanged(); CloseCommand.RaiseCanExecuteChanged(); //NextPageCommand.RaiseCanExecuteChanged(); //PreviousPageCommand.RaiseCanExecuteChanged(); //FirstPageCommand.RaiseCanExecuteChanged(); //LastPageCommand.RaiseCanExecuteChanged(); SaveCommand.RaiseCanExecuteChanged(); NewCommand.RaiseCanExecuteChanged(); DeleteCommand.RaiseCanExecuteChanged(); ReloadCommand.RaiseCanExecuteChanged(); }
private void OnInitWorkArea() { _isWorkAreaIniting = true; NewCommand.RaiseCanExecuteChanged(); OpenCommand.RaiseCanExecuteChanged(); SaveAllCommand.RaiseCanExecuteChanged(); //Work Area var selectedTab = XamlTabs.FirstOrDefault(tab => tab.IsSelected); selectedTab?.InitWorkArea(); _isWorkAreaIniting = false; NewCommand.RaiseCanExecuteChanged(); OpenCommand.RaiseCanExecuteChanged(); SaveAllCommand.RaiseCanExecuteChanged(); }
private void AnyPropertyChanged(object sender, PropertyChangedEventArgs e) { OpenCommand.RaiseCanExecuteChanged(); Recognize.RaiseCanExecuteChanged(); }