async void UnLoadComponents(object parameter) { var pluginLoader = AppServiceLocator.GetService <IPluginLoader <IAppComponent> >(); await pluginLoader.Unload(); Components = new List <string>(); this.RaisePropertyChanged(nameof(Components)); }
void UnLoadComponents(object parameter) { var pluginLoader = AppServiceLocator.GetService <IPluginLoader>(); pluginLoader.UnloadAll(); CurrentControl = null; Components = new List <string>(); this.RaisePropertyChanged(nameof(CurrentControl)); this.RaisePropertyChanged(nameof(Components)); }
// GET: api/Initial public UserProfile Get() { UserProfile result = new UserProfile(); var temp = AppServiceLocator.GetService <IRepairAttr>(); return(result); }
async void LoadComponents(object parameter) { var pluginLoader = AppServiceLocator.GetService <IPluginLoader <IAppComponent> >(); var plugins = await pluginLoader.LoadAll(); components = new Dictionary <string, IAppComponent>(); foreach (var plugin in plugins) { components.Add(plugin.GetName(), plugin); } Components = new List <string>(components.Select(p => p.Key)); this.RaisePropertyChanged(nameof(Components)); }
async void LoadComponents(object parameter) { var pluginLoader = AppServiceLocator.GetService <IPluginLoader>(); var dist = GetPathToComponentsPublishDirectory(); var pluginScanResults = await pluginLoader.FindPlugins <IAppComponent>(dist); components = new Dictionary <string, IAppComponent>(); foreach (var pluginScanResult in pluginScanResults) { var plugin = await pluginLoader.LoadPlugin <IAppComponent>(pluginScanResult, configure : (ctx) => { ctx .AddHostTypes(new[] { typeof(Application) }) ; }); components.Add(plugin.GetName(), plugin); } Components = new List <string>(components.Select(p => p.Key)); this.RaisePropertyChanged(nameof(Components)); }
private void InitializeComponent() { AvaloniaXamlLoader.Load(this); this.DataContext = AppServiceLocator.GetService <MainWindowViewModel>(); }