コード例 #1
0
        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();
            }
        }
コード例 #2
0
        public void OnImportsSatisfied()
        {
            PacienteShellShowingEvent pacienteShellShowingEvent = shellNavigationHelper.PacienteShellShowingEvent;

            pacienteShellShowingEvent.Subscribe(OnPacienteShellShowing, Microsoft.Practices.Prism.Events.ThreadOption.UIThread, false);
        }
コード例 #3
0
 public ShellNavigationHelper(IEventAggregator eventAggregator)
 {
     this.switchShellEvent          = eventAggregator.GetEvent <SwitchShellEvent>();
     this.pacienteShellShowingEvent = eventAggregator.GetEvent <PacienteShellShowingEvent>();
 }