Microsoft has promoted Silverlight as alternative to Flash with similar scripting. But while being a novice on both in Flash I could easily attach an event handler to a shape, in Silverlight it's stunningly difficult ! I cannot even capture a mouse event click on a shape:
Why OnMouseDown handler exists but is not called for an ellipse?
So is there any other difficulties like this in wpf/silverlight ?
I'm studying both to know which one to choose. I have always worked with MS until now. So I would prefer to continue with MS but I'm afraid Silverlight/WPF are ov开发者_高级运维ercomplicated compared to Flash.
Silverlight is NOT similar to Flash. It is, however, similar to Flex, which is an SDK that runs in the Flash/Air runtimes. So, in that regard, they are similar. If you want to compare, you need to compare with Flex.
Here is a series of posts (written by me) comparing Silverlight and Flex feature by feature. They are strikingly similar:
http://houseofbilz.com/archives/2010/10/24/cross-training-in-silverlight-vs-flex/
The handler for an Ellipse (in Silverlight) would be called MouseLeftButtonDown and it works just fine for me on an Ellipse so I'm guessing that you're doing something more than you're saying here?
Mike.
I think your problem might be related to routed events.
精彩评论