Esempio n. 1
0
        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;
        }
Esempio n. 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();
     }
 }
Esempio n. 3
0
 private void CanGoToPrevPage(object sender, CanExecuteEventArgs args)
 {
     OnAppBarCanExecute(sender, args);
     args.CanExecute = args.CanExecute && this.viewmodel.CanGoToPrev();
 }
Esempio n. 4
0
 private void OnAppBarCanExecute(object sender, CanExecuteEventArgs args)
 {
     args.CanExecute = false;
     if (this.viewmodel != null)
         args.CanExecute = true;
 }
Esempio n. 5
0
 private void OnRefreshCommandCanExecute(object sender, CanExecuteEventArgs args)
 {
     args.CanExecute = false;
     if (this.viewmodel != null)
         args.CanExecute = this.viewmodel.CanRefresh();
 }
Esempio n. 6
0
        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();
            }
        }