Beispiel #1
0
        public MainWindowViewModel(IMtTranslationOptions options, IProviderControlViewModel providerControlViewModel,
                                   ISettingsControlViewModel settingsControlViewModel,
                                   ITranslationProviderCredentialStore credentialStore, LanguagePair[] languagePairs, HtmlUtil htmlUtil)
        {
            Options = options;
            _providerControlViewModel = providerControlViewModel;
            _settingsControlViewModel = settingsControlViewModel;
            _credentialStore          = credentialStore;
            _languagePairs            = languagePairs;
            _htmlUtil = htmlUtil;

            SaveCommand             = new RelayCommand(Save);
            ShowSettingsViewCommand = new CommandHandler(ShowSettingsPage, true);
            ShowMainViewCommand     = new CommandHandler(ShowProvidersPage, true);

            providerControlViewModel.ShowSettingsCommand   = ShowSettingsViewCommand;
            providerControlViewModel.ClearMessageRaised   += ClearMessageRaised;
            settingsControlViewModel.ShowMainWindowCommand = ShowMainViewCommand;

            AvailableViews = new List <ViewDetails>
            {
                new ViewDetails
                {
                    Name      = PluginResources.PluginsView,
                    ViewModel = providerControlViewModel.ViewModel
                },
                new ViewDetails
                {
                    Name      = PluginResources.SettingsView,
                    ViewModel = settingsControlViewModel.ViewModel
                }
            };

            ShowProvidersPage();
        }
Beispiel #2
0
        public MainWindowViewModel(IMtTranslationOptions options, ISettingsControlViewModel settingsControlViewModel, bool isTellMeAction)
        {
            Options                   = options;
            _isTellMeAction           = isTellMeAction;
            _settingsControlViewModel = settingsControlViewModel;
            SaveCommand               = new RelayCommand(Save);

            AvailableViews = new List <ViewDetails>
            {
                new ViewDetails
                {
                    Name      = PluginResources.SettingsView,
                    ViewModel = settingsControlViewModel.ViewModel
                }
            };

            if (_isTellMeAction)
            {
                SelectedView = AvailableViews[0];
            }
        }