public void Remove(IAreaContents areaItem) { if (areaItem is UIElement uIElement) { if (ContentsCanvas.Children.Contains(uIElement)) { ContentsCanvas.Children.Remove(uIElement); if (string.IsNullOrEmpty(areaItem.Group)) { Grouped[areaItem.Group].Remove(areaItem); if (Grouped[areaItem.Group].Count == 0) { Grouped.Remove(areaItem.Group); } } if (areaItem.Select) { AreaItemSelectOperator.Remove(areaItem); Selected.Remove(areaItem); } } } }
public ContentsAreaBase(Canvas canvas) { ContentsCanvas = canvas; AreaItemSelectOperator = new AreaItemSelectOperator(canvas); AreaItemOperator = new AreaItemOperator(canvas); }