Пример #1
0
 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());
        }
Пример #4
0
 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);
     });
 }
Пример #5
0
        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);
        }
Пример #6
0
        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());
        }
Пример #7
0
 public static IDisposable StartNew(IReactiveEventAggregator eventAggregator, string description = null)
 {
     return(new PendingProcess(eventAggregator, description));
 }
Пример #8
0
 public ConfirmationViewModel(IReactiveEventAggregator eventAggregator, ConfirmationArgs confirmationContent) : base(eventAggregator)
 {
     this.ConfirmationContent = confirmationContent;
     this.OkCommand           = new DelegateCommand(this.Ok);
     this.CancelCommand       = new DelegateCommand(this.Cancel);
 }
Пример #9
0
        protected BasePrismViewModel(IReactiveEventAggregator eventAggregator)
        {
            this.EventAggregator = eventAggregator;

            this.ViewModelPopupRequests = new ViewModelPopupRequests(eventAggregator);
        }
Пример #10
0
 public ViewModelPopupRequests(IReactiveEventAggregator eventAggregator)
 {
     this.EventAggregator = eventAggregator;
 }
Пример #11
0
 public StringRequestViewModel(IReactiveEventAggregator eventAggregator, ConfirmationArgs confirmationArgs) : base(eventAggregator, confirmationArgs)
 {
 }
Пример #12
0
 protected PageViewModel(IReactiveEventAggregator eventAggregator) : base(eventAggregator)
 {
     // Нажатие клавишь ловим только на уровне PageViewModel, чтобы фильтровать неактивные вкладки.
     this.EventAggregator.GetEvent <KeyPressedEventData>()?.Where(v => this.IsActive).Subscribe(this.ProcessKeyPressing);
 }