using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using TeamAAS_VP.ViewModels.Calibration; namespace TeamAAS_VP.Views.Calibration { /// /// CalibTool.xaml 的交互逻辑 /// public partial class CalibTool : UserControl { CalibToolViewModel VM; public CalibTool() { InitializeComponent(); VM = DataContext as CalibToolViewModel; 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 (Exception) { } } } }