Browse Source

Ensure properties registered.

When calling `AvaloniaPropertyRegistry.GetAttached`.
pull/1136/head
Steven Kirk 9 years ago
parent
commit
9a74e8409e
  1. 3
      src/Avalonia.Base/AvaloniaPropertyRegistry.cs

3
src/Avalonia.Base/AvaloniaPropertyRegistry.cs

@ -47,6 +47,9 @@ namespace Avalonia
{
Dictionary<int, AvaloniaProperty> inner;
// Ensure the type's static ctor has been run.
RuntimeHelpers.RunClassConstructor(ownerType.TypeHandle);
if (_attached.TryGetValue(ownerType, out inner))
{
return inner.Values;

Loading…
Cancel
Save