public static RelayCommand <T> WithGarbageCollectableCanExecuteTarget <T>(Action <T> execute, Func <T, bool> canExecute)
        {
            var canExecuteProvider = new TestCanExecuteProvider <T>(canExecute);

            return(new RelayCommand <T>(execute, canExecuteProvider.CanExecute));
        }
示例#2
0
        public static AsyncCommand <T> WithGarbageCollectableCanExecuteTarget <T>(Func <T, Task> execute, Func <T, bool> canExecute)
        {
            var canExecuteProvider = new TestCanExecuteProvider <T>(canExecute);

            return(new AsyncCommand <T>(execute, canExecuteProvider.CanExecute));
        }
        public static RelayCommand WithGarbageCollectableCanExecuteTarget(Action execute, Func <bool> canExecute)
        {
            var canExecuteProvider = new TestCanExecuteProvider(canExecute);

            return(new RelayCommand(execute, canExecuteProvider.CanExecute));
        }