From 9a74e8409ea1c5305c4b5ea481dfc4b359e6159a Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 24 Aug 2017 13:19:23 +0200 Subject: [PATCH] Ensure properties registered. When calling `AvaloniaPropertyRegistry.GetAttached`. --- src/Avalonia.Base/AvaloniaPropertyRegistry.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Avalonia.Base/AvaloniaPropertyRegistry.cs b/src/Avalonia.Base/AvaloniaPropertyRegistry.cs index 190b3ee2be..ec1643427b 100644 --- a/src/Avalonia.Base/AvaloniaPropertyRegistry.cs +++ b/src/Avalonia.Base/AvaloniaPropertyRegistry.cs @@ -47,6 +47,9 @@ namespace Avalonia { Dictionary inner; + // Ensure the type's static ctor has been run. + RuntimeHelpers.RunClassConstructor(ownerType.TypeHandle); + if (_attached.TryGetValue(ownerType, out inner)) { return inner.Values;