public MainViewModel() { SayHelloCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => SayHello()) .OnCanExecute(() => !string.IsNullOrWhiteSpace(Name)) .Observe(this, nameof(Name)) .Build(); }
public PublisherViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; PublishCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => Publish()) .OnCanExecute(() => !string.IsNullOrEmpty(Message)) .Observe(this, nameof(Message)) .Build(); }
public MainViewModel(Company company) { _company = company; _validation = new ValidationAdapter(OnErrorsChanged); _validation.Validator = SetupValidator(); SaveCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => Save()) .OnCanExecute(() => CanSave) .Observe(this, nameof(CanSave)) .Build(); }
public ShellViewModel(Func <TabViewModel> createTabViewModel) { if (createTabViewModel == null) { throw new ArgumentNullException(nameof(createTabViewModel)); } _createTabViewModel = createTabViewModel; OpenTabCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => OpenTab()) .Build(); CloseTabCommand = DelegateCommandBuilder.WithParameter <TabViewModel>() .OnExecute(item => DeactivateItem(item, true)) .Build(); }
public ShellViewModel() { ExecuteCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => OnExecute()) .Build(); UIContextRunCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => OnUIContextRun()) .Build(); TaskRunCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => OnTaskRun()) .Build(); AsyncCommand = DelegateCommandBuilder.NoParameter() .OnExecute(() => OnAsync()) .Build(); }