类型' p:PieMenu' AND' p:PieMenuItem':未找到。验证您没有错过程序集引用

时间:2014-06-28 03:30:10

标签: wpf xaml wpf-controls menu-items

我尝试使用循环菜单,但是尽管遵循了教程,我仍然收到此错误:

这些是我得到的错误: enter image description here

这是我的代码:

<Window x:Class="GMAO.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:p="clr-namespace:GMAO;assembly=GMAO"
        Title="MatserCom GMAO" Height="479" Width="792" Background="#9DB9EB" >
        <StackPanel Height="331" HorizontalAlignment="Left" Margin="160,56,0,0" Name="stackPanel2" VerticalAlignment="Top" Width="452">
            <Canvas Background="Black">
                <p:PieMenu x:Name="Menu1"  //I have error at this line with p:PieMenu>
                    <p:PieMenuItem Header="Item 1"> //I have error with all lignes that begin with p:PieMenuItem
                        <p:PieMenuItem Header="Item 1.1" Click="PieMenuItem_Click"/>
                        <p:PieMenuItem Header="Item 1.2" Command="NotACommand"/>
                    </p:PieMenuItem>
                    <p:PieMenuItem Header="Item 2">
                        <p:PieMenuItem Header="Item 2.1" />
                    </p:PieMenuItem>
                    <p:PieMenuItem Header="Item 3">
                        <p:PieMenuItem Header="Item 3.1" />
                    </p:PieMenuItem>
                </p:PieMenu>
            </Canvas>
        </StackPanel>

当我尝试运行代码时,这是我得到的错误:

enter image description here

这是Assemly项目信息

enter image description here 谢谢你的帮助

1 个答案:

答案 0 :(得分:1)

尝试以这种方式声明p前缀:

xmlns:p="clr-namespace:GMAO.PieMenu"

我假设PieMenuPieMenuItem在命名空间中声明:GMAO.PieMenu。如果它来自同一个程序集/项目,则不必指定程序集名称。

相关问题