Beispiel #1
0
    public MainWindowViewModel(
        IDialogService dialogService,
        IPluginLoader pluginLoader,
        IThemeService themeService,
        IModSelectionViewModel modSelectionViewModel,
        IMainEditorViewModel mainEditorViewModel)
    {
        _themeService = themeService;
        // Initial load of plugins to create cache and alert user of failures
        pluginLoader.LoadPlugins(out var failures);
        if (failures?.AnyFailures == true)
        {
            dialogService.ShowMessageBox(MessageBoxArgs.Ok(
                                             title: "Plugin Load Failures",
                                             message: $"Unable to load some of the plugins, details:\n\n{failures}",
                                             type: MessageBoxType.Warning
                                             ));
        }

        _modSelectionVm      = modSelectionViewModel;
        _mainEditorViewModel = mainEditorViewModel;
        CurrentVm            = _modSelectionVm;

        _modSelectionVm.ModSelected += OnModSelected;

        BackButtonCommand  = new RelayCommand(OnBackButtonPressed);
        ToggleThemeCommand = new RelayCommand(ToggleTheme);
    }
Beispiel #2
0
 public JumpService(IMainEditorViewModel mainEditorViewModel)
 {
     _mainEditor = mainEditorViewModel;
 }