public StartupSettingsViewModel(
     Func<HearthStatsDbContext> dbContext,
     SettingsManager settingsManager,
     UserPreferences userPreferences)
 {
     this.dbContext = dbContext;
     this.settingsManager = settingsManager;
     this.userPreferences = userPreferences;
     this.DisplayName = "Startup settings:";
     this.Order = 2;
 }
 public EngineSettingsViewModel(
     IEventAggregator events,
     ICaptureEngine captureEngine,
     UserPreferences userPreferences)
 {
     _events = events;
     _captureEngine = captureEngine;
     _userPreferences = userPreferences;
     DisplayName = "Engine settings:";
     Speeds = new BindableCollection<SettingModel>(defaultSpeeds);
     Order = 0;
 }
Example #3
0
 public StartupViewModel(
     IEventAggregator events,
     IShell shell,
     TrayIconViewModel trayIcon,
     CustomWindowManager windowManager,
     UserPreferences.UserPreferences userPreferences)
 {
     this.events          = events;
     this.windowManager   = windowManager;
     this.userPreferences = userPreferences;
     this.Shell           = shell;
     this.trayIcon        = trayIcon;
     events.Subscribe(this);
     Shell.Deactivated += ShellOnDeactivated;
 }
Example #4
0
        public ShellViewModel(
            IServiceLocator serviceLocator,
            IDialogManager dialogManager,
            IEventAggregator events,
            Func <HearthStatsDbContext> dbContext,
            [ImportMany] IEnumerable <IFlyout> flyouts,
            [ImportMany] IEnumerable <ITab> tabs,
            [ImportMany] IEnumerable <IWindowCommand> windowCommands,
            [ImportMany] IEnumerable <ICommandBarItem> commandBarItems,
            UpdateViewModel updateViewModel,
            UserPreferences.UserPreferences userPreferences,
            TrayIconViewModel trayIcon,
            SettingsManager settingsManager,
            SupportViewModel supportViewModel)
        {
            this.dialogManager    = dialogManager;
            this.events           = events;
            this.dbContext        = dbContext;
            this.serviceLocator   = serviceLocator;
            this.tabs             = tabs;
            this.updateViewModel  = updateViewModel;
            this.userPreferences  = userPreferences;
            this.trayIcon         = trayIcon;
            this.settingsManager  = settingsManager;
            this.supportViewModel = supportViewModel;
            this.commandBarItems  = new BindableCollection <ICommandBarItem>(commandBarItems.OrderBy(x => x.Order));
            this.windowCommands   = new BindableCollection <IWindowCommand>(windowCommands.OrderByDescending(x => x.Order));
            this.flyouts          = new BindableCollection <IFlyout>(flyouts);

            this.DisplayName = "HearthstoneTracker.com";
            this.events.Subscribe(this);
            this.userPreferences.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "WindowState")
                {
                    WindowState = userPreferences.WindowState;
                }
            };
            this.WindowState      = UserPreferences.WindowState;
            this.PropertyChanged += ShellViewModel_PropertyChanged;
        }