/// <summary>
        /// Creates an instance of <see cref="MonstersViewModel"/>
        /// </summary>
        public MonstersViewModel(Compendium compendium, MonsterSearchService monsterSearchService, MonsterSearchInput monsterSearchInput,
                                 StringService stringService, DialogService dialogService, XMLImporter xmlImporter, XMLExporter xmlExporter, DocumentService documentService)
        {
            _compendium           = compendium;
            _monsterSearchService = monsterSearchService;
            _monsterSearchInput   = monsterSearchInput;
            _stringService        = stringService;
            _dialogService        = dialogService;
            _xmlImporter          = xmlImporter;
            _xmlExporter          = xmlExporter;
            _documentService      = documentService;

            _selectMonsterCommand     = new RelayCommand(obj => true, obj => SelectMonster(obj as MonsterListItemViewModel));
            _editMonsterCommand       = new RelayCommand(obj => true, obj => EditMonster(obj as MonsterViewModel));
            _exportMonsterCommand     = new RelayCommand(obj => true, obj => ExportMonster(obj as MonsterViewModel));
            _cancelEditMonsterCommand = new RelayCommand(obj => true, obj => CancelEditMonster());
            _saveEditMonsterCommand   = new RelayCommand(obj => HasUnsavedChanges, obj => SaveEditMonster());
            _resetFiltersCommand      = new RelayCommand(obj => true, obj => InitializeSearch());
            _addCommand            = new RelayCommand(obj => true, obj => Add());
            _copyCommand           = new RelayCommand(obj => _selectedMonster != null, obj => Copy());
            _deleteCommand         = new RelayCommand(obj => _selectedMonster != null, obj => Delete());
            _importCommand         = new RelayCommand(obj => true, obj => Import());
            _selectNextCommand     = new RelayCommand(obj => true, obj => SelectNext());
            _selectPreviousCommand = new RelayCommand(obj => true, obj => SelectPrevious());

            Search();
        }
Example #2
0
        /// <summary>
        /// Creates an instance of <see cref="MonsterSearchViewModel"/>
        /// </summary>
        public MonsterSearchViewModel(Compendium compendium, MonsterSearchService monsterSearchService, MonsterSearchInput monsterSearchInput,
                                      StringService stringService, DialogService dialogService)
        {
            _compendium           = compendium;
            _monsterSearchService = monsterSearchService;
            _monsterSearchInput   = monsterSearchInput;
            _stringService        = stringService;
            _dialogService        = dialogService;

            _selectMonsterCommand = new RelayCommand(obj => true, obj => SelectMonster(obj as MonsterListItemViewModel));
            _resetFiltersCommand  = new RelayCommand(obj => true, obj => InitializeSearch());
            _acceptCommand        = new RelayCommand(obj => true, obj => OnAccept());
            _rejectCommand        = new RelayCommand(obj => true, obj => OnReject());

            Search();
        }