0

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

Loktar
  • 34,764
  • 7
  • 90
  • 104
Lina
  • 451
  • 1
  • 8
  • 23
  • I need help pleaze can you help me :'( – Lina Jun 28 '14 at 05:56
  • do please check if the element in context are available in assembly GMAO and are public and derives from UIElement. is is possible for you to share the GMAO assembly? so we can have a look – pushpraj Jun 28 '14 at 06:03
  • I have edited my question pushpraj :( – Lina Jun 28 '14 at 06:32
  • What is the namespace of your `PieMenu.cs` class? – har07 Jun 28 '14 at 07:06
  • are these usercontrols in the GMAO project? if not then you are missing the reference to the assembly containing the actual controls i.e. PieMenu. if these controls are available then even `xmlns:p="clr-namespace:GMAO"` should work. if still does not work then would it be possible for you to post a copy of your project, you may remove any sensitive information. – pushpraj Jun 28 '14 at 07:56
  • @har07 the namespac of PieMenu.c is GMAO ,ok pushpraj I will try – Lina Jun 28 '14 at 08:13

1 Answers1

1

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.

har07
  • 88,338
  • 12
  • 84
  • 137
  • thanks har07 but I get a new error after clr-namespace it should take a namespace and PieMenu is not a namespace :/ – Lina Jun 28 '14 at 07:35
  • 1
    thanks guys I just rebuild and clean the project and now it works thanks a lot for help @har07 and pushpraj :D – Lina Jun 28 '14 at 08:18