Search code examples
wpfxamlwpf-controlsmenu-items

The type 'p:PieMenu' AND 'p:PieMenuItem': was not found. Verify that you are not missing an assembly reference


I try to work with a circular menu but I'm getting this error despite following a tutorial:

those are the errors that I get: enter image description here

and this is my code:

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

when I try to run the code this is the error I get:

enter image description here

this is the Assemly project informations

enter image description here thanks for help


Solution

  • Try to declare p prefix this way :

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

    I assumed that PieMenu and PieMenuItem are declared in namespace : GMAO.PieMenu. And you don't have to specify the assembly name if it is from the same assembly/project.