PlcPointParams.xaml.cs 965 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Windows.Controls;
  2. using TeamAAS_VP.ViewModels.Product;
  3. namespace TeamAAS_VP.Views.Product
  4. {
  5. /// <summary>
  6. /// Interaction logic for PlcPointParams
  7. /// </summary>
  8. public partial class PlcPointParams : UserControl
  9. {
  10. PlcPointParamsViewModel VM;
  11. public PlcPointParams()
  12. {
  13. InitializeComponent();
  14. VM = DataContext as PlcPointParamsViewModel;
  15. VM.PropertyChanged += VM_PropertyChanged;
  16. this.display.HorizontalScrollBar = false;
  17. this.display.VerticalScrollBar = false;
  18. this.display.AutoFit = true;
  19. this.display.BackColor = System.Drawing.SystemColors.ActiveCaption;
  20. }
  21. private void VM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
  22. {
  23. if (e.PropertyName == "Image")
  24. {
  25. this.display.Image = VM.Image;
  26. }
  27. }
  28. }
  29. }