public DemoDetailsViewModel( IDemosService demosService, IDialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService, IRoundService roundService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _excelService = excelService; _roundService = roundService; Sources = Source.Sources; if (IsInDesignMode) { DispatcherHelper.CheckBeginInvokeOnUI(async() => { Demo = await _cacheService.GetDemoDataFromCache(string.Empty); PlayersTeam1Collection = CollectionViewSource.GetDefaultView(Demo.TeamCT.Players); PlayersTeam2Collection = CollectionViewSource.GetDefaultView(Demo.TeamT.Players); RoundsCollection = CollectionViewSource.GetDefaultView(Demo.Rounds); }); } Messenger.Default.Register <LoadDemoFromAppArgument>(this, HandleLoadFromArgumentMessage); }
public SuspectsViewModel(ISteamService steamService, ICacheService cacheService, DialogService dialogService, IDemosService demosService) { _steamService = steamService; _cacheService = cacheService; _dialogService = dialogService; _demosService = demosService; if (IsInDesignMode) { DispatcherHelper.Initialize(); IsAnalyzing = true; } Suspects = new ObservableCollection <Suspect>(); SelectedSuspects = new ObservableCollection <Suspect>(); DataGridSuspectsCollection = CollectionViewSource.GetDefaultView(Suspects); DataGridSuspectsCollection.Filter = Filter; Application.Current.Dispatcher.Invoke(async() => { IsRefreshing = true; NotificationMessage = "Refreshing..."; await LoadSuspects(); if (!IsInDesignMode) { IsRefreshing = false; } CommandManager.InvalidateRequerySuggested(); }); }
public HomeViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; if (IsInDesignModeStatic) { DispatcherHelper.Initialize(); } NotificationMessage = "Loading..."; IsBusy = true; HasNotification = true; 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); Messenger.Default.Register <RefreshDemosMessage>(this, HandleRefreshDemosMessage); Messenger.Default.Register <SelectedAccountChangedMessage>(this, HandleSelectedAccountChangedMessage); }
public OverviewViewModel(DialogService dialogService, IDemosService demoService) { _dialogService = dialogService; _demoService = demoService; TeamSelectors.Add(new ComboboxSelector("CT", "Counter-Terrorists")); TeamSelectors.Add(new ComboboxSelector("T", "Terrorists")); TeamSelectors.Add(new ComboboxSelector("BOTH", "Both")); }
public DemoOverviewViewModel(IDialogService dialogService, IDemosService demoService, IMapService mapService) { _dialogService = dialogService; _demoService = demoService; _mapService = mapService; TeamSelectors.Add(new ComboboxSelector("CT", Properties.Resources.CounterTerrorists)); TeamSelectors.Add(new ComboboxSelector("T", Properties.Resources.Terrorists)); TeamSelectors.Add(new ComboboxSelector("BOTH", Properties.Resources.Both)); }
public WhitelistViewModel(DialogService dialogService, ICacheService cacheService, ISteamService steamService, IDemosService demosService) { _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _demosService = demosService; Suspects = new ObservableCollection <Suspect>(); SelectedSuspects = new ObservableCollection <Suspect>(); }
public AccountStatsOverallViewModel(IDemosService demoService) { _demosService = demoService; if (IsInDesignMode) { Application.Current.Dispatcher.Invoke(async() => { await LoadDatas(); }); } }
public WhitelistViewModel(DialogService dialogService, ICacheService cacheService, ISteamService steamService, IDemosService demosService) { _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _demosService = demosService; Suspects = new ObservableCollection <Suspect>(); SelectedSuspects = new ObservableCollection <Suspect>(); DataGridPlayerCollection = CollectionViewSource.GetDefaultView(Suspects); DataGridPlayerCollection.SortDescriptions.Add(new SortDescription("Nickname", ListSortDirection.Ascending)); DataGridPlayerCollection.Filter = Filter; }
public SettingsViewModel(DialogService dialogService, ICacheService chacheService, IDemosService demosService, ISteamService steamService) { _dialogService = dialogService; _cacheService = chacheService; _demosService = demosService; _steamService = steamService; System.Windows.Application.Current.Dispatcher.Invoke(async() => { List <Account> accounts = await _cacheService.GetAccountListAsync(); Accounts = new ObservableCollection <Account>(accounts); SelectedStatsAccount = Accounts.FirstOrDefault(a => a.SteamId == Settings.Default.SelectedStatsAccountSteamID.ToString()); }); }
public SettingsViewModel( IDialogService dialogService, ICacheService chacheService, IDemosService demosService, ISteamService steamService, IAccountStatsService accountStatsService) { _dialogService = dialogService; _cacheService = chacheService; _demosService = demosService; _steamService = steamService; _accountStatsService = accountStatsService; Themes = new List<ComboboxSelector> { new ComboboxSelector("Dark", Properties.Resources.Dark), new ComboboxSelector("Light", Properties.Resources.Light) }; if (IsInDesignMode) { _dateStatsTo = DateTime.Today.AddDays(30); _selectedTheme = new ComboboxSelector("Dark", Properties.Resources.Dark); } else { SelectedTheme = Themes.First(t => t.Id == Settings.Default.Theme); } Languages = new List<ComboboxSelector>(); foreach (Language language in AppSettings.LANGUAGES.Where(l => l.IsEnabled)) { ComboboxSelector newLanguage = new ComboboxSelector(language.Key, language.Name); if (language.Key == Settings.Default.Language) SelectedLanguage = newLanguage; Languages.Add(newLanguage); } Application.Current.Dispatcher.Invoke(async () => { List<Account> accounts = await _cacheService.GetAccountListAsync(); Accounts = new ObservableCollection<Account>(accounts); StatusList = new List<DemoStatus>(AppSettings.DefaultStatus); SelectedStatsAccount = Accounts.FirstOrDefault(a => a.SteamId == Settings.Default.SelectedStatsAccountSteamID.ToString()); DownloadFolderPath = Settings.Default.DownloadFolder; IgnoreLaterBan = Settings.Default.IgnoreLaterBan; CacheSize = await _cacheService.GetCacheSizeAsync(); _cacheService.Filter.From = Settings.Default.DateStatsFrom; _cacheService.Filter.To = Settings.Default.DateStatsTo; _cacheService.Filter.Folder = Settings.Default.LimitStatsFolder ? Settings.Default.LastFolder : null; }); Messenger.Default.Register<SettingsFlyoutOpenedMessage>(this, HandleSettingsFlyoutOpenedMessage); }
public AccountStatsRankViewModel(IDemosService demoService) { _demosService = demoService; if (IsInDesignMode) { DispatcherHelper.Initialize(); NotificationMessage = "Loading..."; IsBusy = true; Application.Current.Dispatcher.Invoke(async() => { Datas = await _demosService.GetRankDateChartDataAsync(); }); } }
public HeatmapViewModel(DialogService dialogService, IDemosService demosService) { _dialogService = dialogService; _demosService = demosService; EventSelectors.Add(new ComboboxSelector("kills", "Kills")); EventSelectors.Add(new ComboboxSelector("shots", "Shots fired")); EventSelectors.Add(new ComboboxSelector("flashbangs", "Flashbangs")); EventSelectors.Add(new ComboboxSelector("he", "HE Grenades")); EventSelectors.Add(new ComboboxSelector("smokes", "Smokes")); EventSelectors.Add(new ComboboxSelector("molotovs", "Molotovs")); EventSelectors.Add(new ComboboxSelector("decoys", "Decoy")); CurrentEventSelector = EventSelectors[0]; TeamSelectors.Add(new ComboboxSelector("CT", "Counter-Terrorists")); TeamSelectors.Add(new ComboboxSelector("T", "Terrorists")); TeamSelectors.Add(new ComboboxSelector("BOTH", "Both")); CurrentTeamSelector = TeamSelectors[2]; }
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; IsAnalyzing = true; HasNotification = true; NotificationMessage = "Loading..."; } Messenger.Default.Register <SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage); }
public SuspectListViewModel(ISteamService steamService, ICacheService cacheService, DialogService dialogService, IDemosService demosService) { _steamService = steamService; _cacheService = cacheService; _dialogService = dialogService; _demosService = demosService; if (IsInDesignMode) { DispatcherHelper.Initialize(); IsAnalyzing = true; } Suspects = new ObservableCollection <Suspect>(); SelectedSuspects = new ObservableCollection <Suspect>(); DataGridSuspectsCollection = CollectionViewSource.GetDefaultView(Suspects); DataGridSuspectsCollection.SortDescriptions.Add(new SortDescription("DaySinceLastBanCount", ListSortDirection.Ascending)); DataGridSuspectsCollection.Filter = Filter; Messenger.Default.Register <LoadSuspectListMessage>(this, HandleLoadSuspectListMessage); }
public HomeViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService) { _demosService = demosService; _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; if (IsInDesignModeStatic) { DispatcherHelper.Initialize(); } NotificationMessage = "Loading..."; IsBusy = true; HasNotification = true; 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); Messenger.Default.Register<RefreshDemosMessage>(this, HandleRefreshDemosMessage); }
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); }
public WhitelistViewModel(DialogService dialogService, ICacheService cacheService, ISteamService steamService, IDemosService demosService) { _dialogService = dialogService; _steamService = steamService; _cacheService = cacheService; _demosService = demosService; Suspects = new ObservableCollection<Suspect>(); SelectedSuspects = new ObservableCollection<Suspect>(); }
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 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 AccountStatsRankViewModel(IDemosService demoService) { _demosService = demoService; if (IsInDesignMode) { DispatcherHelper.Initialize(); NotificationMessage = "Loading..."; IsBusy = true; Application.Current.Dispatcher.Invoke(async () => { Datas = await _demosService.GetRankDateChartDataAsync(); }); } }
public SettingsViewModel(DialogService dialogService, ICacheService chacheService, IDemosService demosService) { _dialogService = dialogService; _cacheService = chacheService; _demosService = demosService; }
public AccountStatsWeaponViewModel(IDemosService demoService) { _demosService = demoService; if (IsInDesignMode) { Application.Current.Dispatcher.Invoke(async () => { await LoadDatas(); }); } }
public SuspectsViewModel(ISteamService steamService, ICacheService cacheService, DialogService dialogService, IDemosService demosService) { _steamService = steamService; _cacheService = cacheService; _dialogService = dialogService; _demosService = demosService; if (IsInDesignModeStatic) { DispatcherHelper.Initialize(); } Suspects = new ObservableCollection<Suspect>(); SelectedSuspects = new ObservableCollection<Suspect>(); DataGridSuspectsCollection = CollectionViewSource.GetDefaultView(Suspects); DispatcherHelper.CheckBeginInvokeOnUI( async () => { IsRefreshing = true; NotificationMessage = "Refreshing..."; await LoadSuspects(); IsRefreshing = false; CommandManager.InvalidateRequerySuggested(); }); }
public SettingsViewModel(DialogService dialogService, ICacheService chacheService, IDemosService demosService, ISteamService steamService) { _dialogService = dialogService; _cacheService = chacheService; _demosService = demosService; _steamService = steamService; System.Windows.Application.Current.Dispatcher.Invoke(async () => { List<Account> accounts = await _cacheService.GetAccountListAsync(); Accounts = new ObservableCollection<Account>(accounts); SelectedStatsAccount = Accounts.FirstOrDefault(a => a.SteamId == Settings.Default.SelectedStatsAccountSteamID.ToString()); }); }