Hristo,
Thanks for sending me that project. I wasn't thinking clearly before - I understood that it wasn't possible to obtain the DockPosition while a DockWindow was in autohide mode, but I also didn't realize that whenever a user docked a floating window, its DockState would default to 'Docked' rather than 'AutoHide', so I could just grab the DockPosition while the DockWindow was 'Docked'.
I actually submitted the suggested workaround but found that it wouldn't work if a user decided to change the DockPosition of any of the windows :)
Here's the code that I used:
Private
Sub
RadForm1_Load(sender
As
Object
, e
As
EventArgs)
Handles
MyBase
.Load
RadDock1.DockWindow(ToolWindow2, DockPosition.Right)
RadDock1.AutoHideWindows(
New
DockWindow() {ToolWindow2}, AutoHidePosition.Right)
ToolWindow2.Tag = DockPosition.Right
RadDock1.AutoHideWindow(ToolWindow1)
ToolWindow1.Tag = DockPosition.Left
End
Sub
Private
Sub
RadDock1_FloatingWindowCreated(sender
As
Object
, e
As
FloatingWindowEventArgs)
Handles
RadDock1.FloatingWindowCreated
For
Each
dw
As
DockWindow
In
CType
(sender, RadDock).DockWindows
If
dw.Handle <>
CType
(sender, RadDock).ActiveWindow.Handle
AndAlso
dw.DockState = DockState.AutoHide
Then
dw.DockState = dw.PreviousDockState
RadDock1.AutoHideWindows(
New
DockWindow() {dw}, dw.Tag)
End
If
Next
End
Sub
Private
Sub
RadDock1_DockStateChanged(sender
As
Object
, e
As
DockWindowEventArgs)
Handles
RadDock1.DockStateChanged
If
e.DockWindow.DockState = DockState.Docked
Then
e.DockWindow.Tag = GetDockPostition(e.DockWindow)
End
If
End
Sub
Public
Function
GetDockPostition(window
As
DockWindow)
As
AutoHidePosition
Dim
type
As
Type =
GetType
(RadDock)
Dim
mi
As
Reflection.MethodInfo =
Me
.RadDock1.[
GetType
]().GetMethod(
"GetAutoHidePosition"
, Reflection.BindingFlags.Instance
Or
Reflection.BindingFlags.NonPublic)
Dim
res
As
Object
= mi.Invoke(
Me
.RadDock1,
New
Object
() {
DirectCast
(
Me
.RadDock1(window.Name).TabStrip, ToolTabStrip)})
Dim
aHPposition
As
AutoHidePosition =
DirectCast
(res, AutoHidePosition)
Return
aHPposition
End
Function