Example #1
0
 private void ShowChildWindowDialog(ChildWindowMessage param) {
   switch (param.Action) {
     case DialogAction.Open:
       _CurrentCWDialog = param;
       if (param.ModelInstance.GetType() == typeof(ClientCourse)) {
         AdmCourseWindow dw = new AdmCourseWindow();
         ((IBaseCWViewModel<ClientCourse>)dw.DataContext).SetInstance(param.ModelInstance as ClientCourse);
         dw.ShowDialog();
       }
       else if (param.ModelInstance.GetType() == typeof(ClientTopic)) {
         AdmTopicWindow dw = new AdmTopicWindow();
         ((IBaseCWViewModel<ClientTopic>)dw.DataContext).SetInstance(param.ModelInstance as ClientTopic);
         dw.ShowDialog();
       }
       else if (param.ModelInstance.GetType() == typeof(List<TestDetails>)) {
         TestDetailsWindow dw = new TestDetailsWindow();
         ((IBaseCWViewModel<List<TestDetails>>)dw.DataContext).SetInstance(param.ModelInstance as List<TestDetails>);
         dw.ShowDialog();
       }
       break;
     case DialogAction.Close:
       if (App.Current.Windows.Count > 1) {
         App.Current.Windows[1].Close();
       }
       if (_CurrentCWDialog != null) {
         _CurrentCWDialog.ExecuteAfterClose();
         _CurrentCWDialog = null;
       }
       break;
     default:
       break;
   }
 }
Example #2
0
        private async Task ShowDetails()
        {
            FlowDocument doc = new FlowDocument();
            Paragraph    p   = new Paragraph(new Run(this.Details));

            p.FontSize = 16;
            doc.Blocks.Add(p);
            TestDetailsWindow win = new TestDetailsWindow();

            win.Viewer.Document = doc;
            win.ShowDialog();
        }