-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#383 - Refactor common settings dialog component.
- Loading branch information
Showing
4 changed files
with
97 additions
and
66 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/Money.Blazor.Host/Components/Settings/PropertyDialog.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Modal @ref="Editor" TitleIcon="@Model.Icon" Title="@Title"> | ||
<ChildContent> | ||
@ChildContent | ||
</ChildContent> | ||
<Buttons> | ||
<button class="btn btn-primary" @onclick="(async () => { await Model.SetAsync(); Editor.Hide(); })">Set</button> | ||
</Buttons> | ||
</Modal> |
40 changes: 40 additions & 0 deletions
40
src/Money.Blazor.Host/Components/Settings/PropertyDialog.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Money.Commands; | ||
using Money.Components; | ||
using Money.Components.Bootstrap; | ||
using Money.Events; | ||
using Money.Models; | ||
using Money.Models.Queries; | ||
using Money.Models.Sorting; | ||
using Money.Pages.Users; | ||
using Neptuo; | ||
using Neptuo.Commands; | ||
using Neptuo.Events; | ||
using Neptuo.Events.Handlers; | ||
using Neptuo.Queries; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Money.Components.Settings | ||
{ | ||
public partial class PropertyDialog | ||
{ | ||
[Parameter] | ||
public string Title { get; set; } | ||
|
||
[Parameter] | ||
public PropertyViewModel Model { get; set; } | ||
|
||
[Parameter] | ||
public RenderFragment ChildContent { get; set; } | ||
|
||
protected Modal Editor { get; set; } | ||
|
||
public void Show() => Editor.Show(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters