using System.Drawing; using System.Windows.Controls; using TeamAAS_VP.ViewModels.Product; namespace TeamAAS_VP.Views.Product { /// /// Interaction logic for CalculateOffsetU /// public partial class CalculateOffsetU : UserControl { CalculateOffsetUViewModel VM; public CalculateOffsetU() { InitializeComponent(); VM=DataContext as CalculateOffsetUViewModel; VM.PropertyChanged += VM_PropertyChanged; this.display.HorizontalScrollBar = false; this.display.VerticalScrollBar = 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 == "Robot") { this.robotManual.Robot = VM.Robot; } else 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) { } } } }