public BF4StatsViewModel(IUIHostService hostService, IDiscord discord, IApplicationState state)
        {
            _state   = state;
            _discord = discord;

            WindowBackgroundContent = hostService.GetHostContainer(UIElementConstants.HostWindowBackground) as Grid;
        }
Exemple #2
0
        public MainWindowViewModel(
            IZApi api,
            ILog logger,
            ISettingsService settingsService,
            IProcessService processService,
            IResolutionRoot kernel,
            IEventService eventService,
            IMainMenuService menuService,
            IUpdateService updateService,
            IGameService gameService,
            IDiscord discordPresence,

            IPageNavigator navigator,
            IApplicationState state,
            IViewModelSource viewModelSource,
            IDialogService dialogService,
            IDialogSystemBase dialogSystemBase,
            IBusyIndicatorBase busyIndicatorBase,
            IBusyIndicatorService busyIndicatorService)
        {
            _navigator            = navigator;
            _state                = state;
            _dialogSystemBase     = dialogSystemBase;
            _dialogService        = dialogService;
            _busyIndicatorBase    = busyIndicatorBase;
            _busyIndicatorService = busyIndicatorService;
            _eventService         = eventService;

            _menuService = menuService;

            _apiConnection   = api.Connection;
            _log             = logger;
            _settingsService = settingsService;
            _processService  = processService;
            _updateService   = updateService;
            _gameService     = gameService;
            _discordPresence = discordPresence;
            _api             = api;

            NonClientDataContext = viewModelSource.Create <WindowNonClientPartViewModel>();
            BottomBarDataContext = viewModelSource.Create <WindowBottomBarPartViewModel>();

            _apiConnection.ConnectionChanged += _apiConnectionConnectionChangedHandler;

            _zClientProcessTracker = new ZProcessTracker(_ZClientProcessName, TimeSpan.FromSeconds(3), true, processes => processes
                                                         .OrderByDescending(process => process.StartTime)
                                                         .First());
            _zClientProcessTracker.ProcessDetected += _zClientProcessDetectedHandler;
            _zClientProcessTracker.ProcessLost     += _zClientProcessLostHandler;

            api.Configure(new ZConfiguration {
                SynchronizationContext = SynchronizationContext.Current
            });

            _gameService.GameCreationError += _GameCreationErrorHandler;
        }
Exemple #3
0
        public EventLogViewModel(
            IDiscord discord,
            IEventService eventService)
        {
            _discord = discord;

            // track events
            eventService.EventOccured += _OnEventReceived;

            // build eventsList
            var eventList = eventService;

            // move logged event into current viewModel
            Events = new ObservableCollection <EventItemViewModel>(
                eventList.EventsStack
                .Select(_BuildItemViewModelFromItem));
        }
 public BF3ServerBrowserViewModel(
     IZApi api,
     IEventService eventService,
     IGameService gameService,
     IDiscord discord,
     App application,
     IPageNavigator navigator,
     ISettingsService settingsService,
     IDialogService dialogService)
     : base(api, gameService, eventService, discord, application, settingsService, navigator, dialogService)
 {
     MapNames = new [] { "All" }
     .Concat(ZResource.GetBF3MapNames())
     .ToArray();
     GameModeNames = new [] { "All" }
     .Concat(ZResource.GetBF3GameModeNames())
     .ToArray();
 }
        public HomeViewModel(
            IEventService eventService,
            IGameService gameService,
            ISettingsService settingsService,
            IZApi api,
            IBusyIndicatorService busyIndicatorService,
            IDiscord discord,
            IPageNavigator navigator,
            IApplicationState state,
            IDialogService dialogService)
        {
            _navigator = navigator;
            _state     = state;
            _discord   = discord;

            _eventService         = eventService;
            _gameService          = gameService;
            _settingsService      = settingsService;
            _api                  = api;
            _busyIndicatorService = busyIndicatorService;
            _dialogService        = dialogService;
        }