In most of these cases I have my WPF user controls binding to commands on my
view models and passing the UserControl or Window they're in as a parameter
(via FindAncestor).
I have a couple of utility methods that the view models can then call to set
the owner for a given Window based on whatever i
Matt, did you ever find a way of getting the WPF Window for a WPF control
hosted inside a parent Form? Sorry, it was the reverse of what I had in
mind.
In my earlier Apps that were hybrids like yours I was lazy and avoided the
problem by having the WPF children send a message to the parent Form
Thanks Greg, but the problem isn't getting the Window, I've got WPF user
controls hosted on a Form (i.e. WinForms) and I can get the Form that's
hosting the controls but I can't pass that as an owner to the WPF version of
MessageBox.Show().
I'm using a Form instead of a Window simply because the F
Sorry for the late reply,
I've had to popup MessageBox displays from various WPF components and
stumbled across a similar problem. You can ask for:
Window.GetWindow(DependencyObject foo);
So the argument can be a UserControl. Otherwise I use this property:
Application.Current.MainWi