public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _excelService = excelService; if (IsInDesignModeStatic) { Application.Current.Dispatcher.Invoke(async () => { CurrentDemo = await _demosService.AnalyzeDemo(new Demo(), CancellationToken.None); }); } Messenger.Default.Register<SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage); }
public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _excelService = excelService; if (IsInDesignModeStatic) { var demo = _demosService.AnalyzeDemo(new Demo()); CurrentDemo = demo.Result; } }
public HomeViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _excelService = excelService; if (IsInDesignModeStatic) { DispatcherHelper.Initialize(); } Demos = new ObservableCollection<Demo>(); SelectedDemos = new ObservableCollection<Demo>(); DataGridDemosCollection = CollectionViewSource.GetDefaultView(Demos); DataGridDemosCollection.SortDescriptions.Add(new SortDescription("Date", ListSortDirection.Descending)); DataGridDemosCollection.Filter = Filter; Messenger.Default.Register<MainWindowLoadedMessage>(this, HandleMainWindowLoadedMessage); }
public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _excelService = excelService; if (IsInDesignModeStatic) { var demo = _demosService.AnalyzeDemo(new Demo()); CurrentDemo = demo.Result; IsAnalyzing = true; HasNotification = true; NotificationMessage = "Loading..."; } Messenger.Default.Register<SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage); }