Beispiel #1
0
 public async Task StopAsync()
 {
     await Task.WhenAll(
         BadFilterReportModel.StopAsync(),
         BackgroundEvent.StopAsync(),
         FiltersEvent.StopAsync());
 }
Beispiel #2
0
        public MainViewModel()
        {
            BadFilterReportModel.Start();
            FactionsEngine.Start(FiltersEvent);
            finishInit  = FiltersEvent.Start(); // добавляйте ещё через Task.WhenAll
            ServerModel = new ServerModel(ServerEvents);
            ServerModel.Start();
            GameView = new GameViewModel(GameModel, FiltersEvent);

            NewsViewModel   = new NewsViewModel(GameView);
            HomeViewModel   = new HomeViewModel(GameView);
            ItemsViewModel  = new ItemsViewModel(GameView);
            AlertsViewModel = new AlertsViewModel(GameView);

            ActivateHomeCommand   = new RelayCommand(() => CurrentContent = HomeViewModel);
            ActivateNewsCommand   = new RelayCommand(() => CurrentContent = NewsViewModel);
            ActivateItemsCommand  = new RelayCommand(() => CurrentContent = ItemsViewModel);
            ActivateAlertsCommand = new RelayCommand(() => CurrentContent = AlertsViewModel);
            CurrentContent        = HomeViewModel;
        }