| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System.Windows.Controls;
- using TeamAAS_VP.ViewModels.Product;
- namespace TeamAAS_VP.Views.Product
- {
- /// <summary>
- /// Interaction logic for TestProductPage
- /// </summary>
- public partial class TestProductPage : UserControl
- {
- TestProductPageViewModel VM;
- public TestProductPage()
- {
- InitializeComponent();
- this.display.HorizontalScrollBar = false;
- this.display.VerticalScrollBar = false;
- this.display.AutoFit = true;
- this.display.BackColor = System.Drawing.SystemColors.ActiveCaption;
- this.display1.HorizontalScrollBar = false;
- this.display1.VerticalScrollBar = false;
- this.display1.AutoFit = true;
- this.display1.BackColor = System.Drawing.SystemColors.ActiveCaption;
- VM = DataContext as TestProductPageViewModel;
- VM.PropertyChanged += VM_PropertyChanged;
- }
- 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, "");
- }
- }
- else if (e.PropertyName == "Image1")
- {
- this.display1.Image = VM.Image;
- }
- else if (e.PropertyName == "Graphic1")
- {
- this.display1.StaticGraphics.Clear();
- if (VM.Graphic != null)
- {
- this.display1.StaticGraphics.AddList(VM.Graphic, "");
- }
- }
- }
- catch (System.Exception)
- {
- }
- }
- }
- }
|