Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to style or otherwise modify the LayoutDocumentTabItem? #278

Open
chris-ott opened this issue Aug 18, 2017 · 0 comments
Open

Comments

@chris-ott
Copy link

I would like to customize the DockingManager's DocumentPane TabItem controls. I've tried creating a custom style that targets the LayoutDocumentTabItem in a ResourceDictionary in my App.xaml file but the style is being overriden after loading. I also tried to override the DockingManager's DocumentPaneControlStyle value via a custom style in App.xaml but the default styling still overrides most of the values I'm attempting to set. Finally, I tried customizing the DockingManager's DocumentHeaderTemplateSelector via styling. This was marginally successful but the DataContext doesn't seem to be presenting the Title or IconSource.

I was successful in customizing the control within the Gemini library via ShellView.xaml, mainly to validate my efforts but I would prefer to not have to modify Gemini, if possible. I would also like to avoid co-opting the IconSource but I could not find a way to bind a set a separate DataContext within my DataTemplate when using DocumentHeaderTemplateSelector.

Here is the markup that was successful in ShellView.xaml but fails as a style override in App.xaml. It requires a HeaderTemplateSelector class in Gemini\Shell\Controls which is basically a copy of PanesTemplateSelector.cs.

<xcad:DockingManager.DocumentHeaderTemplateSelector>
    <controls:HeaderTemplateSelector>
        <controls:HeaderTemplateSelector.HeaderTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Image Source="{Binding IconSource}"/>
                    <TextBlock Grid.Column="1" Text="{Binding Title}"/>
                </Grid>
            </DataTemplate>
        </controls:HeaderTemplateSelector.HeaderTemplate>
    </controls:HeaderTemplateSelector>
</xcad:DockingManager.DocumentHeaderTemplateSelector>

Any insight would be greatly appreciated. I tried searching out assistance on StackOverflow but the gemini tag isn't related to this project and most of the AvalonDock styling assistance is geared toward direct calls and declarations of the DockingManager, which is how I ended up in ShellView.xaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant