11,578 questions
I'm not really sure I understand what you need. See if it looks something like this (not final code, just a demo of concept):
public void DoSomething(Window _this)
{
_this.Closing += OnWindowClosing;
}
private void OnWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
((Window)sender).Top = 0;
}