コード例 #1
0
ファイル: EventCommand.cs プロジェクト: jarkkom/awfuldotnet
        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;
        }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 private void CanGoToPrevPage(object sender, CanExecuteEventArgs args)
 {
     OnAppBarCanExecute(sender, args);
     args.CanExecute = args.CanExecute && this.viewmodel.CanGoToPrev();
 }
コード例 #4
0
 private void OnAppBarCanExecute(object sender, CanExecuteEventArgs args)
 {
     args.CanExecute = false;
     if (this.viewmodel != null)
         args.CanExecute = true;
 }
コード例 #5
0
ファイル: ListView.xaml.cs プロジェクト: jarkkom/awfuldotnet
 private void OnRefreshCommandCanExecute(object sender, CanExecuteEventArgs args)
 {
     args.CanExecute = false;
     if (this.viewmodel != null)
         args.CanExecute = this.viewmodel.CanRefresh();
 }
コード例 #6
0
ファイル: PivotView.xaml.cs プロジェクト: jarkkom/awfuldotnet
        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();
            }
        }