I've been needing a simialr feature where I am undocking and floating a ToolWindow to the size of my TabbedMdiContainer, and then the ability to redock.
I ran into a few issues with identifying the state myself.
I can't remember what states I was looking at but, probaly looked at them all but I believe the ToolWindowContainer.State stated it was docked, even though it was floating. So that was no use use to me.
My next thought was to have a simple bool attached property. I was using this with triggers to update the value but when you floated, the state of the attached property was lost transitioning between dock to float, in that the docked version had the changed state but the floating did not.
What I have now (that admitidely feels rather dirty) is to modify the default style by adding in a number of RoutedEventTrigger's that I then InvokeCommandAction to my ViewModel where I simply flip a bool when the command comes in, and I have a number of bindings based of my property to determine what state it is in.
And even then it isn't exactly what I need...
[Modified 6 years ago]