This is a mirror of official site: http://jasper-net.blogspot.com/

Expression Blend: I made a copy of a UserControl and now it throws an error

| Wednesday, January 25, 2012
Don’t you hate it when you are going to do a simple thing like copy a UserControl and then it doesn’t work?  Seriously, how can you steal other peoples work if you have to redo all of their code.

Well first of all, make sure you tell others about the work that you are using, and if the artist or creator asks that you pay for the work, then pay for it or don’t use it.

Now down to business, why can’t you just make a copy of a UserControl and put it to use right way?

Simple, the code behind can’t determined which XAML it is suppose to use:

Now I just copied Christine’s Dancing heart project and was going to break it, I did when I simply copied the user control.  My code behind looked like this:

0638.image_5F00_thumb_5F00_68151363.png

The red squiggly lines mean that something is wrong, and the error seems kind of stupid, but it is unambiguous in it’s statement of ambiguity.

You now have two of these in your program, the line x:Class=”DancingHeart.DancingImage” is repeated twice, once in the copy of the UserControl and once in the original copy.

Read more: Secret Microsoft Communications
QR: expression-blend-i-made-a-copy-of-a-usercontrol-and-now-it-throws-an-error.aspx

Posted via email from Jasper-net

0 comments: