diff options
| -rw-r--r-- | Pages/Component/TabContainer.razor | 5 | ||||
| -rw-r--r-- | Pages/Component/TabPane.razor | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Pages/Component/TabContainer.razor b/Pages/Component/TabContainer.razor index 0dc1924..ed61f49 100644 --- a/Pages/Component/TabContainer.razor +++ b/Pages/Component/TabContainer.razor @@ -25,4 +25,9 @@ ActivePane = tabPane; StateHasChanged(); } + + public void RemovePane(TabPane tabPane) { + Panes.Remove(tabPane); + StateHasChanged(); + } }
\ No newline at end of file diff --git a/Pages/Component/TabPane.razor b/Pages/Component/TabPane.razor index 483d0d6..ba4a13a 100644 --- a/Pages/Component/TabPane.razor +++ b/Pages/Component/TabPane.razor @@ -1,4 +1,6 @@ -<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/> +@implements IDisposable + +<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/> @if(Parent.ActivePane == this) { @ChildContent @@ -20,4 +22,8 @@ Parent.AddPane(this); } + + public void Dispose() { + Parent.RemovePane(this); + } }
\ No newline at end of file |
