Exemplo n.º 1
0
        protected override Window CreateShell()
        {
            var win = ServiceLocator.Current.GetInstance <MainView>();

            EventHandler addSelection = null;

            addSelection = new EventHandler((o, args) =>
            {
                //Adds the patient selection UI on main window
                var currentContent           = (UIElement)win.Content;
                var stackPanel               = new DockPanel();
                stackPanel.VerticalAlignment = VerticalAlignment.Stretch;
                win.Content                  = stackPanel;
                var selectPat                = new SelectPatient();
                var selectPatContent         = (FrameworkElement)selectPat.Content;
                selectPatContent.DataContext = selectPat;
                selectPat.Content            = null;
                stackPanel.Children.Add(selectPatContent);
                stackPanel.Children.Add(currentContent);
                DockPanel.SetDock(selectPatContent, Dock.Top);
                DockPanel.SetDock(currentContent, Dock.Top);
                win.WindowState      = WindowState.Maximized;
                win.Content          = stackPanel;
                win.ContentRendered -= addSelection;
            });

            if (IsPatientSelectionEnabled)
            {
                win.ContentRendered += addSelection;
            }
            return(win);
        }
Exemplo n.º 2
0
 private void SelectButton_Click(object sender, EventArgs e)
 {
     if (StaffListView.SelectedItems.Count != 0)
     {
         SelectPatient p1 = new SelectPatient();
         p1.ShowDialog();
     }
 }
Exemplo n.º 3
0
 void MainWindow_ContentRendered(object sender, EventArgs e)
 {
     if (this.Content is Frame)
     {
         var frame      = this.Content as Frame;
         var stackPanel = new StackPanel();
         this.Content = stackPanel;
         var selectPat        = new SelectPatient();
         var selectPatContent = (FrameworkElement)selectPat.Content;
         selectPatContent.DataContext = selectPat;
         selectPat.Content            = null;
         stackPanel.Children.Add(selectPatContent);
         stackPanel.Children.Add(frame);
         this.Content = stackPanel;
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// This method will hijack the main window and place a patient selction toolbox
 /// overlaid in the application
 /// </summary>
 /// <param name="shell"></param>
 protected void OnContentRendered(Window shell)
 {
     if (shell != null && IsPatientSelectionEnabled)
     {
         var sac            = _ctx as StandAloneContext;
         var currentContent = (UIElement)shell.Content;
         var stackPanel     = new DockPanel();
         stackPanel.VerticalAlignment = VerticalAlignment.Stretch;
         shell.Content = stackPanel;
         var selectPat        = new SelectPatient();
         var selectPatContent = (FrameworkElement)selectPat.Content;
         selectPatContent.DataContext = selectPat;
         selectPat.Content            = null;
         stackPanel.Children.Add(selectPatContent);
         stackPanel.Children.Add(currentContent);
         DockPanel.SetDock(selectPatContent, Dock.Top);
         DockPanel.SetDock(currentContent, Dock.Top);
         shell.WindowState = WindowState.Maximized;
         shell.Content     = stackPanel;
     }
 }
Exemplo n.º 5
0
        /// <summary>
        ///     This method hijacks the application and injects a patient selector to mimick the script context of a normal plugin
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void shell_ContentRendered(object sender, EventArgs e)
        {
            var shell = sender as Window;

            if (shell != null)
            {
                var currentContent = (UIElement)shell.Content;
                var stackPanel     = new DockPanel();
                stackPanel.VerticalAlignment = VerticalAlignment.Stretch;
                shell.Content = stackPanel;
                var selectPat        = new SelectPatient(_ctx);
                var selectPatContent = (FrameworkElement)selectPat.Content;
                selectPatContent.DataContext = selectPat;
                selectPat.Content            = null;
                stackPanel.Children.Add(selectPatContent);
                stackPanel.Children.Add(currentContent);
                DockPanel.SetDock(selectPatContent, Dock.Top);
                DockPanel.SetDock(currentContent, Dock.Top);
                shell.Content          = stackPanel;
                shell.ContentRendered -= shell_ContentRendered;
            }
        }
Exemplo n.º 6
0
 public void Search(string patient)
 {
     PatientTextBox.SendKeys(patient);
     SelectPatient.Click();
 }