فهرست منبع

Handle detached controls in layout pass.

Controls can still be queued for layout after they've been removed from
the visual tree.
Steven Kirk 10 سال پیش
والد
کامیت
b72f08354a
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/Perspex.Layout/LayoutManager.cs

+ 2 - 2
src/Perspex.Layout/LayoutManager.cs

@@ -276,12 +276,12 @@ namespace Perspex.Layout
                         {
                             var control = item.Control;
 
-                            while (control.PreviousArrange == null)
+                            while (control != null && control.PreviousArrange == null)
                             {
                                 control = control.GetVisualParent<ILayoutable>();
                             }
 
-                            if (control.GetVisualRoot() == Root)
+                            if (control != null && control.GetVisualRoot() == Root)
                             {
                                 control.Arrange(control.PreviousArrange.Value, true);
                             }