Beispiel #1
0
        /// <summary>Initializes the PluginDockManagerViewModel.</summary>
        /// <returns>The view model for the PluginDockManager.</returns>
        public PluginDockManagerViewModel InitializePluginDockManagerViewModel()
        {
            PluginDockManagerViewModel viewModel = new PluginDockManagerViewModel(PluginLoader.PluginReader.PluginDirectory);

            PluginModelCollection plugins = PluginLoader.LoadPlugins();

            PluginViewModelCollection pluginViewModels = new PluginViewModelCollection();

            pluginViewModels.AddMany(plugins.Select(p => new PluginViewModel(p, PluginLoader, viewModel)));

            viewModel.Plugins.AddMany(pluginViewModels);

            return(viewModel);
        }
Beispiel #2
0
        /// <summary>Initializes a new instance of the <see cref="PluginDockManagerViewModel"/> class.</summary>
        public PluginDockManagerViewModel(string pluginDirectory)
        {
            /*
             *  When assigning a theme to anything but the default theme there is a caveat. As a user collapses
             *  the side anchorable panels to nothing but their headers, mouses over one, then tries to expand
             *  the anchorable region (by dragging the grid splitter), it throws an InvalidOperationException
             *  [The visual must be connected to a presentation source.]. This would seem to be an issue with
             *  AvalonDock themes. Even if you assign the same generic theme that is the default the error still
             *  occurs.
             */
            //theme = new MetroTheme();

            AnchorablePlugins = new PluginObservableCollection();
            DocumentPlugins   = new PluginObservableCollection();
            PluginDirectory   = pluginDirectory;
            Plugins           = new PluginViewModelCollection();
        }