Reputation: 2550
Working with DockState and AutoHide, I am looking for the following things:
Answer Wiki:
IsAutoHide - get:
private WeifenLuo.WinFormsUI.Docking.DockState[] AutoHideStates = new WeifenLuo.WinFormsUI.Docking.DockState[] {
WeifenLuo.WinFormsUI.Docking.DockState.DockBottomAutoHide,
WeifenLuo.WinFormsUI.Docking.DockState.DockLeftAutoHide,
WeifenLuo.WinFormsUI.Docking.DockState.DockRightAutoHide,
WeifenLuo.WinFormsUI.Docking.DockState.DockTopAutoHide };
public bool IsAutoHide { get { return AutoHideStates.Contains(DockContent.DockState); } }
IsAutoHide - set: No code yet - basically iterate through the modes or use a dictionary of interchangable modes (i.e. DockBottomAutoHide to DockBottom)
I have no idea, but this looks interesting, might have the idea.
Upvotes: 5
Views: 3767
Reputation: 3994
1 is a decent way to accomplish this. The library has an internal method, DockHelper.IsDockStateAutoHide()
that does basically the same thing. This should actually be made into a public extension method and included as part of the library.
2 Your solution is good.
3 & 4 would probably be best implemented as a new event in the DockPanel
: ActiveAutoHideContentChanged
. You could then track the last autohide content on your own and when the event is raised you know that #3 is occurring if the new value is not null and #4 is occurring if the last known value was not null.
Feel free to open a request on GitHub to have the event added.
Upvotes: 2