Beispiel #1
0
        public MainViewModel(CashGameViewModel cashGameVM, ReportViewModel reportVM, TournamentViewModel tournamentViewModel, StatsViewModel statsViewModel,
                             SettingsViewModel settingsViewModel, ISettingsWindowService settingsWindowService)
        {
            CashGameViewModel      = cashGameVM;
            ReportViewModel        = reportVM;
            TournamentViewModel    = tournamentViewModel;
            StatsViewModel         = statsViewModel;
            _settingsWindowService = settingsWindowService;
            _settingsViewModel     = settingsViewModel;

            CreateReportCommand = new RelayCommand(CreateCashReport);

            ExitApplicationCommand = new RelayCommand(() => Application.Current.Shutdown());

            ShowSettingsDialog = new RelayCommand(ShowSettings);

            Messenger.Default.Register <NotificationMessage>(this, message =>
            {
                if (message.Notification == "PlayingSessionsUpdated")
                {
                    CreateCashReport();
                    CreateStatsReport();
                }
            });

            CreateCashReport();
            CreateStatsReport();
        }
Beispiel #2
0
 private void CreateStatsReport()
 {
     StatsViewModel.GenerateReports(CashGameViewModel.PlayingSessions);
 }