Exemplo n.º 1
0
        //-------------------------------------------
        private void MenuAdd_Click(object sender, RoutedEventArgs e)
        {
            var win = new AddEditWin()
            {
                Owner = this
            };

            if (win.ShowDialog() == true)
            {
                this.Goods.Add(win.laptop);
            }
        }
Exemplo n.º 2
0
        //-------------------------------------------
        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;
            }
        }