private void Window_Loaded(object sender, RoutedEventArgs e) { nameLabel.Text = string.Format("{0} {1} {2}", patient.LastName, patient.FirstName, patient.MiddleName); dateLabel.Text = examine.CreatedAt.ToString(); iqrLabel.Text = examine.ElastoExam.IQR.ToString(); medLabel.Text = examine.ElastoExam.Med.ToString(); UpdateSensorLabel(sensorLabel, examine.ElastoExam.SensorType); UpdateIqrMedLabel(iqrMedLabel, examine.ElastoExam.IQR, examine.ElastoExam.Med); scansLabel.Text = examine.ElastoExam.Measures.Count().ToString(); correctScansLabel.Text = examine.ElastoExam.Measures.Where(x => x.IsCorrect).Count().ToString(); measuresPanel.Children.Clear(); foreach (var measure in examine.ElastoExam.Measures) { var preview = new MeasurePreview(); preview.measure = measure; preview.image.Source = ImageFromBase64(measure.Source); UpdateMeasurePreviewStatus(preview, measure); preview.TouchDown += Preview_TouchDown; preview.MouseLeftButtonUp += Preview_MouseLeftButtonUp; measuresPanel.Children.Add(preview); } }
private void UpdateMeasurePreviewStatus(MeasurePreview measurePreview, Measure measure) { var statuses = new List <VerificationStatus> { measure.ValidationElasto, measure.ValidationModeM, measure.ValidationModeA }; var status = statuses.Min(); string statusText; Brush background; switch (status) { case (VerificationStatus.Correct): statusText = "Корректно"; background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFB3FFC9")); break; case (VerificationStatus.Incorrect): statusText = "Некорректно"; background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFB3B3")); break; case (VerificationStatus.Uncertain): statusText = "Неоднозначно"; background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFF4B3")); break; case (VerificationStatus.NotCalculated): default: statusText = "Не вычислено"; background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFB3B3")); break; } measurePreview.status.Content = statusText; measurePreview.status.Background = background; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 8 "..\..\ExamineWindow.xaml" ((Client.ExamineWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: this.backBtn = ((System.Windows.Controls.Button)(target)); #line 10 "..\..\ExamineWindow.xaml" this.backBtn.Click += new System.Windows.RoutedEventHandler(this.backBtn_Click); #line default #line hidden return; case 3: this.measuresPanel = ((System.Windows.Controls.WrapPanel)(target)); return; case 4: this.button = ((Client.MeasurePreview)(target)); return; case 5: this.button2 = ((Client.MeasurePreview)(target)); return; case 6: this.button3 = ((Client.MeasurePreview)(target)); return; case 7: this.button4 = ((Client.MeasurePreview)(target)); return; case 8: this.button5 = ((Client.MeasurePreview)(target)); return; case 9: this.button6 = ((Client.MeasurePreview)(target)); return; case 10: this.button7 = ((Client.MeasurePreview)(target)); return; case 11: this.button8 = ((Client.MeasurePreview)(target)); return; case 12: this.button9 = ((Client.MeasurePreview)(target)); return; case 13: this.button10 = ((Client.MeasurePreview)(target)); return; case 14: this.button11 = ((Client.MeasurePreview)(target)); return; case 15: this.button12 = ((Client.MeasurePreview)(target)); return; case 16: this.button13 = ((Client.MeasurePreview)(target)); return; case 17: this.button14 = ((Client.MeasurePreview)(target)); return; case 18: this.label = ((System.Windows.Controls.TextBlock)(target)); return; case 19: this.sensorLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 20: this.label2 = ((System.Windows.Controls.TextBlock)(target)); return; case 21: this.iqrLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 22: this.label3 = ((System.Windows.Controls.TextBlock)(target)); return; case 23: this.medLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 24: this.label4 = ((System.Windows.Controls.TextBlock)(target)); return; case 25: this.iqrMedLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 26: this.label5 = ((System.Windows.Controls.TextBlock)(target)); return; case 27: this.scansLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 28: this.label6 = ((System.Windows.Controls.TextBlock)(target)); return; case 29: this.correctScansLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 30: this.nameLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 31: this.dateLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 32: this.dispersionBtn = ((System.Windows.Controls.Button)(target)); #line 68 "..\..\ExamineWindow.xaml" this.dispersionBtn.Click += new System.Windows.RoutedEventHandler(this.dispersionBtn_Click); #line default #line hidden return; } this._contentLoaded = true; }