private bool OnCanExecuteRaised(object parameter) { bool canExecute = true; var handler = CanExecuteRaised; if (handler != null) { var args = new CanExecuteEventArgs(parameter); handler(this, args); canExecute = args.CanExecute; } return canExecute; }
private void OnCanRefresh(object sender, CanExecuteEventArgs args) { refreshListCommand = sender as EventCommand; args.CanExecute = false; if (this.viewModelWrapper != null) { var dir = this.viewModelWrapper.CurrentDirectory; if (dir != null) args.CanExecute = dir.CanRefresh(); } }
private void CanGoToPrevPage(object sender, CanExecuteEventArgs args) { OnAppBarCanExecute(sender, args); args.CanExecute = args.CanExecute && this.viewmodel.CanGoToPrev(); }
private void OnAppBarCanExecute(object sender, CanExecuteEventArgs args) { args.CanExecute = false; if (this.viewmodel != null) args.CanExecute = true; }
private void OnRefreshCommandCanExecute(object sender, CanExecuteEventArgs args) { args.CanExecute = false; if (this.viewmodel != null) args.CanExecute = this.viewmodel.CanRefresh(); }
private void OnRefreshCommandCanExecuteRaised(object sender, CanExecuteEventArgs args) { args.CanExecute = false; if (this.mainPivot != null) { var pivotItem = this.mainPivot.SelectedItem as FrameworkElement; var viewmodel = pivotItem.DataContext as IContentViewModel; if (viewmodel != null) args.CanExecute = viewmodel.CanRefresh(); } }