//------------------------------------------- private void MenuAdd_Click(object sender, RoutedEventArgs e) { var win = new AddEditWin() { Owner = this }; if (win.ShowDialog() == true) { this.Goods.Add(win.laptop); } }
//------------------------------------------- private void MenuEdit_Click(object sender, RoutedEventArgs e) { int num = lbItems.SelectedIndex; var item = Goods[num]; var win = new AddEditWin(item) { Owner = this }; if (win.ShowDialog() == true) { Goods[num] = win.laptop; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.AddEditWindows = ((MaxiAzLaptops.AddEditWin)(target)); return; case 2: this.tbName = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.tbOS = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.tbRAM = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.tbHDD = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.tbScrSize = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.tbVebCam = ((System.Windows.Controls.TextBox)(target)); return; case 8: this.tbOldP = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.tbNewP = ((System.Windows.Controls.TextBox)(target)); return; case 10: this.tbImagePath = ((System.Windows.Controls.TextBox)(target)); return; case 11: #line 109 "..\..\AddEditWin.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ButtonOpen_Click); #line default #line hidden return; case 12: #line 122 "..\..\AddEditWin.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ButtonOk_Click); #line default #line hidden return; case 13: #line 123 "..\..\AddEditWin.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ButtonCancel_Click); #line default #line hidden return; } this._contentLoaded = true; }