/// <summary>
 /// Initializes a new instance of the <see cref="OptionsControlViewModel" /> class.
 /// </summary>
 /// <param name="modService">The mod service.</param>
 /// <param name="positionSettingsService">The position settings service.</param>
 /// <param name="externalEditorService">The external editor service.</param>
 /// <param name="idGenerator">The identifier generator.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="notificationAction">The notification action.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="updater">The updater.</param>
 /// <param name="updaterService">The updater service.</param>
 /// <param name="gameService">The game service.</param>
 /// <param name="fileDialogAction">The file dialog action.</param>
 public OptionsControlViewModel(IModService modService, INotificationPositionSettingsService positionSettingsService,
                                IExternalEditorService externalEditorService, IIDGenerator idGenerator, ILogger logger,
                                INotificationAction notificationAction, ILocalizationManager localizationManager, IUpdater updater,
                                IUpdaterService updaterService, IGameService gameService, IFileDialogAction fileDialogAction)
 {
     this.positionSettingsService = positionSettingsService;
     this.gameService             = gameService;
     this.fileDialogAction        = fileDialogAction;
     this.updaterService          = updaterService;
     this.updater             = updater;
     this.localizationManager = localizationManager;
     this.notificationAction  = notificationAction;
     this.logger                = logger;
     this.idGenerator           = idGenerator;
     this.externalEditorService = externalEditorService;
     this.modService            = modService;
     LeftMargin      = new Thickness(20, 0, 0, 0);
     LeftChildMargin = new Thickness(20, 10, 0, 0);
 }
Example #2
0
        /// <summary>
        /// Gets the manager.
        /// </summary>
        /// <returns>IManagedNotificationManager.</returns>
        public IManagedNotificationManager GetManager()
        {
            if (manager is WindowNotificationManager windowNotificationManager)
            {
                if (positionSettingsService == null)
                {
                    positionSettingsService = DIResolver.Get <INotificationPositionSettingsService>();
                }
                var selected = positionSettingsService.Get().FirstOrDefault(p => p.IsSelected);
                if (selected != null)
                {
                    switch (selected.Type)
                    {
                    case Models.Common.NotificationPosition.BottomRight:
                        windowNotificationManager.Position = NotificationPosition.BottomRight;
                        break;

                    case Models.Common.NotificationPosition.BottomLeft:
                        windowNotificationManager.Position = NotificationPosition.BottomLeft;
                        break;

                    case Models.Common.NotificationPosition.TopRight:
                        windowNotificationManager.Position = NotificationPosition.TopRight;
                        break;

                    case Models.Common.NotificationPosition.TopLeft:
                        windowNotificationManager.Position = NotificationPosition.TopLeft;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(manager);
        }