Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Customise AvalonDock style

$
0
0
Hi,

You can use the "Style" and "Template" properties on DockingManager.
Here's an example for styling "DocumentPaneControlStyle" :

MainWindow.xaml file :
<Window x:Class="WpfApplication94.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
        Title="MainWindow">
   <Window.Resources>
      <ResourceDictionary>
         <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="MyResource.xaml" />
         </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>   
   </Window.Resources>
    
   <Grid>
      <xcad:DockingManager  DocumentPaneControlStyle="{StaticResource MyDocumentPaneControlStyle}">
.......
</xcad:DockingManager>
MyResource.xaml file :
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:shell="clr-namespace:Microsoft.Windows.Shell"
                    xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock">

   <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="/Xceed.Wpf.AvalonDock;component/Themes/generic.xaml" />
   </ResourceDictionary.MergedDictionaries>

   <!--DocumentPaneControlStyle based on default DocumentPaneControlStyle from generic.xaml-->
   <Style x:Key="MyDocumentPaneControlStyle"
          TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
          BasedOn="{StaticResource DocumentPaneControlStyle}">
      <Setter Property="Background"
              Value="Red" />
   </Style>
</ResourceDictionary>

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>