Apply custom theme on DockablePane when autohidden is selected

Feb 3, 2010 at 10:28 AM

Hello,

I'm new in WPF. I have this problem: i've created a new style for my application. It contains something like this:

<DockablePane Style="MyStyle">

        <DockableContent/>

        <DockableContent/>

        <DockableContent/>

</DockablePane>

When i apply the styles on the <DockablePane> it work well, but if i press AutoHide pin, when i go on the tab the Panel is shown, but it has the default styles. It doesn't have my custom styles :| . I hope that you can understand what i said and help me!

Thanks!

Cristian

 

Feb 9, 2010 at 2:28 PM

Could you please answer to my question? At least if it is possible to do this.

Thank you!

 

Cristian

Feb 9, 2010 at 2:54 PM

Where did you put the style?

consider that when a dockable pane is autohidden, it is placed in a different window so be sure that the resource style is reachable at application level (like in a theme resource dictionary or in the application resources)

 

Ado

Feb 9, 2010 at 3:06 PM

I have a resource dictionary, where is the style. i will write a part from the code:

<UserControl>

<UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/ThemeLibrary;component/Themes/Theme.xaml" x:Name="theme" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

<ad:DockingManager >
        <ad:ResizingPanel Orientation="Vertical">
            <ad:ResizingPanel Orientation="Horizontal" >
                <ad:DockablePane ad:ResizingPanel.ResizeWidth="240" x:Name="dockPane" Height="Auto" Style="{DynamicResource DockablePaneStyle}">
                    <ad:DockableContent x:Name="luaViewDock"  Title="Lua scripting">
                        <controls:LuaView x:Name="luaView" />
                    </ad:DockableContent>
                    <ad:DockableContent x:Name="propertyGridDock" Title="Property Grid" >
                        <wfi:WindowsFormsHost  Height="auto" Width="auto">
                            <controls:PropertyView x:Name="propertyView"></controls:PropertyView>
                        </wfi:WindowsFormsHost>
                    </ad:DockableContent>
                    <ad:DockableContent x:Name="treeViewDock" Title="Tree View" >
                            <controls:WpfTreeView x:Name="treeView" />
                    </ad:DockableContent>
                </ad:DockablePane>

          </ad:ResizingPanel>

   </ad:ResizingPanel>

</ad:DockingManager >

</UserControl>

Feb 9, 2010 at 3:20 PM

I suppose you have the style into the ThemeLibrary;component/Themes/Theme.xaml, if so you should link this dictionary at application level, ie under Application.Resources.

Ado

Feb 10, 2010 at 11:36 AM

Yes, my style is in ThemeLibrary;component/Themes/Theme.xaml. I've tried to do your fix. It doesn't work for me. The header bar of my DockablePane is switching to the default style. DockableContent is having the custom style. Maybe there is another fix.

Thank you.

Cristian

Feb 11, 2010 at 9:43 AM

I've made some short application where i tested what you said to me. And even in this application, i have the same problem. If you want i could sent this short application to you.

Thank you.

Cristian

Feb 11, 2010 at 10:27 AM

Yes send me the project at adospace @ yahoo.it

Feb 11, 2010 at 1:26 PM

After running your project I found an issue on AvalonDock that causes the problem with custom DockablePane styles. Actually it's not a real bug but instead is a missing feature.

Anyway I've corrected it and now your project works fine with my internal build 2702 that I'm going to publish.

Ado

 

Feb 11, 2010 at 1:31 PM

Hi,

Thank you adospace. I will wait for your new build and i hope it will work.

Have a nice day.

Cristian

Feb 24, 2010 at 8:59 AM

Thank you adospace. I've downloaded the new version of AvalonDock and the problem was fixed, which is great.

Cristi.