コード例 #1
0
 private void EditItemsMenuItem_Click(object sender, RoutedEventArgs e)
 {
     if (smartphonesListBox.SelectedItem != null)
     {
         var  editWindow = new EditSelectedItems((Smartphone)smartphonesListBox.SelectedItem);
         bool?result     = editWindow.ShowDialog();
         //if(result==true)
         //  smartphonesListBox.
     }
 }
コード例 #2
0
        private void AddMenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            var  sp         = new Smartphone("", "");
            var  editWindow = new EditSelectedItems(sp);
            bool?result     = editWindow.ShowDialog();

            if (result == true)
            {
                _smartphones.Add(sp);
            }
        }