protected virtual void OnModuleSelectionChanged(ModuleSelectionChangedEventArgs args) { var handler = ModuleSelectionChangedEvent; if (handler != null) { handler.Invoke(args); } }
private void OnModuleSelectionChanged(ModuleSelectionChangedEventArgs obj) { IModule newModule; newModule = ModuleManager.GetInstance().SwitchToModule(obj.NewModule); if (newModule != null) { textBlock.Text = KioskAppConfig.GetCurrentScrollerText(obj.NewModule.ToLower().Replace("module", string.Empty)); if (KioskAppConfig.ShowScroller) grScroller.Visibility = System.Windows.Visibility.Visible; else grScroller.Visibility = System.Windows.Visibility.Collapsed; currentModule.ModuleSelectionChangedEvent -= OnModuleSelectionChanged; currentModule.ModuleLayoutUpdatedEvent -= OnModuleLayoutUpdated; currentModule.Deactivate(); currentModule = newModule; currentModule.ModuleLayoutUpdatedEvent += OnModuleLayoutUpdated; currentModule.ModuleSelectionChangedEvent += OnModuleSelectionChanged; currentModule.Activate(obj.DispatcherAction); this.BeginInit(); try { this.ccModule.Content = currentModule.ShellGrid; } finally { this.EndInit(); this.UpdateLayout(); } } }