using System.Windows.Controls; using TeamAAS_VP.ViewModels.Calibration; namespace TeamAAS_VP.Views.Calibration { /// /// Interaction logic for CalibrationVerification /// public partial class CalibrationVerification : UserControl { CalibrationVerificationViewModel VM; public CalibrationVerification() { InitializeComponent(); VM = DataContext as CalibrationVerificationViewModel; VM.PropertyChanged += VM_PropertyChanged; this.display.VerticalScrollBar = false; this.display.HorizontalScrollBar = false; this.display.AutoFit = true; this.display.BackColor = System.Drawing.SystemColors.ActiveCaption; } private void VM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { try { if (e.PropertyName == "Image") { this.display.Image = VM.Image; } else if (e.PropertyName == "Graphic") { this.display.StaticGraphics.Clear(); if (VM.Graphic!=null) { this.display.StaticGraphics.AddList(VM.Graphic, ""); } } } catch (System.Exception) { } } } }