Hi
Depending on the UserLevel of the logged on user in my application, I want to hide a ToolWindow if the user shouldn't have access to that window. The trouble is that it works when the ToolWindow is docked, however, when it's State is auto-hide, the ToolWindow is visible in the tab list.
One approeach I have tried is setting the toolwindow.Visibility = Collapsed, which does not work in auto-hide state. The other approach I tried is using code-behind to add the toolwindow to the toolwindowcontainer only if the logged on user should see the ToolWindow. When the user loggs off, the ToolWindow is removed from the container. This works well if the toolwindow is in Docked state. If the container is in auto-hide, I am not able to add or remove the specific toolwindow, or even get a positive result from Contains on the collection. It seems the toolwindow is removed from it's containers items collection when in auto-hide.
I also tried being notified about state changes for a ToolWindow when the StateProperty changes, and make sure the Visibility property remains Collapsed. However, if I set it to collapsed, it remains Collapsed between state changes. So obviously it is not the ToolWindow instance being displayed in the ItemContainer while the toolwindocontainer is in autohide state.
How can I hide a ToolWindow and make it stay hidden both in Docked and Auto-hide state?
/Bjørnar
[Modified at 01/13/2010 10:46 AM]
Depending on the UserLevel of the logged on user in my application, I want to hide a ToolWindow if the user shouldn't have access to that window. The trouble is that it works when the ToolWindow is docked, however, when it's State is auto-hide, the ToolWindow is visible in the tab list.
One approeach I have tried is setting the toolwindow.Visibility = Collapsed, which does not work in auto-hide state. The other approach I tried is using code-behind to add the toolwindow to the toolwindowcontainer only if the logged on user should see the ToolWindow. When the user loggs off, the ToolWindow is removed from the container. This works well if the toolwindow is in Docked state. If the container is in auto-hide, I am not able to add or remove the specific toolwindow, or even get a positive result from Contains on the collection. It seems the toolwindow is removed from it's containers items collection when in auto-hide.
I also tried being notified about state changes for a ToolWindow when the StateProperty changes, and make sure the Visibility property remains Collapsed. However, if I set it to collapsed, it remains Collapsed between state changes. So obviously it is not the ToolWindow instance being displayed in the ItemContainer while the toolwindocontainer is in autohide state.
How can I hide a ToolWindow and make it stay hidden both in Docked and Auto-hide state?
/Bjørnar
[Modified at 01/13/2010 10:46 AM]
Bjørnar Sundsbø