// Event nhấn chuột private void Btn_MouseDown(object sender, MouseButtonEventArgs e) { KButton btn = e.Source as KButton; //Nếu nhấn chuột phải thì xử lý if (e.ChangedButton == MouseButton.Right) { KienHang k = btn.getKienHang(); // Nếu tồn tại kiện hàng if (k.getWidth() != 0) { // PopUp cho phép sửa kiện hàng PopUp p = new PopUp(btn.getKienHang(), btn, khoHang, (bool)isOnline); if (p != null) { p.kichThuocEdit.Visibility = Visibility.Collapsed; p.Show(); } } // Nếu không tồn tại kiện hàng else { // PopUp cho phép thêm kiện hàng PopUp p = new PopUp(btn.getKienHang(), btn, khoHang, (bool)isOnline); if (p != null) { p.kichThuoc.Visibility = Visibility.Collapsed; p.delete.Visibility = Visibility.Collapsed; p.Show(); } } } else { } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Information = ((ObjectMovingUI.PopUp)(target)); return; case 2: this.textBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.textBlock_Copy = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.ngay = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.textBlock_Copy1 = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.maKien = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.textBlock_Copy2 = ((System.Windows.Controls.TextBlock)(target)); return; case 8: this.donGia = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.textBlock_Copy3 = ((System.Windows.Controls.TextBlock)(target)); return; case 10: this.thang = ((System.Windows.Controls.TextBox)(target)); return; case 11: this.textBlock_Copy4 = ((System.Windows.Controls.TextBlock)(target)); return; case 12: this.nam = ((System.Windows.Controls.TextBox)(target)); return; case 13: this.save = ((System.Windows.Controls.Button)(target)); #line 25 "..\..\AddWindow.xaml" this.save.Click += new System.Windows.RoutedEventHandler(this.save_Click); #line default #line hidden return; case 14: this.cancel = ((System.Windows.Controls.Button)(target)); #line 26 "..\..\AddWindow.xaml" this.cancel.Click += new System.Windows.RoutedEventHandler(this.cancel_Click); #line default #line hidden return; case 15: this.kichThuoc = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }