How to bind ItemSource to UXNavigationPane

4 replies. Last post: June 1, 2011 6:36 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
xu guochunMember

I want to bind itemsource to UXNavigationPane ,because the navigation items are from the database.

Here is my code:

(1)View (Xaml)

 <Intersoft:UXNavigationPane x:Name="OutlookMenuPane" Header=""  IsExpanded="{Binding IsExpanded, ElementName=MainPane}"
                                      VisibleItemCount="10" AutoSelectFirstItem="True" Background="#FFEBEFF3" FooterVisibility="Collapsed"
            ItemsSource="{Binding NavItems}" DisplayMemberPath="Text" ImageMemberPath="Icon" CollectionMemberPath="SubItems">

 

(2)ViewModel

Note:Module is a entity class mapping to the navigation item table in the database.

  foreach (Module nm in mRet)
            {
               mi.Add(new MenuItem()
                {
                    Text=nm.MoudleMenuName==""?nm.ModuleName:nm.MoudleMenuName,
                    Icon="Images/"+nm.SmallIconAddress,
                    NavUri=nm.ModuleUrl,
                    ModuleCode=nm.ModuleCode,
                    SubItems = this.GetThisLevelMenuItem(nLevel + 1, nm.ModuleCode)

                });            
            }

 

But i  can only see an empty UXNavigationPane.Can you give me some advice? 

All times are GMT -5. The time now is 10:36 PM.
Previous Next