Color support

Jun 10, 2009 at 11:38 AM
Edited Jun 10, 2009 at 12:52 PM

Hi,
I added color support and it's ready to use. It looks loke you see in the picture. You can change the colors by code depending on a AvalonDock theme which  you can use like:

AvalonDock.ColorFactory colorFactory = new AvalonDock.ColorFactory();
colorFactory.ChangeColors("classic", Colors.Red);

I added an aero.dummy. xaml and aero.dummy.brushes.xaml. That are copies from the aero styled ones in AvalonDock with the missing color-values from the DocumentPane border-colors. The only thing I had to change in code is in AvalonDockBrushes.cs to define the 2 missing colors (DocumentHeaderBorder, DocumentHeaderBorder2)

If you are interested you can download it from "http://www.viart.de/download/AvalonDock.zip"

Maybe there is the chance to add this class in the final version ?

Best regards,
Juergen

Jun 12, 2009 at 6:46 AM

Looks nice. I like it. :)

Jun 12, 2009 at 3:55 PM

HI,

your code has been merged in AvalonDock [1.2.2252] with some modifications,

thanks a lot for your work,

Ado

Jun 12, 2009 at 7:40 PM

Hi Ado,
I have to thank you for your very well working control.

Before I used DevComponents Docking library. But there isn't WinForms support implemented.

Greets,

Juergen

Jun 17, 2009 at 11:04 AM
Edited Jun 17, 2009 at 11:04 AM

Hi Ado,
There must be a change in ColorFactory.cs. It should be:

        public static void ChangeColors(string baseTheme, Color color)
        {
            ResourceDictionary rd = new ResourceDictionary();
            rd.Source = new Uri("/AvalonDock;component/themes/" + baseTheme + ".xaml", UriKind.RelativeOrAbsolute);

            ChangeKeysInResourceDictionary(rd, color);
            foreach (ResourceDictionary rd2 in rd.MergedDictionaries)
            {
                ChangeKeysInResourceDictionary(rd2, color);
            }

            // first search and remove old one
            foreach (ResourceDictionary res in Application.Current.Resources.MergedDictionaries)
            {
                if (res.Source != null)
                {
                    string source = res.Source.ToString();
                    if (source.Contains("/AvalonDock;component/themes/"))
                    {
                        Application.Current.Resources.MergedDictionaries.Remove(res);
                        break;
                    }
                }
            }
            Application.Current.Resources.MergedDictionaries.Add(rd);
        }

I have a project with a ResourceDictionary with Source = null.

 

 

Juergen

Aug 27, 2009 at 3:01 PM

Hi,

 

The class ColorFactory is not on the last "source code" version of Avalon ? It is no more supported ?

 

Thanks

 

Aug 27, 2009 at 3:39 PM

It's still in.
It's in ColorFactory.cs.