public void OnSelectedApplicationChanged( ApplicationViewModel oldApp, ApplicationViewModel newApp ) { _lastSelectedAppGuid = newApp.Guid; CurrentPlugins = new PluginOverviewViewModel( _applicationPlugins[ newApp ] ); CurrentPlugins.ConfiguringPluginEvent += ( sender, args ) => ConfiguringPluginEvent( sender, args ); }
// If state is not provided no filter is used. void FilterApps( PluginState state = 0 ) { _applicationPlugins.Clear(); CurrentPlugins = null; _pluginManifest.Application.ForEach( manifestApplication => { var appPlugins = _pluginManifest.GivePlugins( new Guid( manifestApplication.Guid ), state ).ToList(); var application = new ApplicationViewModel( manifestApplication, appPlugins ); if ( appPlugins.Count > 0 ) { _applicationPlugins.Add( application, appPlugins ); } } ); Applications = new ObservableCollection<ApplicationViewModel>( _applicationPlugins.Keys.OrderBy( model => model.Name ) ); // Focus an application that was selected in a previous view. if ( _applicationPlugins.Any() ) { var lastSelectedApp = _applicationPlugins.Keys.FirstOrDefault( key => key.Guid == _lastSelectedAppGuid ); SelectedApplication = lastSelectedApp ?? _applicationPlugins.First().Key; } }
public void OnSelectedApplicationChanged(ApplicationViewModel oldApp, ApplicationViewModel newApp) { _lastSelectedAppGuid = newApp.Guid; CurrentPlugins = new PluginOverviewViewModel(_applicationPlugins[newApp]); CurrentPlugins.ConfiguringPluginEvent += (sender, args) => ConfiguringPluginEvent(sender, args); }