❔ How to get the main window from a custom control?

I am trying to make a custom top bar instead of wpfs defualt minimize maximize and drag buttons however when i type drag move into my stackpannel mousedown it says it does not exist
maybe there is a way to do something like this
StackPanel stackPanel = sender as StackPanel;
stackPanel.window.DragMove();
Was this page helpful?