PlaneProjection is not working well in silverlight
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="bla开发者_Python百科bla.jpg" Height="200" Width="200" >
<Image.Projection>
<PlaneProjection Name="pp" />
</Image.Projection>
</Image>
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.
精彩评论