Hi,
Please look the code below.
I want to set the visibility of the close button when visibility of edit button gets changed. Line which is bold does not seems to have working.
Please suggest, also if u can let me know how to deactivate the menu on right click of pane.
<
="Eclipsys.SunriseXA.SIRI.Client.HomeScreen.WidgetPane"
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
="http://infragistics.com/DockManager"
="http://schemas.microsoft.com/winfx/2006/xaml"
="clr-namespace:Eclipsys.SunriseXA.PE.WPFUIControls;assembly=Eclipsys.SunriseXA.PE.WPFUIControls">
>
.CloseButtonStyleKey}">
="ContentTemplate">
="pack://application:,,,/Eclipsys.SunriseXA.SIRI.Client.HomeScreen;component/Images/delete.png"
="closeImage">
="Transparent" />
.PinButtonStyleKey}">
="Collapsed"/>
.PositionMenuItemStyleKey}">
="Right">
="Transparent">
="pack://application:,,,/Eclipsys.SunriseXA.SIRI.Client.HomeScreen;component/Images/edit.png"
="_16x16"/>
</
-Toral.
With regards to the right click menu, the context menu is shown by the PaneHeaderPresenter and PaneTabItem when there is no context menu set for those elements. So you could either provide a style for those elements that sets the context menu to something (or x:Null) or you could handle the ContentPane's OptionsMenuOpening and clear the e.Items collection for that event. If there are no menu items then the menu will not be shown. Note, this event is also used for the PaneToolWindow when right clicking on the caption of the window and for the window position menu but from the snippet you're hiding that anyway.
Should this be as simple as adding
<Setter Property="ContextMenu" Value="{x:Null}"/>
to the PaneHeaderPresenter style?
I've tried this, but to no avail.
We have our own template for the PaneHeaderPresenter style, and I've also tried adding ContextMenu="{x:Null}" to nearly every element in the tree, and the menu still shows up.
Is there some other trick to this?
[Edited to add:] Incidentally, this is within a DocumentContentHost, so there might be more behind-the-scenes menu setup and tweaking going on than I'm aware of...