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.
You can't use an ElementName binding in a style setter and certainly not to something in a different namescope - specifically the editButton name only exists within the datatemplate you're using for the headertemplate. What I would do is to create an attached property - e.g. CloseButtonVisibility. Set that property on the element that is the content (i.e. allow the content to determine when the close button should be visible based on some internal state). On the ContentPane bind the value of that property for the contentpane to the property on the content. Then in the Setter for the Visibility, set it to a binding to the CloseButtonVisibility of the ancestor ContentPane. Something like: