/// <summary> /// Initializes a new instance of the <see cref="AssetCompositeHierarchyEditorViewModel{TAssetPartDesign,TAssetPart,TItemViewModel}"/> class. /// </summary> /// <param name="asset">The asset related to this editor.</param> /// <param name="controllerFactory">A factory to create the associated <see cref="IEditorGameController"/>.</param> protected AssetCompositeHierarchyEditorViewModel([NotNull] AssetCompositeHierarchyViewModel <TAssetPartDesign, TAssetPart> asset, [NotNull] Func <GameEditorViewModel, IEditorGameController> controllerFactory) : base(asset, controllerFactory) { CopyCommand = new AnonymousCommand(ServiceProvider, Copy, CanCopy); CutCommand = new AnonymousCommand(ServiceProvider, Cut, CanCut); DeleteCommand = new AnonymousTaskCommand(ServiceProvider, Delete, CanDelete); DuplicateSelectionCommand = new AnonymousCommand(ServiceProvider, () => DuplicateSelection()); PasteCommand = new AnonymousTaskCommand <bool>(ServiceProvider, Paste, CanPaste); SelectedContent.CollectionChanged += SelectedContentCollectionChanged; SelectedItems.CollectionChanged += SelectedItemsCollectionChanged; }
/// <inheritdoc/> public override AssetCompositeItemViewModel CreatePartViewModel(AssetCompositeHierarchyViewModel <UIElementDesign, UIElement> asset, UIElementDesign partDesign) { return(UIElementViewModelFactory.Instance.ProvideViewModel(this, (UIBaseViewModel)asset, partDesign)); }