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>(); }