I have installed the Actipro trial and I have been going through the samples and evaluating its capabilities. We are interested in a WPF docking control that can support an ItemsSource binding for the panels in the dock control. I have gone through the sample that shows how to setup the DockSite with bindings using its ToolItemsSource property.
I have a ToolItemViewModel that contains properties named DefaultDock, DockGroup, IsInitiallyAutoHidden, Description, ImageSource, Title, and Name. These properties were the same properties defined the in the MVVM sample for the DockSite. These properties all seem to be bound and working correctly. For example, when I change the Title property at runtime I can see the text at the top of the ToolWindow change.
Now I would like to be able to open the associated ToolWindow by changing a property in the ViewModel that is the DataContext for the ToolWindow. I saw that there was an IsOpen property on ToolWindow so I added an IsOpen boolean property to the ToolItemViewModel that contains the other notifiable properties. I also altered the ToolItemStyle that is defined in the Application Resources to the following.
<Style x:Key="ToolItemStyle" TargetType="docking:ToolWindow" BasedOn="{StaticResource DockingItemStyle}">
<Setter Property="IsOpen" Value="{Binding IsOpen}" />
</Style>
I also added the same Setter for the IsOpen property to the Style for the DocumentWindow and DockingWindow just to be sure. When I change the IsOpen property at runtime it has no effect on the ToolWindow. I was not sure the binding was working so I deliberately misspelled the binding property just to see if I could get a Binding error and I did but only for the ToolItemStyle. So I only have the IsOpen property binding style for the ToolWindow (as shown above).
A little more info. The plan right now is to create all ViewModels that inherit from ToolItemViewModel at startup and add these VMs to the binding collection for the DockingSite ToolItemsSource. Each VM will have a default setting that controls if it should be open and pinned or simply closed and not visible. Using the EventAggregator from Prism, each VM will be listening to an event used to open and pin the ToolWindow. I thought I could simply change the IsOpen property to True and the ToolWindow would be opened and pinned.
What is the best way to open, close, and activate a ToolWindow from a bindable property in its DataContext ViewModel?
Thanks,
-eric