Ejemplo n.º 1
0
        public static void InvokeContextMenu(UIElement scopeElement, ISelectionSet <SceneElement> selection, SceneViewModel sceneViewModel, Point contextMenuPosition, ContextMenuHelper.ContextMenuType menuType)
        {
            switch (menuType)
            {
            case ContextMenuHelper.ContextMenuType.PrimaryContextMenu:
                ContextMenuHelper.InvokeContextMenu(scopeElement, selection, sceneViewModel, contextMenuPosition);
                break;

            case ContextMenuHelper.ContextMenuType.SelectionContextMenu:
                ContextMenuHelper.InvokeSelectionContextMenu(scopeElement, sceneViewModel, contextMenuPosition);
                break;
            }
        }
Ejemplo n.º 2
0
        private static void InvokeContextMenu(UIElement scopeElement, ISelectionSet <SceneElement> selection, SceneViewModel sceneViewModel, Point contextMenuPosition)
        {
            PerformanceUtility.StartPerformanceSequence(PerformanceEvent.ContextMenuRender, "SceneElement Context Menu");
            ContextMenu contextMenu = ContextMenuHelper.CreateContextMenu(selection, sceneViewModel, true);

            if (contextMenu != null)
            {
                ContextMenuHelper.contextMenuIsOpenDescriptor.AddValueChanged((object)contextMenu, new EventHandler(ContextMenuHelper.ResetContextMenuPropertiesOnClosing));
                contextMenu.Opened += new RoutedEventHandler(ContextMenuHelper.TurnOffPopupAnimationOnOpened);
                contextMenu.Opened += new RoutedEventHandler(ContextMenuHelper.ContextMenu_Opened);
                contextMenu.Closed += new RoutedEventHandler(ContextMenuHelper.ContextMenu_Closed);
            }
            ContextMenuHelper.InvokeContextMenu(scopeElement, contextMenuPosition, contextMenu);
        }
Ejemplo n.º 3
0
        private static void InvokeSelectionContextMenu(UIElement scopeElement, SceneViewModel sceneViewModel, Point contextMenuPosition)
        {
            ContextMenu selectionContextMenu = ContextMenuHelper.CreateSelectionContextMenu(sceneViewModel);

            ContextMenuHelper.InvokeContextMenu(scopeElement, contextMenuPosition, selectionContextMenu);
        }