private void ButtonCharactorItemChange_Click(object sender, RoutedEventArgs e) { CharactorItem item = (sender as Button)?.DataContext as CharactorItem; if (item == null) { return; } ItemSelectWindow dlg = new ItemSelectWindow(); dlg.ID = item.ID; dlg.ShowDialog(); item.ID = dlg.ID; }
private void ButtonBagItemChange_Click(object sender, RoutedEventArgs e) { BagItem item = (sender as Button)?.DataContext as BagItem; if (item == null) { return; } ItemSelectWindow dlg = new ItemSelectWindow(); dlg.ID = item.ID; dlg.ShowDialog(); item.ID = dlg.ID; if (item.ID != 0) { item.Count = 1; } }