Skip to content

Commit

Permalink
Fix unit test error.
Browse files Browse the repository at this point in the history
  • Loading branch information
BDisp committed Aug 26, 2023
1 parent 5bfe384 commit ff1f6f8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Design.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,17 @@ public Design CreateSubControlDesign(string name, View subView)
// HACK: if you don't pull the label out first it complains that you cant set Focusable to true
// on the Label because its super is not focusable :(
var super = subView.SuperView;
if (super != null)
var borderBrush = subView.Border != null ? subView.Border.BorderBrush : (Color)(-1);
var background = subView.Border != null ? subView.Border.Background : (Color)(-1);
if (super != null && super.Subviews.FirstOrDefault(sv => sv == subView && sv.Data == subView.Data) != null)
{
this.logger.Info($"Found and removing subView of Type '{subView.GetType()}' in the superView'{super}'");
super.Remove(subView);
if (subView.Border != null)
{
subView.Border.BorderBrush = (Color)borderBrush!;
subView.Border.Background = (Color)background!;
}
}

// all views can be focused so that they can be edited
Expand Down

0 comments on commit ff1f6f8

Please sign in to comment.