Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Disable the menu on right click of Pane and set the visibility of close button
posted

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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<

 

 

igDock:ContentPane x:Class

="Eclipsys.SunriseXA.SIRI.Client.HomeScreen.WidgetPane"

 

 

xmlns

="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:igDock

="http://infragistics.com/DockManager"

 

 

xmlns:x

="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

xmlns:Eclipsys_SunriseXA_PE_WPFUIControls

="clr-namespace:Eclipsys.SunriseXA.PE.WPFUIControls;assembly=Eclipsys.SunriseXA.PE.WPFUIControls">

 

 

 

<igDock:ContentPane.Resources

>

 

 

 

<Style TargetType="{x:Type Button}" x:Key="{x:Static igDock:PaneHeaderPresenter

.CloseButtonStyleKey}">

 

 

 

<Setter Property

="ContentTemplate">

 

 

 

<Setter.Value

>

 

 

 

<DataTemplate

>

 

 

 

<Eclipsys_SunriseXA_PE_WPFUIControls:EclpImage

 

 

ImagePath

="pack://application:,,,/Eclipsys.SunriseXA.SIRI.Client.HomeScreen;component/Images/delete.png"

 

 

ImageSize="_16x16" x:Name

="closeImage">

 

 

 

</Eclipsys_SunriseXA_PE_WPFUIControls:EclpImage

>

 

 

 

</DataTemplate

>

 

 

 

</Setter.Value

>

 

 

 

</Setter

>

 

 

 

<Setter Property="Background" Value

="Transparent" />

 

 

 

<Setter Property="BorderBrush" Value

="Transparent" />

 

 

 

<Setter Property="Visibility" Value="{Binding ElementName=editButton , Path=Visibility}"></Setter

>

 

 

 

</Style

>

 

 

 

<Style TargetType="{x:Type Button}" x:Key="{x:Static igDock:PaneHeaderPresenter

.PinButtonStyleKey}">

 

 

 

<Setter Property="Visibility" Value

="Collapsed"/>

 

 

 

</Style

>

 

 

 

<Style TargetType="{x:Type MenuItem}" x:Key="{x:Static igDock:PaneHeaderPresenter

.PositionMenuItemStyleKey}">

 

 

 

<Setter Property="Visibility" Value

="Collapsed"/>

 

 

 

</Style

>

 

 

 

</igDock:ContentPane.Resources

>

 

 

 

<igDock:ContentPane.HeaderTemplate

>

 

 

 

<DataTemplate

>

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment

="Right">

 

 

 

<Button x:Name="editButton" Click="editButton_Click" Background="Transparent" BorderBrush

="Transparent">

 

 

 

<Button.Content

>

 

 

 

<Eclipsys_SunriseXA_PE_WPFUIControls:EclpImage

 

 

ImagePath

="pack://application:,,,/Eclipsys.SunriseXA.SIRI.Client.HomeScreen;component/Images/edit.png"

 

 

ImageSize

="_16x16"/>

 

 

 

</Button.Content

>

 

 

 

</Button

>

 

 

 

</StackPanel

>

 

 

 

</DataTemplate

>

 

 

 

</igDock:ContentPane.HeaderTemplate

>

</

 

 

igDock:ContentPane

>

-Toral.

Parents
  • 54937
    Offline posted

    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.

Reply Children