Disabling "Pin Tab" from context menu

SyntaxEditor for Windows Forms Forum

Posted 5 years ago by John Goy
Version: 18.1.0674
Avatar

I have a document window that has a context menu item of "Pin Tab" that I'd like to remove.

I can disable or remove everything else from this context menu, but no matter what I try, all I seem to be able to do is effect the Pin icon on the tab of the document.

This is a selection of what I'm doing. I'm trying with these lines <docking:TabbedMdiHost HasTabPinButtons="False" HasTabCloseButtons="True">
<docking:AdvancedTabItem CanPin="False" /> to get things the way I need as this is the closest I think I have to the answer. But bar building my own context menu and pointing my solution at that. I'm not getting anywhere.

<DockPanel Grid.Row="1" Grid.Column="2">
          <core:ViewInjectionDockSite x:Name="dockSite"  Background="#EBEBEB"
                    DocumentItemsSource="{Binding DockPanel.OpenDocuments}"
                    DocumentItemContainerStyle="{StaticResource DocumentItemStyle}"
                    ToolItemsSource="{Binding DockPanel.OpenTools}"
                    ToolItemContainerStyle="{StaticResource ToolItemStyle}"
                    CanDocumentWindowsFloat="true"
                    AreDocumentWindowsDestroyedOnClose="True"
                    core:DockSiteViewModelBehavior.EventAggregator="{Binding EventAggregator}"
                    core:DockSiteViewModelBehavior.WindowManager="{Binding WindowManager}"
                    core:DockSiteViewModelBehavior.ActiveDocument="{Binding DockPanel.ActiveDocument, Mode=TwoWay}"
                    core:DockSiteViewModelBehavior.ActiveTool="{Binding DockPanel.ActiveTool, Mode=TwoWay}"
                    core:DockSiteViewModelBehavior.IsManaged="True">
            <docking:SplitContainer>
              <docking:SplitContainer>
                <docking:SplitContainer Orientation="Vertical">
                  <!-- LEFT TOOL UPPER -->
                  <docking:ToolWindowContainer x:Name="LEFT_UPPER_TOOLS">
                    </docking:ToolWindowContainer>
                  <!-- LEFT TOOL LOWER-->
                  <docking:ToolWindowContainer x:Name="LEFT_LOWER_TOOLS" >
                  </docking:ToolWindowContainer>
                </docking:SplitContainer>
                <docking:Workspace >
                  <docking:TabbedMdiHost HasTabPinButtons="False" HasTabCloseButtons="True">
                    <docking:AdvancedTabItem CanPin="False" />
                  </docking:TabbedMdiHost>
                </docking:Workspace>
              </docking:SplitContainer>
              <docking:SplitContainer Orientation="Vertical">
                <!--RIGHT TOOL UPPER-->
                <docking:ToolWindowContainer x:Name="RIGHT_UPPER_TOOLS">
                </docking:ToolWindowContainer>
                <!--RIGHT TOOL LOWER-->
                <docking:ToolWindowContainer x:Name="RIGHT_LOWER_TOOLS">
                </docking:ToolWindowContainer>
              </docking:SplitContainer>
            </docking:SplitContainer>
          </core:ViewInjectionDockSite>
        </DockPanel>

Comments (1)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I believe the TabbedMdiHost.HasTabPinButtons property as false will effectively set the AdvancedTabItem.CanPin property to false.

To remove the menu item, you'd need to handle the DockSite.MenuOpening event and look at each MenuItem in the e.Menu for one with the Command == dockingWindow.SetTabbedMdiLayoutKindCommand, where the e.Window is the dockingWindow.  Then you could remove that menu item from the menu and still use the rest of the default menu as-is.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.