Hy all.
I have a XamDockManager with a TabGroupPane in which I add in code ContentPanes. For this ContentPanes I would like to disable the contextmenu (it has Floating, Dockable, Tabbed Document, Auto hide and Hide) that appears when you right click on the tab.
I know there for Floating there is AllowFloatingOnly property and for Dockable there is AllowDocking, but for the others? Is there a way to disable it completely? For me it's important to disable the Hide, is it possible?
Thanks very much.
Nico
You have a couple of options. As you noticed, you can use the properties to remove some of the items - e.g. AllowClose will be used to determine if the Hide/Close option will be included. You could also handle the PaneOptionsMenuOpening event and clear the items of the event args.
Thanks very much. This was really helpful.
I clear the menuitems and add my own events:
e.Items.Clear();
menuItem.CommandParameter = cp;
menuItem.CommandTarget = cp;
e.Items.Add(menuItem);
Hi... is their any way that we can do it in xaml.I have these style but also not working.
<Style TargetType="{x:Type igDm:ContentPane}"> <Setter Property="Background" Value="#F1F2F4" /> <Setter Property="FontFamily" Value="Segoe UI" /> <Setter Property="CloseButtonVisibility" Value="Collapsed" /> <Setter Property="PinButtonVisibility" Value="Collapsed" /> <Setter Property="WindowPositionMenuVisibility" Value="Collapsed"/> <Setter Property="BorderThickness" Value="0" />
</style> and also
<Style TargetType="{x:Type igDm:PaneHeaderPresenter}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderThickness" Value="0" /> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDm:ContentPane}},Path=IsPinned}" Value="True"> <Setter Property="Background" Value="#F1F2F4" /> <Setter Property="BorderThickness" Value="0" /> </DataTrigger> </Style.Triggers> </Style>
Hello,
I believe that the approach Nico used cannot be used in XAML, since there are methods that are called, which you cannot do in XAML. If I think of a different workaround for the same functionality I will let you know.