public InjectionConfigurationViewModelFactory( DomainActionBuilder actionBuilder, ComponentViewModelFactory componentViewModelFactory, IFindFirstLaunchTimeQuery findFirstLaunchTimeQuery, IFindGamePackageByIdQuery findGamePackageByIdQuery, IFindGamesQuery findGamesQuery, IFindLastEditedGamePackageQuery findLastEditedGamePackageQuery, IDirectoryPicker directoryPicker, IEqualityComparer <ProxySettings> stateEqualityComparer, IEventPublisher eventPublisher, IFilePicker filePicker, IPluginFactory pluginFactory, INavigationService navigationService, ITaskRunner runner) { _actionBuilder = actionBuilder; _componentViewModelFactory = componentViewModelFactory; _findFirstLaunchTimeQuery = findFirstLaunchTimeQuery; _findGamePackageByIdQuery = findGamePackageByIdQuery; _findGamesQuery = findGamesQuery; _findLastEditedGamePackageQuery = findLastEditedGamePackageQuery; _directoryPicker = directoryPicker; _stateEqualityComparer = stateEqualityComparer; _eventPublisher = eventPublisher; _filePicker = filePicker; _pluginFactory = pluginFactory; _navigationService = navigationService; _runner = runner; }
public InjectionConfigurationViewModel( DomainActionBuilder actionBuilder, ComponentViewModelFactory componentViewModelFactory, IFindFirstLaunchTimeQuery findFirstLaunchTimeQuery, IFindGamePackageByIdQuery findGamePackageByIdQuery, IFindGamesQuery findGamesQuery, IFindLastEditedGamePackageQuery findLastEditedGamePackageQuery, IDirectoryPicker directoryPicker, IEqualityComparer <ProxySettings> stateEqualityComparer, IEventPublisher publisher, IFilePicker filePicker, IPluginFactory pluginFactory, INavigationService navigationService, IProcessable processable, ITaskRunner runner) { _actionBuilder = actionBuilder; _componentViewModelFactory = componentViewModelFactory; _findFirstLaunchTimeQuery = findFirstLaunchTimeQuery; _findGamePackageByIdQuery = findGamePackageByIdQuery; _findGamesQuery = findGamesQuery; _findLastEditedGamePackageQuery = findLastEditedGamePackageQuery; _directoryPicker = directoryPicker; _stateEqualityComparer = stateEqualityComparer; _publisher = publisher; _filePicker = filePicker; _pluginFactory = pluginFactory; _navigationService = navigationService; _processable = processable; _runner = runner; _publisher.Register <ApplicationActionEvent>(this); _publisher.Register <ApplicationMinimizedEvent>(this); _publisher.Register <ApplicationRestoredEvent>(this); ActionCommand = new ActionCommand(() => _queue.QueueTask(ExecuteActionAsync), IsActionEnabled); ActivationState = new StateViewModel(_runner); AddGameProfileCommand = new ActionCommand(() => _queue.QueueTask(AddGameProfileAsync), () => true); ChangedCommand = new ActionCommand(async() => await UpdateGameProfileAsync(), () => true); ClearGameFilePathCommand = new ActionCommand(async() => await ClearApplicationFilePathAsync(), () => !GameFilePath.IsNullOrEmpty()); EditGameProfileCommand = new ActionCommand(() => _queue.QueueAction(EditPluginMainSettings), () => true); MoveToGameFilePathCommand = new ActionCommand(MoveToApplicationPath, () => !GameFilePath.IsNullOrEmpty()); MoveToConfigurationDirectoryPathCommand = new ActionCommand(MoveToConfigurationDirectoryPath, () => !GameFilePath.IsNullOrEmpty()); MoveToLogsDirectoryPathCommand = new ActionCommand(MoveToLogsDirectoryPath, () => !GameFilePath.IsNullOrEmpty()); SwitchModeCommand = new ActionCommand(async() => await SwapModeAsync(), () => true); PickGameFilePathCommand = new ActionCommand(async() => await PickApplicationFilePathAsync(), () => true); PickPluginSettingsEditViewCommand = new GenericActionCommand <IComponentViewModel>(EditPluginComponent, () => true); RemoveGameProfileCommand = new ActionCommand(async() => await RemoveGameProfileAsync(), () => _package?.Game.Profiles.Count > 1); RenameGameProfileCommand = new ActionCommand(async() => await RenameGameProfileAsync(), () => true); ValidationTriggeredCommand = new GenericActionCommand <ValidationResultEventArgs>(eventArgs => _queue.QueueAction(Validate), () => true); }
public PluginEffectViewModel( IEffect effect, PluginViewModel viewModel, ComponentViewModelFactory componentViewModelFactory) { _effect = effect; _viewModel = viewModel; Component = componentViewModelFactory.Create(_effect.Component); Component.Changed += OnPropertyChanged; MoveDownCommand = new ActionCommand(async() => await MoveDownAsync(), () => true); MoveUpCommand = new ActionCommand(async() => await MoveUpAsync(), () => true); RemoveCommand = new ActionCommand(async() => await RemoveAsync(), () => true); }
public PluginViewModel( IPluginDataAccessLayer dataAccessLayer, IEventPublisher publisher, INavigationService navigationService, ComponentViewModelFactory componentViewModelFactory) { _dataAccessLayer = dataAccessLayer; _publisher = publisher; _componentViewModelFactory = componentViewModelFactory; _component = _dataAccessLayer.CreateComponent(); _navigationService = navigationService; _elements = new ObservableCollection <PluginElementViewModel>(_component.Elements.Select(CreatePluginElementViewModel)); _effects = new ObservableCollection <PluginEffectViewModel>(_component.Effects.Select(CreatePluginEffectViewModel)); AddCommand = new ActionCommand(async() => await AddEffectAsync(), () => true); }