private void AddAttrBtn_Click(object sender, RoutedEventArgs e) { if (sender == null) { return; } if (((FrameworkElement)sender).DataContext is Core.Classes.Weapon wep) { Windows.WepAttrEditor attrEditor = new Windows.WepAttrEditor(new Core.Classes.Weapon.Attribute(wep)); if (attrEditor.ShowDialog() == true) { wep.Attributes.Add(attrEditor.Attribute); } } }
private void EditAttr_Click(object sender, RoutedEventArgs e) { if (sender == null) { return; } if (((FrameworkElement)sender).DataContext is Core.Classes.Weapon.Attribute attr) { Windows.WepAttrEditor attrEditor = new Windows.WepAttrEditor(attr.Clone(attr.Parent)); if (attrEditor.ShowDialog() == true) { attr.Arg = attrEditor.Attribute.Arg; attr.ID = attrEditor.Attribute.ID; attr.Name = attrEditor.Attribute.Name; } } }