private void OnPropertyMarkerCommandsEditResourceCommand(object sender, ExecutedRoutedEventArgs eventArgs) { SceneNodeProperty associatedProperty = this.AssociatedProperty; if (associatedProperty != null) { using (WorkaroundPopup.LockOpen((DependencyObject)this)) associatedProperty.DoEditResource(); } eventArgs.Handled = true; }
private void OnAddItem(object sender, EventArgs e) { if (this.editingValue == null) { return; } SceneNodeProperty sceneNodeProperty = this.editingProperty as SceneNodeProperty; if (sceneNodeProperty == null) { return; } SceneNodeObjectSet sceneNodeObjectSet = sceneNodeProperty.SceneNodeObjectSet; if (sceneNodeObjectSet == null) { return; } CommandTarget commandTarget = sceneNodeObjectSet.DesignerContext.ProjectManager as CommandTarget; if (commandTarget == null) { return; } string commandName = "Project_AddExistingItemOfType"; IProject currentProject = this.GetCurrentProject(); if (currentProject == null) { return; } IDocumentType[] documentTypeArray = this.GetSupportedDocumentTypesFromSelection(); if (documentTypeArray == UriEditor.multiScaleDocuments) { List <IDocumentType> list = Enumerable.ToList <IDocumentType>((IEnumerable <IDocumentType>)documentTypeArray); list.Remove(sceneNodeObjectSet.DesignerContext.DocumentTypeManager.DocumentTypes[DocumentTypeNamesHelper.DeepZoom]); documentTypeArray = list.ToArray(); } commandTarget.SetCommandProperty(commandName, "DocumentTypes", (object)documentTypeArray); commandTarget.SetCommandProperty(commandName, "Project", (object)currentProject); commandTarget.SetCommandProperty(commandName, "SelectAddedItems", (object)false); commandTarget.SetCommandProperty(commandName, "TargetFolder", (object)Microsoft.Expression.Framework.Documents.PathHelper.GetDirectory(sceneNodeObjectSet.ViewModel.Document.DocumentReference.Path)); commandTarget.SetCommandProperty(commandName, "TemporarilyStopProjectPaneActivation", (object)true); using (WorkaroundPopup.LockOpen((DependencyObject)this)) commandTarget.Execute(commandName, CommandInvocationSource.Palette); IProjectItem projectItem = EnumerableExtensions.SingleOrNull <IProjectItem>((IEnumerable <IProjectItem>)commandTarget.GetCommandProperty(commandName, "AddedProjectItems")); if (projectItem == null) { return; } this.ProjectItemSource = new ProjectItemModel(projectItem, this.DocumentContext, 0); }
private void OnPropertyMarkerCommandsCustomExpressionCommand(object sender, ExecutedRoutedEventArgs eventArgs) { SceneNodeProperty associatedProperty = this.AssociatedProperty; if (associatedProperty != null) { using (WorkaroundPopup.LockOpen((DependencyObject)this)) { associatedProperty.DoEditCustomExpression((FrameworkElement)this); PropertyMarker.ResetPropertyContainerMode((RoutedEventArgs)eventArgs); } } eventArgs.Handled = true; }
private void OnPropertyMarkerCommandsTemplateBindingCommand(object sender, ExecutedRoutedEventArgs eventArgs) { SceneNodeProperty associatedProperty = this.AssociatedProperty; if (associatedProperty != null) { using (WorkaroundPopup.LockOpen((DependencyObject)this)) { associatedProperty.DoSetToTemplateBinding((TemplateBindablePropertyModel)eventArgs.Parameter); PropertyMarker.ResetPropertyContainerMode((RoutedEventArgs)eventArgs); } } eventArgs.Handled = true; }
private void OnPropertyMarkerCommandsClearValueCommand(object sender, ExecutedRoutedEventArgs eventArgs) { SceneNodeProperty associatedProperty = this.AssociatedProperty; if (associatedProperty != null) { using (WorkaroundPopup.LockOpen((DependencyObject)this)) { associatedProperty.DoClearValue(); PropertyMarker.ResetPropertyContainerMode((RoutedEventArgs)eventArgs); } } eventArgs.Handled = true; }