I have ViewModel and a View. The View has the RadPanelBar and the bar's ItemSource is a collection of
containers(to handle the hierarchical data template). I'm also binding the SelectedItem to the view model's
CurrentPanelBarContainer. I was expecting the CurrentPanelBarContainer to be the one that is expanded, but
it is not. What's the correct way to get this working?
<telerikNavigation:RadPanelBar
AutomationProperties.AutomationId
=
"zonesPanelBar"
x:Name
=
"zonesPanelBar"
VerticalAlignment
=
"Stretch"
Margin
=
"5"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
ScrollViewer.HorizontalScrollBarVisibility
=
"Hidden"
ItemsSource
=
"{Binding PanelBarZoneContainers}"
SelectedItem
=
"{Binding CurrentPanelBarContainer, Mode=TwoWay}"
IsSingleExpandPath
=
"True"
ExpandMode
=
"Single"
>
<
telerikNavigation:RadPanelBar.ItemTemplate
>
<
telerik:HierarchicalDataTemplate
ItemsSource
=
"{Binding Path=ZonesForTab}"
>
<!-- ZonesForTab are PanelBarZoneContainerViewModel -->
<!-- MouseLeftButtonDown="templateZoneHeaderStackPanel_MouseLeftButtonDown" -->
<
StackPanel
x:Name
=
"templateZoneHeaderStackPanel"
Orientation
=
"Horizontal"
>
<
Border
Visibility
=
"{Binding ZoneExtender.IsRootZone, Converter={StaticResource InverseVisibilityConverter}}"
Background
=
"Black"
Height
=
"17"
Width
=
"17"
BorderThickness
=
"1"
CornerRadius
=
"4"
Margin
=
"3,0,0,0"
>
<
Border.BorderBrush
>
<
LinearGradientBrush
EndPoint
=
"0.5,1"
StartPoint
=
"0.5,0"
>
<
GradientStop
Color
=
"Black"
Offset
=
"0"
/>
<
GradientStop
Color
=
"#FFCCCCCC"
Offset
=
"1"
/>
</
LinearGradientBrush
>
</
Border.BorderBrush
>
<
Border
Background
=
"{Binding ZoneExtender.ColorKey}"
Visibility
=
"Visible"
Margin
=
"2"
CornerRadius
=
"2"
/>
</
Border
>
<
TextBlock
Style
=
"{StaticResource W11ArialTextBlock}"
FontWeight
=
"{Binding ZoneExtender.IsRootZone, Converter={StaticResource BooleanToFontBoldConverter}}"
Text
=
"{Binding ZoneExtender.ZoneName, Mode=TwoWay}"
Margin
=
"6,0,0,0"
/>
</
StackPanel
>
<
telerik:HierarchicalDataTemplate.ItemTemplate
>
<
DataTemplate
>
<
views:ZonePropertiesTabView
/>
</
DataTemplate
>
</
telerik:HierarchicalDataTemplate.ItemTemplate
>
</
telerik:HierarchicalDataTemplate
>
</
telerikNavigation:RadPanelBar.ItemTemplate
>
</
telerikNavigation:RadPanelBar
>