【发布时间】:2013-12-24 17:16:29
【问题描述】:
我正在尝试使用 vb.net 将列表绑定到 WPF 中的菜单。 我试过的是。 在 xaml 设计中:
<Window x:Class="content"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="content" Height="850" Width="725" WindowStartupLocation="CenterScreen" WindowState="Maximized" >
<Grid>
<Menu Name="menu_wpf" > </Menu>
</Grid>
</Window>
在后面的代码中:
Private Sub content_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim lst_menu As List(Of wpf_appBAL)
Using BAL As New wpf_appBAL
lst_company = BAL.fill_menu(BAL)
menu_wpf.ItemsSource = lst_company
menu_wpf.DisplayMemberPath = "Quantity"
End Using
End Sub
它正确显示菜单..
现在我需要在菜单中添加子菜单 - 我该如何实现?请帮帮我..
【问题讨论】: