我在 XAML 的弹出窗口中创建了 MenuItems。该菜单项包含子菜单项。单击切换按钮时打开弹出窗口。我无法在弹出窗口中打开 MenuItem 的子 MenuItem。
$
<ToggleButton Name="button"
Width="30"
Height="30"
Click="Button_Click">
<Image Width="30" Height="30">
<Image.Source>
<BitmapImage UriSource="/WpfApplication4;component/Images/Filter.png" />
</Image.Source>
</Image>
</ToggleButton>
<Popup Name="PART_Popup"
Placement="Bottom"
PlacementTarget="{Binding ElementName=button}">
<Border Background="White"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Orientation="Vertical">
<MenuItem Width="270"
Margin="5"
Header="ClearFilter">
<MenuItem.Icon>
<Image>
<Image.Source>
<BitmapImage UriSource="/WpfApplication4;component/Images/ClearFilter.png" />
</Image.Source>
</Image>
</MenuItem.Icon>
<MenuItem Header="SubMenu" />
<MenuItem Header="SubMenu1" />
</MenuItem>
</StackPanel>
</Border>
</Popup>
请帮我解决这个问题。