private void CreateWidgets() { ConfigService.Load(); Application.Current.Dispatcher.Invoke(() => { this.notificationsWidget = new NotificationsWidget(); this.comboMeterWidget = new ComboMeterWidget(); Overlay.RegisterWidget(this.notificationsWidget); Overlay.RegisterWidget(this.comboMeterWidget); }); }
private void DestroyWidgets() { Application.Current.Dispatcher.Invoke(() => { Overlay.UnregisterWidget(comboMeterWidget); Overlay.UnregisterWidget(notificationsWidget); this.comboMeterWidget.Close(); this.notificationsWidget.Close(); this.comboMeterWidget = null; this.notificationsWidget = null; }); }