i tried out the following answer:
https://stackoverflow.com/a/16947081/2111258
I have gotten the code to work, but I dont understand how the slider in the dockpanel has the ScaleFactor property bound. Using breakpoints i found out that its bound to the MainWindow's ViewModel object.
How does the bind definition "{Binding ScaleFactor}" bind it to the property of a completely different object belonging to the MainWindow?