Hi,
I would like to show a different header for the RadPane based on where it is docked, I came up with this:
So based on if FindAncestor finds a DocumentHost (or crashes) it will set the visibility.
Although it works, it is a bit hacked and fragile. The reason it works (I think) is that FindAncestor will fail when DocumentHost is not found and the internal error recovery of Silverlight will ignore the error and keep the default Visibility which is Visible and if the pane is invisible I don't care if it works or not because it wont be visible anyway. So all in all it sort of works, but not in a nice way.
Is there a better way to do this?
Regards,
Bayram
I would like to show a different header for the RadPane based on where it is docked, I came up with this:
<
conv:NullToVisibilityConverter
x:Key
=
"NullToVisibilityConverterInverse"
Inverse
=
"True"
/>
<
conv:NotVisibilityConverter
x:Key
=
"NotVisibilityConverter"
/>
<
DataTemplate
x:Key
=
"CockpitPaneHeaderTemplate"
>
<
Grid
>
<
Image
Source
=
"/PowerBrowser;component/Modules/Images/OutlookBar/Cockpit.png"
Width
=
"16"
Height
=
"16"
x:Name
=
"CockputImage"
Visibility="{Binding RelativeSource={RelativeSource
Mode
=
FindAncestor
,
AncestorType
=
telerik
:DocumentHost},
Converter={StaticResource NullToVisibilityConverterInverse}}" />
<
TextBlock
Text
=
"{Binding}"
Visibility
=
"{Binding ElementName=CockputImage, Path=Visibility, Converter={StaticResource NotVisibilityConverter}}"
/>
</
Grid
>
</
DataTemplate
>
So based on if FindAncestor finds a DocumentHost (or crashes) it will set the visibility.
Although it works, it is a bit hacked and fragile. The reason it works (I think) is that FindAncestor will fail when DocumentHost is not found and the internal error recovery of Silverlight will ignore the error and keep the default Visibility which is Visible and if the pane is invisible I don't care if it works or not because it wont be visible anyway. So all in all it sort of works, but not in a nice way.
Is there a better way to do this?
Regards,
Bayram