Why do my WPF UIElements NOT have OnPreview events?
Posted
by Matt.M
on Stack Overflow
See other posts from Stack Overflow
or by Matt.M
Published on 2010-04-27T16:40:57Z
Indexed on
2010/04/27
16:43 UTC
Read the original article
Hit count: 244
I'm building a custom Silverlight UserControl which needs to listen to events using Preview/Tunneling, but for some reason the compiler is telling me they are not recognized or accessible.
For example, I can add an event handler to MouseLeftButtonDown, but not PreviewMouseLeftButtonDown. This doesn't make sense because according to Microsoft (http://msdn.microsoft.com/en-us/library/system.windows.uielement_members(v=VS.100).aspx) all UIElements should have Preview events attached.
Any ideas as to why this is happening? I'm using Visual Studio 2010 Trial, Blend 4 RC and .Net 4, if that makes a difference.
© Stack Overflow or respective owner