+
+
+
\ No newline at end of file
diff --git a/ValblazeProject/Modals/DeleteConfirmation.razor b/ValblazeProject/Modals/DeleteConfirmation.razor
new file mode 100644
index 0000000..93f7a46
--- /dev/null
+++ b/ValblazeProject/Modals/DeleteConfirmation.razor
@@ -0,0 +1,10 @@
+
+
+
+ Are you sure you want to delete @item.DisplayName ?
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ValblazeProject/Modals/DeleteConfirmation.razor.cs b/ValblazeProject/Modals/DeleteConfirmation.razor.cs
new file mode 100644
index 0000000..8692f75
--- /dev/null
+++ b/ValblazeProject/Modals/DeleteConfirmation.razor.cs
@@ -0,0 +1,38 @@
+using Blazored.Modal.Services;
+using Blazored.Modal;
+using Microsoft.AspNetCore.Components;
+using ValblazeProject.Models;
+using ValblazeProject.Services;
+
+namespace ValblazeProject.Modals
+{
+ public partial class DeleteConfirmation
+ {
+ [CascadingParameter]
+ public BlazoredModalInstance ModalInstance { get; set; }
+
+ [Inject]
+ public IDataService DataService { get; set; }
+
+ [Parameter]
+ public int Id { get; set; }
+
+ private Item item = new Item();
+
+ protected override async Task OnInitializedAsync()
+ {
+ // Get the item
+ item = await DataService.GetById(Id);
+ }
+
+ void ConfirmDelete()
+ {
+ ModalInstance.CloseAsync(ModalResult.Ok(true));
+ }
+
+ void Cancel()
+ {
+ ModalInstance.CancelAsync();
+ }
+ }
+}
diff --git a/ValblazeProject/Pages/ExampleTabSet.razor b/ValblazeProject/Pages/ExampleTabSet.razor
new file mode 100644
index 0000000..2a70582
--- /dev/null
+++ b/ValblazeProject/Pages/ExampleTabSet.razor
@@ -0,0 +1,28 @@
+@page "/example-tab-set"
+
+
+
+
Greetings from the first tab!
+
+
+
+
+
+
Hello from the second tab!
+
+
+ @if (showThirdTab)
+ {
+
+
Welcome to the disappearing third tab!
+
Toggle this tab from the first tab.
+
+ }
+
+
+@code {
+ private bool showThirdTab;
+}
\ No newline at end of file
diff --git a/ValblazeProject/Pages/List.razor b/ValblazeProject/Pages/List.razor
index d0e4a23..a4a8c51 100644
--- a/ValblazeProject/Pages/List.razor
+++ b/ValblazeProject/Pages/List.razor
@@ -46,6 +46,7 @@
Editer
+
\ No newline at end of file
diff --git a/ValblazeProject/Pages/List.razor.cs b/ValblazeProject/Pages/List.razor.cs
index c770a89..d79954d 100644
--- a/ValblazeProject/Pages/List.razor.cs
+++ b/ValblazeProject/Pages/List.razor.cs
@@ -1,6 +1,9 @@
using Blazored.LocalStorage;
+using Blazored.Modal;
+using Blazored.Modal.Services;
using Blazorise.DataGrid;
using Microsoft.AspNetCore.Components;
+using ValblazeProject.Modals;
using ValblazeProject.Models;
using ValblazeProject.Services;
@@ -18,6 +21,12 @@ namespace ValblazeProject.Pages
[Inject]
public IWebHostEnvironment WebHostEnvironment { get; set; }
+ [Inject]
+ public NavigationManager NavigationManager { get; set; }
+
+ [CascadingParameter]
+ public IModalService Modal { get; set; }
+
private async Task OnReadData(DataGridReadDataEventArgs e)
{
if (e.CancellationToken.IsCancellationRequested)
@@ -31,5 +40,23 @@ namespace ValblazeProject.Pages
totalItem = await DataService.Count();
}
}
+ private async void OnDelete(int id)
+ {
+ var parameters = new ModalParameters();
+ parameters.Add(nameof(Item.Id), id);
+
+ var modal = Modal.Show("Delete Confirmation", parameters);
+ var result = await modal.Result;
+
+ if (result.Cancelled)
+ {
+ return;
+ }
+
+ await DataService.Delete(id);
+
+ // Reload the page
+ NavigationManager.NavigateTo("list", true);
+ }
}
}
diff --git a/ValblazeProject/Pages/ThemedCounter.razor b/ValblazeProject/Pages/ThemedCounter.razor
new file mode 100644
index 0000000..5cb97dc
--- /dev/null
+++ b/ValblazeProject/Pages/ThemedCounter.razor
@@ -0,0 +1,31 @@
+@page "/themed-counter"
+@using ValblazeProject.UIThemeClasses
+
+
Themed Counter
+
+
Current count: @currentCount
+
+
+
+
+
+
+
+
+
+@code {
+ private int currentCount = 0;
+
+ [CascadingParameter]
+ protected ThemeInfo? ThemeInfo { get; set; }
+
+ private void IncrementCount()
+ {
+ currentCount++;
+ }
+}
\ No newline at end of file
diff --git a/ValblazeProject/Pages/_Layout.cshtml b/ValblazeProject/Pages/_Layout.cshtml
index 32be267..5f604c0 100644
--- a/ValblazeProject/Pages/_Layout.cshtml
+++ b/ValblazeProject/Pages/_Layout.cshtml
@@ -34,5 +34,9 @@
+
+
+
+