Click here to Skip to main content
15,897,704 members
Articles / Desktop Programming / WPF

AvalonDock [2.0] Tutorial Part 1 - Adding a Tool Window

Rate me:
Please Sign up or sign in to vote.
4.97/5 (37 votes)
6 Nov 2018CPOL9 min read 292.5K   12.1K   125  
How to create a new tool window in AvalonDock [2.0]
namespace Edi.View.Pane
{
  using System.Windows;
  using System.Windows.Controls;
  using Edi.ViewModel;
  using Edi.ViewModel.Base;

  class PanesStyleSelector : StyleSelector
  {
    public Style ToolStyle
    {
      get;
      set;
    }

    public Style FileStyle
    {
      get;
      set;
    }

    public Style RecentFilesStyle
    {
      get;
      set;
    }

    public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container)
    {
      if (item is RecentFilesViewModel)
        return RecentFilesStyle;

		if (item is ToolViewModel)
        return ToolStyle;

      if (item is FileViewModel)
        return FileStyle;

      return base.SelectStyle(item, container);
    }
  }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Germany Germany
The Windows Presentation Foundation (WPF) and C# are among my favorites and so I developed Edi

and a few other projects on GitHub. I am normally an algorithms and structure type but WPF has such interesting UI sides that I cannot help myself but get into it.

https://de.linkedin.com/in/dirkbahle

Comments and Discussions