Hi,
I need to activate a ContentPane of a XamDockManager programmatically (preferably MVVM).
How would I do that?
My XAML looks like that:
<dock:XamDockManager x:Name="DOCK" Theme="IGTheme" PaneDragOver="OnPaneDragOver"> <dock:DocumentContentHost x:Name="CONTENT_HOST" x:FieldModifier="internal"> <igExtensions:ContentPaneFactory.PaneFactory> <igExtensions:ContentPaneFactory x:Name="CNT" ItemsSource="{Binding OpenContentPanes}" HeaderPath="Name" ContainerStyle="{StaticResourcetStyle}"/> </igExtensions:ContentPaneFactory.PaneFactory> </dock:DocumentContentHost> </dock:XamDockManager>
Best
Oliver
Hi Oliver,
I modified the ContentPaneFactory to provide a behavior to the ContentPanes it generates. This behavior binds to a property in the view model that will control active panes. When you set the view model property, it triggers the behavior to call ContentPane.Activate() which will activate the pains. Take a look at my attached sample.
I'm not sure the sample project is working correctly. On startup, I get the following error:
System.Windows.Data Error: 40 : BindingExpression path error: 'IsActive' property not found on 'object' ''Window_DockBindingViewModel' (HashCode=23804398)'. BindingExpression:Path=IsActive; DataItem='Window_DockBindingViewModel' (HashCode=23804398); target element is 'MyBehavior' (HashCode=60682705); target property is 'IsActivePane' (type 'Boolean')
So it looks like the behavior is not attaching properly to the content panes.
I am using Infragistics 12.2. Could someone take a look please?