This project has moved and is read-only. For the latest updates, please go here.

AvalonDock and MVVM Light

Jan 16 at 7:50 AM
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:
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
Jan 16 at 4:06 PM
Hi,

Can you submit a full sample ?
We can not easily compile your code snipet since a lot of classes/properties are missing.

Thanks.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Jan 16 at 7:27 PM
Hi,

of course I've reduced the project:
Link to Zip in Dropbox

I couldn't find an upload here. Hopefully the Dropbox link is working.
Sorry for the huge size... some of the packages are really big

Thanks for your help!!!
Martin
Jan 18 at 4:05 PM
Edited Jan 18 at 4:06 PM
Hi Martin,

I can see that you are using the Xceed.Wpf.AvalonDock.dll v3.2, which is only available to the "Plus edition" user (or users with a trial).
"Community edition" users have Xceed.Wpf.AvalonDock.dll v3.0.

Please contact the support at Xceed, we will have the fix for you.

In the meantime, issue https://wpftoolkit.codeplex.com/workitem/22456 has been created.

Thanks.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Jan 18 at 4:24 PM
Hi,
thanks for review and the comment.

I'm actually never checked the version I've installed... I've searched for avalon dock on NuGet and downloaded this version.
That's new to me, that you can download the plus editon on nuget.

This means I will get a fix only if I get the Plus edition in near future?

Regards,
Martin
Jan 18 at 6:35 PM
Edited Jan 18 at 6:37 PM
Hi,

Ok, so you downloaded AvalonDock from Nuget.
Up there, there is a package for AvalonDock only, and Avalon Dock is a free control in the Toolkit. So that explains why you have the latest version (v3.2) of the Toolkit.

As stated in issue https://wpftoolkit.codeplex.com/workitem/22456, this will be fixed when Toolkit v3.3 will be released.

If a fix/feature is added to AvalonDock as "Plus Only feature", then yes, you would need to buy the "Plus version" to get the fix. But it's not the case here.

Thanks.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Marked as answer by maddin11477 on 1/18/2017 at 11:14 AM