private void SwitchShell(SwitchShellData data) { Window shell = null; IEventAggregator eventAggregator = this.Container.GetExportedValue <IEventAggregator>(); switch (data.Shell) { case Infrastructure.ShellType.ProfesionalShell: shell = this.Container.GetExportedValue <Views.ProfesionalShell>(); break; case Infrastructure.ShellType.PacienteShell: shell = this.Container.GetExportedValue <Views.PacienteShell>(); PacienteShellShowingEvent pacienteShellShowingEvent = eventAggregator.GetEvent <PacienteShellShowingEvent>(); pacienteShellShowingEvent.Publish(data); break; default: break; } if (shell != null) { Application app = Application.Current; for (int intCounter = app.Windows.Count - 1; intCounter >= 0; intCounter--) { app.Windows[intCounter].Hide(); } shell.Show(); } }
public void OnImportsSatisfied() { PacienteShellShowingEvent pacienteShellShowingEvent = shellNavigationHelper.PacienteShellShowingEvent; pacienteShellShowingEvent.Subscribe(OnPacienteShellShowing, Microsoft.Practices.Prism.Events.ThreadOption.UIThread, false); }
public ShellNavigationHelper(IEventAggregator eventAggregator) { this.switchShellEvent = eventAggregator.GetEvent <SwitchShellEvent>(); this.pacienteShellShowingEvent = eventAggregator.GetEvent <PacienteShellShowingEvent>(); }