private void dgDecals_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (dgDecals.SelectedItem is UnitDecal) { UnitDecal binDecal = (UnitDecal)dgDecals.SelectedItem; /*if (binDecal.ModelRepresentation is ModelVisual3D) * { * manipulator.Bind(binDecal.ModelRepresentation); * contentHolder.Content = binDecal; * }*/ } }
private void viewPort_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Delete) { //Delete the selected item from the list (if any) if (tabProps.IsSelected) { UnitBinDrawSlot selectedItem = dgProps.SelectedItem as UnitBinDrawSlot; viewPort.Children.Remove(selectedItem.ModelRepresentation); foreach (ObservableList <UnitBinDrawSlot> slotList in UnitFileEntry.UnitBinDrawSlots) { slotList.Remove(selectedItem); } } if (tabEffects.IsSelected) { UnitEffect selectedItem = dgEffects.SelectedItem as UnitEffect; viewPort.Children.Remove(selectedItem.ModelRepresentation); UnitFileEntry.UnitEffects.Remove(selectedItem); } if (tabLights.IsSelected) { UnitLight selectedItem = lbLights.SelectedItem as UnitLight; viewPort.Children.Remove(selectedItem.ModelRepresentation); UnitFileEntry.UnitLights.Remove(selectedItem); } if (tabDecals.IsSelected) { UnitDecal selectedItem = dgDecals.SelectedItem as UnitDecal; viewPort.Children.Remove(selectedItem.ModelRepresentation); foreach (ObservableList <UnitDecal> slotList in UnitFileEntry.UnitBinDecals) { slotList.Remove(selectedItem); } } } }