Skip to content

Commit

Permalink
Got rid of the SingleItemContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Oct 26, 2023
1 parent 30c5392 commit e9842b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 63 deletions.
13 changes: 5 additions & 8 deletions src/Myra/Graphics2D/UI/Selectors/TabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum TabSelectorPosition
public class TabControl : Selector<Grid, TabItem>
{
private Grid _gridButtons;
private SingleItemContainer<Widget> _panelContent;
private Panel _panelContent;
private TabSelectorPosition _selectorPosition;
private ObservableCollection<Proportion> _buttonProportions;
private ObservableCollection<Proportion> _contentProportions;
Expand Down Expand Up @@ -162,11 +162,7 @@ public TabControl(string styleName = Stylesheet.DefaultStyleName) : base(new Gri
VerticalAlignment = VerticalAlignment.Top;

_gridButtons = new Grid();
_panelContent = new SingleItemContainer<Widget>()
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch
};
_panelContent = new Panel();
Grid.SetRow(_panelContent, 1);

// Default to Top selector position:
Expand Down Expand Up @@ -269,9 +265,10 @@ protected override void OnSelectedItemChanged()
{
base.OnSelectedItemChanged();

if (SelectedItem != null)
_panelContent.Widgets.Clear();
if (SelectedItem != null && SelectedItem.Content != null)
{
_panelContent.InternalChild = SelectedItem.Content;
_panelContent.Widgets.Add(SelectedItem.Content);
}
}

Expand Down
55 changes: 0 additions & 55 deletions src/Myra/Graphics2D/UI/SingleItemContainer.cs

This file was deleted.

0 comments on commit e9842b1

Please sign in to comment.