This project is read-only.

Composite WPF

Dec 23, 2009 at 1:11 PM
Edited Dec 31, 2009 at 9:38 AM

I'm trying to use AvalonDock in aplication builded with Composite WPF  -
But in present form of AvalonDock changing something in behavior of this control is almost impossible. So i changed a bit sources and i'd like to share.

Download link:

First off all I added some events to DockingManager:

	public event EventHandler<EventArgs<FlyoutPaneWindow>> FlyoutPaneWindowClosing;
        	public event EventHandler<EventArgs<FlyoutPaneWindow>> FlyoutPaneWindowPositionChanged;
        	public event EventHandler<EventArgs<DockableContent>> DockableContentClosed;

Aslo in Docking manager I created factory methods, like:

  protected virtual DocumentFloatingWindow CreateDocumentFloatingWindow(DocumentContent content)
            return new DocumentFloatingWindow(this, content);


protected virtual DockablePane CreateDockablePane()
            return new DockablePane();

Now you can for example extend DockingManager and providing your own class for DockableFloatingWindow, where you can disable not working correctly redocking after double mouse click on header.

 public class DockManager : DockingManager
        public override DockableFloatingWindow CreateDockableFloatingWindow()
            return new DockingWindow(this);

        public override DockableFloatingWindow CreateDockableFloatingWindow(DockableContent content)
            return new DockingWindow(this, content);

        public override DockableFloatingWindow CreateDockableFloatingWindow(DockablePane pane)
            return new DockingWindow(this, pane);

  public class DockingWindow : DockableFloatingWindow
        public DockingWindow(DockingManager manager) : base(manager)

        public DockingWindow(DockingManager manager, DockableContent content) : base(manager, content)

        public DockingWindow(DockingManager manager, DockablePane dockablePane) : base(manager, dockablePane)

        protected override void Redock()
You can aslo know when DockableContent is closed by subscribing to proper event, for example:
dockingManager.DockableContentClosed += OnDockingManagerDockableContentClosed;
  private void OnDockingManagerDockableContentClosed(object sender, AvalonDock.EventArgs<AvalonDock.DockableContent> e)
            foreach (var region in RegionManager.Regions)

I'm waiting for feedback.
If someone will by interested, I will be publishing progres of my work here.


Dec 30, 2009 at 6:29 PM

The link to your source is broken. Can you please post the code ? many thanks

Dec 31, 2009 at 9:36 AM
Edited Dec 31, 2009 at 9:37 AM


Jan 5, 2010 at 4:56 PM

If you could provide some examples on using the AvalonDock in Prism project will certainly be a great help!  Thanks


Jan 29, 2010 at 11:14 AM
            m_regionManager.AddToRegion(Views.Main, view);

All that's needed to get AvalonDock and Prism working together is a new RegionAdapter. See for an example of how to implement the Adapter for Grids.

<ad:DockingManager x:Name="MainDockManager" DockPanel.Dock="Left">
    <Grid cal:RegionManager.RegionName="{x:Static const:Views.Main}" />


Then in your Module, this is the xaml for a simple video view


<UserControl x:Class="MyView"
    Height="300" Width="300">
            <ad:DockableContent Name="_mainFrame" Title="My video">
                    <Button Height="23" Name="_playButton" Width="75" DockPanel.Dock="Bottom" Click="_playButton_Click">Play</Button>
                    <MediaElement Name="_mediaElement" LoadedBehavior="Manual" />                    


It is created as normal with the following command in C# from your module:


     m_regionManager.AddToRegion(Views.Main, view);