public MainViewModel(IDataService dataService) { InitializeCommands(); MainWindowTitle = "EventLook" + (ProcessHelper.IsElevated ? " (Administrator)" : ""); DataService = dataService; Events = new ObservableCollection <EventItem>(); logSourceMgr = new LogSourceMgr(); SelectedLogSource = LogSources.FirstOrDefault(); rangeMgr = new RangeMgr(); SelectedRange = Ranges.FirstOrDefault(r => r.DaysFromNow == 3); sourceFilter = new Model.SourceFilter(); levelFilter = new LevelFilter(); MsgFilter = new MessageFilter(); IdFilter = new IdFilter(); filters = new List <FilterBase> { sourceFilter, levelFilter, MsgFilter, IdFilter }; progress = new Progress <ProgressInfo>(ProgressCallback); // Needs to instantiate in UI thread stopwatch = new Stopwatch(); Messenger.Default.Register <ViewCollectionViewSourceMessageToken>(this, Handle_ViewCollectionViewSourceMessageToken); Messenger.Default.Register <FileToBeProcessedMessageToken>(this, Handle_FileToBeProcessedMessageToken); Messenger.Default.Register <DetailWindowMessageToken>(this, Handle_DetailWindowMessageToken); }
public MainViewModel(IDataService dataService) { InitializeCommands(); DataService = dataService; Events = new ObservableCollection <EventItem>(); logSourceMgr = new LogSourceMgr(); SelectedLogSource = LogSources.FirstOrDefault(); rangeMgr = new RangeMgr(); SelectedRange = Ranges.FirstOrDefault(r => r.DaysFromNow == 3); sourceFilter = new Model.SourceFilter(); MsgFilter = new MessageFilter(); filters = new List <FilterBase> { sourceFilter, MsgFilter }; progress = new Progress <ProgressInfo>(ProgressCallback); // Needs to instantiate in UI thread stopwatch = new Stopwatch(); Messenger.Default.Register <ViewCollectionViewSourceMessageToken>(this, Handle_ViewCollectionViewSourceMessageToken); }