-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ongoing work
- Loading branch information
Bernhard Straub
committed
Apr 17, 2024
1 parent
d6fbbf2
commit 3d96564
Showing
13 changed files
with
233 additions
and
190 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
DexieNETCloudSample/Components/ToDoDBItemAddOrUpdate.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,34 @@ | ||
@inherits RxBLServiceSubscriber<ToDoItemService> | ||
|
||
@if (AddMode) | ||
{ | ||
<MudFabAsyncRx StateCommand=@Service.DBCMDAsync CanChangeCallback=@Service.CanAdd Class="mr-2" Color="Color.Success" StartIcon="@Icons.Material.Filled.Add" Size="Size.Small" ExecuteAsyncCallback=@ShowAddUpdateDialog /> | ||
} | ||
else | ||
{ | ||
<MudIconButtonAsyncRx StateCommand=@Service.DBCMDAsync CanChangeCallback=@(() => Service.CanUpdate(Item)) Color="Color.Info" Icon=@Icons.Material.Filled.Edit ExecuteAsyncCallback=@ShowAddUpdateDialog /> | ||
} | ||
|
||
@code { | ||
[Parameter, EditorRequired] | ||
public required bool AddMode { get; init; } | ||
|
||
[Parameter, EditorRequired] | ||
public required ToDoDBItem? Item { get; init; } | ||
|
||
[Inject] | ||
public required IDialogService DialogService { get; init; } | ||
|
||
private async Task ShowAddUpdateDialog(IStateCommandAsync _) | ||
{ | ||
var parameters = new DialogParameters { ["Item"] = Item }; | ||
var dialog = DialogService.Show<AddToDoItem>(AddMode ? "Add ToDo" : "Edit ToDo", parameters); | ||
var result = await dialog.Result; | ||
|
||
if (!result.Canceled) | ||
{ | ||
var scope = (ToDoItemService.ToDoItemItemInput)result.Data; | ||
await scope.SubmitAsync(); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.