private void mi_libraryView_copy_Click(object sender, RoutedEventArgs e) { if (lv_resourceList.SelectedIndex >= 0) { hasChangedSinceSave = true; StarpointResource selected = lv_resourceList.SelectedItem as StarpointResource; library.AddResource(new StarpointResource(selected.name, selected.weight)); } Update(); }
public void AddResource(StarpointResource resource) { resources.Add(resource); resource.library = this; }