Share on Facebook
I added a "skin" to my silverlight admin tool and all of a sudden the
buttons aren't bubbling the click events anymore.
What's up with that? I don't know enough about how this new stuff works to be able to say where I went wrong. So, I resort to my tried and true troubleshooting habits.
What Changed from when it was working to now?
I tried removing the mousovers from the app.xaml style definition, it did nothing
I tried removing the style definition from the button xaml.
That - wasn't it either.
So, what else did I add when I added the style definition?
Load WinMerge to see what the differences are between the two .xaml files. (when it worked. and NOW)
The differences (besides the style):
-
I added a LinearGradientBrush.
-
I added a Rectangle in order right after LayoutRoot and before all original Canvas members.
-
I adjusted the margin of StackPanel members in the forms.
-
I changed the background color of the StackPanel members.
-
I removed two borders that were around an image.
-
I added an image.
This is my thought process:
The situation is Start button works. End button doesn't.
What happens after you click the Start Button?
The cursor changes to a pencil and the user is able to click around on the image to draw a polygon for a USERMAP.
What DID?
It's not the StaticResource.
It's not the LinearGradientBrush
It's not the Rectangle.
I changed the order of the buttons. made them TOP priority. Just put the button on top and it doesn't matter anymore.
Why did that fix my problem? Because I had moved the pencil to top order for it to be able to remain over the image as the cursor. And that image which was my pencil had it's own click event to draw the polygon. Apparently events from an image don't bubble.
But I wonder still, what did steal my button's Click event? I thought they were all supposed to Bubble. OK. Back to the books.
And, We're golden. Working like a charm.
Now, a whole month later, I know that this was my custom cursor image, and I wrote about the creation of that custom cursor at this URL: http://www.faxt.com/blog/post/Silverlight-Custom-Cursor.aspx