Sorry, just read to use this discussion instead of the Avalondock discussion.
I'm facing some troubles using the MVVM light locator together with the Avalondocking and do not have any idea whats going on.
The StyleSelector is not called and I do not understandy why.
The constructor is called but the Method: "SelectStyle" is never called. Traced with 2 breakpoints during debugging.
The view is shown in a proper way and also the bound viewmodel is working very well.
The StyleSelector Class looks as follow:
Please let me know if any further code or information is required.
Thanks in advance,
Martin
I'm facing some troubles using the MVVM light locator together with the Avalondocking and do not have any idea whats going on.
The StyleSelector is not called and I do not understandy why.
The constructor is called but the Method: "SelectStyle" is never called. Traced with 2 breakpoints during debugging.
The view is shown in a proper way and also the bound viewmodel is working very well.
The StyleSelector Class looks as follow:
class PaneStyleSelector : StyleSelector
{
public PaneStyleSelector() { }
public Style StartPageStyle { get; set; }
public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container)
{
if (item is StartPageViewModel)
return StartPageStyle;
return base.SelectStyle(item, container);
}
}
The MainWindow.xaml:<avalonDock:DockingManager Name="dockManager"
AnchorablesSource="{Binding Tools}"
DocumentsSource="{Binding Files}"
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"
Grid.Row="1">
<avalonDock:DockingManager.LayoutItemTemplateSelector>
<pane:PanesTemplateSelector>
<pane:PanesTemplateSelector.StartPageViewTemplate>
<DataTemplate>
<view:StartPageView/>
</DataTemplate>
</pane:PanesTemplateSelector.StartPageViewTemplate>
</pane:PanesTemplateSelector>
</avalonDock:DockingManager.LayoutItemTemplateSelector>
<avalonDock:DockingManager.LayoutItemContainerStyleSelector>
<pane:PaneStyleSelector>
<pane:PaneStyleSelector.StartPageStyle>
<Style TargetType="{x:Type avalonDock:LayoutItem}">
<Setter Property="Title" Value="{Binding Model.Title}"/>
<Setter Property="ToolTip" Value="{Binding Model.StartPageTip}"/>
<Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"/>
<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
</Style>
</pane:PaneStyleSelector.StartPageStyle>
</pane:PaneStyleSelector>
</avalonDock:DockingManager.LayoutItemContainerStyleSelector>
</avalonDock:DockingManager>
Does anyone have an idea whats wrong with the PaneStyleSelector? References are give, intellisense also sees the "StartPageStyle". The Binding to "Model.Title" and so on is not working here....Please let me know if any further code or information is required.
Thanks in advance,
Martin