views:

73

answers:

2

in silverlight project using name attribute in planeprojection gives Error 1 The type or namespace name 'PlaneProjection' could not be found (are you missing a using directive or an assembly reference?)

code i used for that

<Image Name="blabla.jpg" Height="200" Width="200" >
    <Image.Projection>
       <PlaneProjection Name="pp" />
    </Image.Projection>
</Image>
A: 

It is a strange error in that it appears to be complaining about the PlaneProjection itself but that could be a red-herring.

The xaml is not correct because the PlaneProjection does not have a Name property. However you should be able to x:Name. My guess is you are trying to ensure you have a field called pp that you can manipulator in code. You can now use pp as a field in code or find the PlaneProjection using FindName on the control.

This is what I think your Xaml should look like:-

<Image x:Name="MyImage" Source="blabla.jpg" Height="200" Width="200" > 
    <Image.Projection> 
       <PlaneProjection x:Name="pp" /> 
    </Image.Projection> 
</Image> 

TBH, I would simply access the projection as MyImage.Projection rather than add an x:Name to it.

AnthonyWJones
A: 

Thanks Anthony for response, but during my c# code behind xaml did not find .Projection attribute through intelli-sense. MyImage.Projection has red herring in c# code. Is there any any media.dll file that i missed to add in reference. some part of the code is as follow

< Canvas x:Name="Page" Background="White" Width="165" Height="150" Visibility="Collapsed" Grid.Row="0" >

        < Canvas.Projection>
            <PlaneProjection x:Name="pp" CenterOfRotationX="0" />
        < /Canvas.Projection>
        < Image Source="genie.png" Width="15" Height="150" Stretch="Fill" />
        < Image x:Name="Moving_img" Canvas.Left="15" Width="150" Height="150" Stretch="Fill"  >
            < Image.Projection>
                < PlaneProjection x:Name="ppMoving" />
            < /Image.Projection>
        < /Image>
    < /Canvas>
vishal