请教为啥运行结果弹不出菜单内容
请问为啥运行结果弹不出菜单内容
<Window x:Class="BdmsPlatform.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Name="frmMainWindow" Height="600" Width="800">
<Grid Name="grdMain">
<Grid.RowDefinitions>
<RowDefinition Name="grdRow0" Height="30"></RowDefinition>
<RowDefinition Name="grdRow1" Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Menu HorizontalAlignment="Right" Name="menuMain"
Height="{Binding ElementName=grdRow0, Path=Height}"
Grid.Row="0" Grid.Column="0"
Width="{Binding ElementName=frmMainWindow, Path=Width}"
Margin="0,0,-8,0"
>
<Menu.ItemTemplate>
<DataTemplate>
<MenuItem ItemsSource="{Binding Path=Items}" Height="{Binding ElementName=menuMain,Path=Height}" FontSize="15"
Header="{Binding Path=Title}">
<MenuItem.ItemTemplate>
<DataTemplate>
<MenuItem Height="{Binding ElementName=menuMain,Path=Height}" FontSize="15"
Header="{Binding Path=Title}">
</MenuItem>
</DataTemplate>
</MenuItem.ItemTemplate>
</MenuItem>
</DataTemplate>
</Menu.ItemTemplate>
</Menu>
</Grid>
</Window>
public partial class MainWindow : Window
{
// public BdmsInterface.MenuItem[] menus { get; set; }
public MainWindow()
{
InitializeComponent();
BdmsInterface.MenuItem[] menus = new BdmsInterface.MenuItem[]{
new BdmsInterface.MenuItem("系统","S"),
new BdmsInterface. MenuItem("项目","X"),
new BdmsInterface.MenuItem("工具","T")
};
menus[0].Items.Add(new BdmsInterface.MenuItem("退出", "X"));
this.menuMain.ItemsSource = menus;