public MessageListViewModel( IEventAggregator eventAggregator, IWorkNotifier workNotifier, IServiceControl serviceControl, SearchBarViewModel searchBarViewModel, GeneralHeaderViewModel generalHeaderDisplay, MessageSelectionContext selectionContext, IClipboard clipboard, ISettingsProvider settingsProvider) { SearchBar = searchBarViewModel; Selection = selectionContext; this.clipboard = clipboard; this.settingsProvider = settingsProvider; this.eventAggregator = eventAggregator; this.workNotifier = workNotifier; this.serviceControl = serviceControl; this.generalHeaderDisplay = generalHeaderDisplay; Items.Add(SearchBar); RetryMessageCommand = new RetryMessageCommand(eventAggregator, workNotifier, serviceControl); CopyMessageIdCommand = new CopyMessageURICommand(clipboard, serviceControl); CopyHeadersCommand = Command.Create(CopyHeaders, generalHeaderDisplay.Changed .Where(pc => pc.PropertyName == nameof(GeneralHeaderViewModel.HeaderContent)) .Select(s => !((string)s.Value).IsEmpty())); Rows = new BindableCollection <StoredMessage>(); }
public MessageListViewModel( IEventAggregator eventAggregator, IServiceControl serviceControl, SearchBarViewModel searchBarViewModel, GeneralHeaderViewModel generalHeaderDisplay, IClipboard clipboard) { this.clipboard = clipboard; this.eventAggregator = eventAggregator; this.serviceControl = serviceControl; this.generalHeaderDisplay = generalHeaderDisplay; SearchBar = searchBarViewModel; Items.Add(SearchBar); RetryMessageCommand = new RetryMessageCommand(eventAggregator, serviceControl); CopyMessageIdCommand = new CopyMessageURICommand(clipboard, serviceControl); CopyHeadersCommand = this.CreateCommand(CopyHeaders, generalHeaderDisplay.WhenAnyValue(ghd => ghd.HeaderContent).Select(s => !s.IsEmpty())); Rows = new BindableCollection <StoredMessage>(); this.WhenAnyValue(vm => vm.FocusedRow) .Throttle(TimeSpan.FromMilliseconds(500), RxApp.MainThreadScheduler) .Subscribe(_ => DoFocusedRowChanged()); }
public MessageListViewModel( IEventAggregator eventAggregator, IServiceControl serviceControl, SearchBarViewModel searchBarViewModel, GeneralHeaderViewModel generalHeaderDisplay, MessageSelectionContext selectionContext, IClipboard clipboard) { this.SearchBar = searchBarViewModel; this.Selection = selectionContext; this.clipboard = clipboard; this.eventAggregator = eventAggregator; this.serviceControl = serviceControl; this.generalHeaderDisplay = generalHeaderDisplay; Items.Add(SearchBar); RetryMessageCommand = new RetryMessageCommand(eventAggregator, serviceControl); CopyMessageIdCommand = new CopyMessageURICommand(clipboard, serviceControl); CopyHeadersCommand = this.CreateCommand(CopyHeaders, generalHeaderDisplay.WhenAnyValue(ghd => ghd.HeaderContent).Select(s => !s.IsEmpty())); Rows = new BindableCollection <StoredMessage>(); }