The de facto standard for dealing with that kind of separation would probably be something like MVVM.
But the logic has to go somewhere in the end. Me, I’d be satisfied just creating a new class inheriting from my root window class and putting all the logic in there, which is essentially how something like winforms or UWP would do it. Further separation could be handled through an intermediary layer. The VM in MVVM.