Browse Source

Merge pull request #2313 from MarchingCube/feature/fix-items-control-subscribe

Fix ItemsControl ItemTemplateProperty being subscribed in non-static ctor
danwalmsley 6 years ago
parent
commit
52df963925
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Avalonia.Controls/ItemsControl.cs

+ 1 - 1
src/Avalonia.Controls/ItemsControl.cs

@@ -64,6 +64,7 @@ namespace Avalonia.Controls
         static ItemsControl()
         {
             ItemsProperty.Changed.AddClassHandler<ItemsControl>(x => x.ItemsChanged);
+            ItemTemplateProperty.Changed.AddClassHandler<ItemsControl>(x => x.ItemTemplateChanged);
         }
 
         /// <summary>
@@ -73,7 +74,6 @@ namespace Avalonia.Controls
         {
             PseudoClasses.Add(":empty");
             SubscribeToItems(_items);
-            ItemTemplateProperty.Changed.AddClassHandler<ItemsControl>(x => x.ItemTemplateChanged);
         }
 
         /// <summary>