void UpdatePlayerStatistics()
 {
     PlayerOverlays.ForEach(po => {
         var playerStatisticsViewModel = PokerTableStatisticsViewModel.GetPlayerStatisticsViewModelFor(po.PlayerName);
         po.UpdateStatisticsWith(playerStatisticsViewModel);
     });
 }
        void RegisterEvents()
        {
            PokerTableStatisticsViewModel.PlayersStatisticsWereUpdated += UpdatePlayerStatistics;
            PokerTableStatisticsViewModel.UserSelectedStatisticsSet    += _ => {
                ShowOverlayDetails           = true;
                DetailedStatisticsIsSelected = true;
            };

            PokerTableStatisticsViewModel.UserBrowsedAllHands += _ => {
                ShowOverlayDetails           = true;
                DetailedStatisticsIsSelected = true;
            };

            GameHistory.PopMeIn += () => {
                GameHistoryIsPoppedIn = true;
                ShowOverlayDetails    = true;
                GameHistoryIsSelected = true;

                UpdateLiveTrackerSettings();
            };

            GameHistory.PopMeOut += () => {
                ShowGameHistoryWindow();
                DetailedStatisticsIsSelected = true;
                GameHistoryIsPoppedIn        = false;

                UpdateLiveTrackerSettings();
            };

            PlayerOverlays.ForEach(po => po.FilterAdjustmentRequested +=
                                       playerStatisticsViewModel =>
                                       PokerTableStatisticsViewModel.DisplayFilterAdjustmentPopup(playerStatisticsViewModel));
        }
        public Window ConnectToDataBase_LoadSomePLayers_ShowTheirStatistics_InTheLiveStats()
        {
            Func <string, IPlayerStatistics> get =
                playerName => _container
                .Resolve <IPlayerStatistics>()
                .InitializePlayer(playerName, PokerStars)
                .UpdateStatistics();

            const string salemorguy = "salemorguy";
            const string greystoke  = "Greystoke-11";

            // const string renniweg = "renniweg";
            var eventAggregator = new EventAggregator();

            var detailedPreFlopStatisticsViewModelMake =
                new Constructor <IDetailedPreFlopStatisticsViewModel>(() => _container.Resolve <DetailedPreFlopStatisticsViewModel>());
            var detailedPostFlopHeroActsStatisticsViewModelMake =
                new Constructor <IDetailedPostFlopHeroActsStatisticsViewModel>(
                    () => _container.Resolve <DetailedPostFlopHeroActsStatisticsViewModel>());

            var detailedPostFlopHeroReactsStatisticsViewModelMake =
                new Constructor <IDetailedPostFlopHeroReactsStatisticsViewModel>(
                    () => _container.Resolve <DetailedPostFlopHeroReactsStatisticsViewModel>());

            var detailedStatisticsAnalyzerViewModel =
                new DetailedStatisticsAnalyzerViewModel(
                    detailedPreFlopStatisticsViewModelMake,
                    detailedPostFlopHeroActsStatisticsViewModelMake,
                    detailedPostFlopHeroReactsStatisticsViewModelMake,
                    new Mock <IRepositoryHandBrowserViewModel>().Object);

            // TODO: Before this test will work again, we will have to specify the settings and dimensions mocks otherwise it will either
            // fail or have size 0, 0
            var tableStatisticsViewModel = new PokerTableStatisticsViewModel(
                new Mock <ISettings>().Object,
                new Mock <IDimensionsViewModel>().Object,
                new Constructor <IPlayerStatisticsViewModel>(() => _container.Resolve <IPlayerStatisticsViewModel>()),
                detailedStatisticsAnalyzerViewModel,
                new Mock <IActiveAnalyzablePlayersSelector>().Object,
                new Mock <IFilterPopupViewModel>().Object);
            var designWindow = new TableStatisticsDesignWindow(
                eventAggregator,
                _container.Resolve <IRepositoryHandBrowserViewModel>())
            {
                Topmost     = true,
                DataContext = tableStatisticsViewModel
            };

            tableStatisticsViewModel.UpdateWith(
                new[]
            {
                // get(renniweg),
                get(greystoke),
                get(salemorguy)
            });

            designWindow.ShowDialog();
            return(designWindow);
        }