浏览代码

Merge pull request #1335 from BDisp/labelasbuttons.scenario-fix

Fixes InvalidOperationException from throwing when removing the label on the LabelsAsLabels scenario.
Charlie Kindel 4 年之前
父节点
当前提交
739e7df0fb
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      UICatalog/Scenarios/LabelsAsButtons.cs

+ 8 - 2
UICatalog/Scenarios/LabelsAsButtons.cs

@@ -117,8 +117,14 @@ namespace UICatalog {
 				CanFocus = true,
 			};
 			Win.Add (removeLabel);
-			// This in intresting test case because `moveBtn` and below are laid out relative to this one!
-			removeLabel.Clicked += () => Win.Remove (removeLabel);
+			// This in interesting test case because `moveBtn` and below are laid out relative to this one!
+			removeLabel.Clicked += () => {
+				// Now this throw a InvalidOperationException on the TopologicalSort method as is expected.
+				//Win.Remove (removeLabel);
+
+				removeLabel.Visible = false;
+				Win.SetNeedsDisplay ();
+			};
 
 			var computedFrame = new FrameView ("Computed Layout") {
 				X = 0,