I don't know if this a bug or not, but here is how to reproduce the behavior.
The xaml:
code behind:
Now run it, click system - logout menu. Then hover on system - maintenance menu, and move the cursor to Unit menu.
FYI, i'm using 2010 Q1 SP1..
The xaml:
<
UserControl
x:Class
=
"TestTelerik.MainPage"
xmlns:compMod
=
"clr-namespace:System.ComponentModel;assembly=System.Windows"
xmlns:telerik
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:telerikNavigation
=
"clr-namespace:Telerik.Windows.Controls assembly=Telerik.Windows.Controls.Navigation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
UserControl.Resources
>
<!-- mainMenu template -->
<
telerik:HierarchicalDataTemplate
x:Key
=
"mainMenuTemplate"
ItemsSource
=
"{Binding SubItems}"
>
<
telerik:ContainerBinding.ContainerBindings
>
<
telerik:ContainerBindingCollection
>
<
telerik:ContainerBinding
PropertyName
=
"Icon"
Binding
=
"{Binding Icon}"
/>
</
telerik:ContainerBindingCollection
>
</
telerik:ContainerBinding.ContainerBindings
>
<
TextBlock
Text
=
"{Binding Text}"
/>
</
telerik:HierarchicalDataTemplate
>
<!-- mainMenu collectionViewSource -->
<
CollectionViewSource
x:Name
=
"mainMenuItemsSource"
>
<
CollectionViewSource.SortDescriptions
>
<
compMod:SortDescription
PropertyName
=
"MenuID"
Direction
=
"Ascending"
/>
</
CollectionViewSource.SortDescriptions
>
</
CollectionViewSource
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerikNavigation:RadMenu
x:Name
=
"mainMenu"
ClickToOpen
=
"False"
ItemTemplate
=
"{StaticResource mainMenuTemplate}"
VerticalAlignment
=
"Top"
Width
=
"Auto"
Grid.Column
=
"0"
Grid.Row
=
"0"
/>
</
Grid
>
</
UserControl
>
code behind:
public
class
MenuItem
{
public
MenuItem()
{
this
.SubItems =
new
ObservableCollection<MenuItem>();
}
public
int
MenuID
{
get
;
set
;
}
public
string
Text
{
get
;
set
;
}
public
Image Icon
{
get
{
return
_icon;
}
}
private
Image _icon;
public
ObservableCollection<MenuItem> SubItems
{
get
;
set
;
}
}
public
partial
class
MainPage : UserControl
{
public
MainPage()
{
StyleManager.ApplicationTheme =
new
Windows7Theme();
InitializeComponent();
LayoutRoot.Loaded +=
new
RoutedEventHandler(LayoutRoot_Loaded);
}
private
void
LayoutRoot_Loaded(
object
sender, RoutedEventArgs e)
{
ObservableCollection<MenuItem> col;
MenuItem manageFormsMenu =
new
MenuItem()
{
MenuID = 100801,
Text =
"Manage Forms"
};
MenuItem getDataMenu =
new
MenuItem()
{
MenuID = 100803,
Text =
"Get Data"
};
col =
new
ObservableCollection<MenuItem>();
col.Add(manageFormsMenu);
col.Add(getDataMenu);
MenuItem maintenanceMenu =
new
MenuItem()
{
MenuID = 100800,
Text =
"Maintenance"
,
SubItems = col
};
MenuItem logoutMenu =
new
MenuItem()
{
MenuID = 100900,
Text =
"Logout"
};
col =
new
ObservableCollection<MenuItem>();
col.Add(maintenanceMenu);
col.Add(logoutMenu);
MenuItem systemMenu =
new
MenuItem()
{
MenuID = 100000,
Text =
"System"
,
SubItems = col
};
MenuItem stockInMenu =
new
MenuItem()
{
MenuID = 110101,
Text =
"Stock In"
};
col =
new
ObservableCollection<MenuItem>();
col.Add(stockInMenu);
MenuItem unitMenu =
new
MenuItem()
{
MenuID = 110000,
Text =
"Unit"
,
SubItems = col
};
col =
new
ObservableCollection<MenuItem>();
col.Add(systemMenu);
col.Add(unitMenu);
mainMenuItemsSource.Source = col;
mainMenu.ItemsSource = mainMenuItemsSource.View;
}
}
Now run it, click system - logout menu. Then hover on system - maintenance menu, and move the cursor to Unit menu.
FYI, i'm using 2010 Q1 SP1..