From 83fbcccae184309570e0f2f22e2173c198972f62 Mon Sep 17 00:00:00 2001 From: grokys Date: Sat, 1 Feb 2014 23:28:35 +0100 Subject: [PATCH] Attach styles in reverse order. --- Perspex/Controls/Control.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Perspex/Controls/Control.cs b/Perspex/Controls/Control.cs index fe04b8f254..200f29c0f5 100644 --- a/Perspex/Controls/Control.cs +++ b/Perspex/Controls/Control.cs @@ -216,17 +216,17 @@ namespace Perspex.Controls { Contract.Requires(control != null); - foreach (Style style in control.Styles) - { - style.Attach(this); - } - Control parent = control.Parent; - + if (parent != null) { this.AttachStyles(parent); } + + foreach (Style style in control.Styles) + { + style.Attach(this); + } } private void ParentChanged(Tuple values)