Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WPF弹出窗口中的子菜单项_Wpf_Wpf Controls - Fatal编程技术网

WPF弹出窗口中的子菜单项

WPF弹出窗口中的子菜单项,wpf,wpf-controls,Wpf,Wpf Controls,我已经在XAML的弹出窗口中创建了菜单项。该菜单项包含子菜单项。单击切换按钮时弹出窗口打开。我无法打开弹出菜单中菜单项的子菜单项 $ 请帮我解决这个问题。将菜单项包装在菜单中,它就会工作 <ToggleButton Name="button" Width="30" Height="30" Click="Button_Click"> <Image Wid

我已经在XAML的弹出窗口中创建了菜单项。该菜单项包含子菜单项。单击切换按钮时弹出窗口打开。我无法打开弹出菜单中菜单项的子菜单项

$



请帮我解决这个问题。

菜单项
包装在
菜单中,它就会工作

<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>