private PendingProcess(IReactiveEventAggregator eventAggregator, string description = null) { this.eventAggregator = eventAggregator; this.description = description; this.eventAggregator.Publish(new PendingProcessStartEvent { Description = description }); }
public MaterialDesignPopupHandler(IReactiveEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; eventAggregator.GetEvent <DefaultConfirmationRequestData>().ObserveOn(DispatcherScheduler.Current).Subscribe(this.ShowDefaultConfirmationPopup); eventAggregator.GetEvent <StringRequestData>().ObserveOn(DispatcherScheduler.Current).Subscribe(this.ShowDefaultRequestStringPopup); eventAggregator.GetEvent <PasswordRequestData>().ObserveOn(DispatcherScheduler.Current).Subscribe(this.ShowDefaultRequestPasswordPopup); eventAggregator.GetEvent <PopupConfirmationWindowRequestData>().ObserveOn(DispatcherScheduler.Current).Subscribe(this.ShowCustomPopupWindow); eventAggregator.GetEvent <PopupCustomButtonsWindowRequestData>().ObserveOn(DispatcherScheduler.Current).Subscribe(this.ShowPopupWindowWithCustomButtons); }
public SmartCardStatusViewModel( IConfigurationService configurationService, IReactiveEventAggregator eventAggregator) : base(eventAggregator) { this.configurationService = configurationService; Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(RefreshStatusIntervalInSeconds), DispatcherScheduler.Current) .Subscribe(v => this.RefreshStatus()); }
public PendingProcessHandler(IReactiveEventAggregator eventAggregator) { eventAggregator.GetEvent <PendingProcessStartEvent>().ObserveOn(Dispatcher.CurrentDispatcher, DispatcherPriority.Render).Subscribe(v => { this.pendingProcessRequestsCount++; this.PendingProcessDescriptions.Add(v.Description); this.OnPropertyChanged(() => this.PendingProcessIsActive); }); eventAggregator.GetEvent <PendingProcessStopEvent>().ObserveOn(Dispatcher.CurrentDispatcher, DispatcherPriority.Render).Subscribe(v => { this.pendingProcessRequestsCount--; this.PendingProcessDescriptions.Remove(v.Description); this.OnPropertyChanged(() => this.PendingProcessIsActive); }); }
public NotificationViewModel(IScheduler uiScheduler, IReactiveEventAggregator eventAggregator) { this.EventAggregator = eventAggregator; this.uiScheduler = uiScheduler; const int TemporaryNotificationDurationSeconds = 5; var notificationAddedObservable = this.TemporaryNotificationStack.ItemsAdded .Delay(TimeSpan.FromSeconds(TemporaryNotificationDurationSeconds)) .ObserveOn(uiScheduler) .Subscribe(v => { lock (this.NotificationMessages) { this.TemporaryNotificationStack.Remove(v); } }); this.disposables.Add(notificationAddedObservable); }
public SignerViewModel(SmartCardStatusViewModel smartCardStatusViewModel, PdfSigner pdfSigner, IIoDialogsService ioDialogsService, IReactiveEventAggregator eventAggregator) : base(eventAggregator) { this.smartCardStatusViewModel = smartCardStatusViewModel; this.pdfSigner = pdfSigner; this.ioDialogsService = ioDialogsService; this.ChoosePdfToSignCommand = new DelegateCommand(this.ChoosePdfToSignExecute, () => smartCardStatusViewModel.SmartCardDisconnected.HasValue && !smartCardStatusViewModel.SmartCardDisconnected.Value); this.SignPdfCommand = new DelegateCommand <string>(this.SignPdfExecute, v => smartCardStatusViewModel.SmartCardDisconnected.HasValue && !smartCardStatusViewModel.SmartCardDisconnected.Value); smartCardStatusViewModel.ObservableFromPropertyChanged(nameof(SmartCardStatusViewModel.SmartCardDisconnected)) .Subscribe(v => this.ChoosePdfToSignCommand.RaiseCanExecuteChanged()); }
public static IDisposable StartNew(IReactiveEventAggregator eventAggregator, string description = null) { return(new PendingProcess(eventAggregator, description)); }
public ConfirmationViewModel(IReactiveEventAggregator eventAggregator, ConfirmationArgs confirmationContent) : base(eventAggregator) { this.ConfirmationContent = confirmationContent; this.OkCommand = new DelegateCommand(this.Ok); this.CancelCommand = new DelegateCommand(this.Cancel); }
protected BasePrismViewModel(IReactiveEventAggregator eventAggregator) { this.EventAggregator = eventAggregator; this.ViewModelPopupRequests = new ViewModelPopupRequests(eventAggregator); }
public ViewModelPopupRequests(IReactiveEventAggregator eventAggregator) { this.EventAggregator = eventAggregator; }
public StringRequestViewModel(IReactiveEventAggregator eventAggregator, ConfirmationArgs confirmationArgs) : base(eventAggregator, confirmationArgs) { }
protected PageViewModel(IReactiveEventAggregator eventAggregator) : base(eventAggregator) { // Нажатие клавишь ловим только на уровне PageViewModel, чтобы фильтровать неактивные вкладки. this.EventAggregator.GetEvent <KeyPressedEventData>()?.Where(v => this.IsActive).Subscribe(this.ProcessKeyPressing); }