Browse Source
Fixed templated parent theme changed loop.
pull/10471/head
José Pedro
3 years ago
No known key found for this signature in database
GPG Key ID: B8247B9301707B83
2 changed files with
17 additions and
17 deletions
-
src/Avalonia.Base/Visual.cs
-
src/Avalonia.Controls/Primitives/TemplatedControl.cs
|
|
|
@ -732,6 +732,23 @@ namespace Avalonia |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal override void OnTemplatedParentControlThemeChanged() |
|
|
|
{ |
|
|
|
base.OnTemplatedParentControlThemeChanged(); |
|
|
|
|
|
|
|
var count = VisualChildren.Count; |
|
|
|
var templatedParent = TemplatedParent; |
|
|
|
|
|
|
|
for (var i = 0; i < count; ++i) |
|
|
|
{ |
|
|
|
if (VisualChildren[i] is StyledElement child && |
|
|
|
child.TemplatedParent == templatedParent) |
|
|
|
{ |
|
|
|
child.OnTemplatedParentControlThemeChanged(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Computes the <see cref="HasMirrorTransform"/> value according to the
|
|
|
|
/// <see cref="FlowDirection"/> and <see cref="BypassFlowDirectionPolicies"/>
|
|
|
|
|
|
|
|
@ -405,22 +405,5 @@ namespace Avalonia.Controls.Primitives |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal override void OnTemplatedParentControlThemeChanged() |
|
|
|
{ |
|
|
|
base.OnTemplatedParentControlThemeChanged(); |
|
|
|
|
|
|
|
var count = VisualChildren.Count; |
|
|
|
var templatedParent = TemplatedParent; |
|
|
|
|
|
|
|
for (var i = 0; i < count; ++i) |
|
|
|
{ |
|
|
|
if (VisualChildren[i] is TemplatedControl child && |
|
|
|
child.TemplatedParent == templatedParent) |
|
|
|
{ |
|
|
|
child.OnTemplatedParentControlThemeChanged(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|