public CommandViewModel(IYubaba yubaba, IEventAggregator eventAggregator) { Yubaba = yubaba ?? throw new ArgumentNullException(nameof(yubaba)); EventAggregator = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator)); InitCommand = new AsyncReactiveCommand() .WithSubscribe(async() => { await Yubaba.RequestIntroductionAsync(); EventAggregator.GetEvent <ResetEvent>().Publish(); }) .AddTo(Disposables); }
public ContractViewModel(IYubaba yubaba, IEventAggregator eventAggregator) { Yubaba = yubaba ?? throw new ArgumentNullException(nameof(yubaba)); EventAggregator = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator)); SubmitCommand = new AsyncReactiveCommand() .WithSubscribe(async() => await Yubaba.SubmitContractAsync(new ContractPaper(SignatureSign.Value))) .AddTo(Disposables); EventAggregator.GetEvent <ResetEvent>() .Subscribe(() => SignatureSign.Value = "") .AddTo(Disposables); }