public void CloseWidget(string widgetName, bool AutoRebuildContext = true) { if (!OpenWidgets.ContainsKey(widgetName)) { return; } var data = OpenWidgets[widgetName]; data.Close(); OpenWidgets.Remove(widgetName); if (AutoRebuildContext) { ((App)Application.Current).CreateContextMenu(); } ChangedLoadedWidgets(); }
public void LoadWidget(string widgetName, bool AutoRebuildContext = true) { if (OpenWidgets.ContainsKey(widgetName)) { return; } if (!Widgets.ContainsKey(widgetName)) { Console.WriteLine($"Widget {widgetName} has not been found."); return; } var entry = Widgets[widgetName]; var view = new HTMLWidget(widgetName, true); view.Show(); OpenWidgets.Add(widgetName, view); if (AutoRebuildContext) { ((App)Application.Current).CreateContextMenu(); } ChangedLoadedWidgets(); }