Reputation: 12274
If I have a Windows Forms control like this:
System.Windows.Forms.Button button = new System.Windows.Forms.Button()
{
Width = 1000,
Height = 1000
};
Host.Child = button;
And I subscribe to events like this:
PreviewStylusDown="Window_PreviewStylusDown"
PreviewStylusUp="Window_PreviewStylusUp"
PreviewTouchDown="Window_PreviewTouchDown"
PreviewTouchUp="Window_PreviewTouchUp"
I thought surely my WPF window should receive the events. And yet when the button is touched, the events are never raised.
How can the Winforms control absorb a preview event like PreviewTouchDown? If it's a preview, doesn't that mean it's raised in the tunneling phase? Doesn't that mean the window should receive the event before it ever reaches the WindowsFormsHost? Just what is going on here?
Upvotes: 0
Views: 402
Reputation: 12993
From the book Pro WPF 4.5 in C#: Windows Presentation Foundation in .NET 4.5
Upvotes: 2