Hi,
You have to define a tree view item as a seperate class. In that class define propertys like header, url and image source. see below code for more understand.
Define a tree view item as class name MenuItem.
Code:
MenuItem Class:
public class MenuItem
{
public string Header { get; set; }
public string Url { get; set; }
public BitmapImage ImageSource { get; set; }
public List<menuitem> SubMenuItems { get; set; }
}
List <menuitem> MenuItems = new List<menuitem>();
MenuItems.Add(
new MenuItem()
{
Header = "Display Name",
Url = "NavigationUrl",
ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri("ur image url from database", UriKind.RelativeOrAbsolute)),
});
tvLeftMenu.ItemsSource = MenuItems;
Thanks
Anil