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(); } }
void OnPacienteShellShowing(SwitchShellData data) { switch (data[Infrastructure.Defaults.SwitchShellIdPaciente].ToString()) { case "1": this.FullName = "JOSÉ LUIS CANDIA FIGUEROA"; this.Info = "RUT: 16617164-4 BOX: 45"; break; case "2": this.FullName = "JUAN LUIS PEREZ PEREIRA"; this.Info = "RUT: 15656723-5 BOX: 33"; break; default: break; } }