Reputation: 70337
Is there a way to directly get the Window object a control is on?
Upvotes: 1
Views: 549
Reputation: 190
A bit late, but the following works pretty fine for me.
var ownerWindow = Window.GetWindow(yourControl);
Upvotes: 0
Reputation: 2590
Most likely you are on the applications active window in the moment you interact with the control.
So in that case, this other post on stackoverflow could be helpful too:
stackoverflow: get active window(s) in wpf
Upvotes: 1