Skip to content

Commit

Permalink
Fix: Card Maximize button does not call OnMaximize event sjefvanleeuw…
Browse files Browse the repository at this point in the history
  • Loading branch information
petrnecas committed Mar 15, 2021
1 parent 50e58c9 commit 2458cea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/Blazor.AdminLte.Site.Shared/Pages/Widgets/Widgets.razor
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,19 @@
<Column Classes="col.md._3">
<Card HeaderBackgroundColor="Color.Danger" ToolOptions="new CardToolOptions { Maximizable = true }">
<Title><CardTitle>Maximizable</CardTitle></Title>
<Header><CardTools /></Header>
<Header><CardTools OnMaximize="HandleOnMaximize" /></Header>
<Body>
The body of the card
@BodyMaximizeCard
</Body>
</Card>
</Column>
@code {
private MarkupString BodyMaximizeCard { get; set; } = (MarkupString)"The body of the card";
private void HandleOnMaximize(Tuple<ICardTools, MouseEventArgs> tuple)
{
BodyMaximizeCard = (MarkupString)"The body of the card, maximized";
}
}
</Row>

<Row>
Expand Down
2 changes: 1 addition & 1 deletion src/Blazor.AdminLte/Card/CardTools.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private void DoOnRefresh(MouseEventArgs args)
private void DoOnMaximize(MouseEventArgs args)
{
IsMaximized = !IsMaximized;
OnRefresh.InvokeAsync(new Tuple<ICardTools, MouseEventArgs>(this, args));
OnMaximize.InvokeAsync(new Tuple<ICardTools, MouseEventArgs>(this, args));
}

private CardToolOptions Options => ToolOptions ?? new CardToolOptions();
Expand Down

0 comments on commit 2458cea

Please sign in to comment.