Counter: @ViewModel.Counter.Value
+Doubled: @ViewModel.Doubled.Value
+ + +Loading...
+} else { +Counter: @ViewModel.Counter.Value
+Doubled: @ViewModel.Doubled.Value
+ + +Current Count = @CurrentCount
+ diff --git a/src/BlazeKit.Website.Islands/Components/MyCounter.razor.cs b/src/BlazeKit.Website.Islands/Components/MyCounter.razor.cs new file mode 100644 index 0000000..aa22a8b --- /dev/null +++ b/src/BlazeKit.Website.Islands/Components/MyCounter.razor.cs @@ -0,0 +1,6 @@ +namespace BlazeKit.Website.Islands; + +public partial class MyCounter : BlzInteractive +{ + +} diff --git a/src/BlazeKit.Website.Islands/_Imports.razor b/src/BlazeKit.Website.Islands/_Imports.razor index d4bdf8a..9407a11 100644 --- a/src/BlazeKit.Website.Islands/_Imports.razor +++ b/src/BlazeKit.Website.Islands/_Imports.razor @@ -10,3 +10,4 @@ @using BlazeKit.Reactivity @using BlazeKit.Reactivity.Signals @using BlazeKit.Reactivity.Blazor +@using static Microsoft.AspNetCore.Components.Web.RenderMode diff --git a/src/BlazeKit.Website/AppRouter.razor b/src/BlazeKit.Website/AppRouter.razor index fd64836..64f15f0 100644 --- a/src/BlazeKit.Website/AppRouter.razor +++ b/src/BlazeKit.Website/AppRouter.razor @@ -1,5 +1,3 @@ -@using BlazeKit.Site; -@using BlazeKit.Site.Pages;
diff --git a/src/BlazeKit.Website/Routes/Reactivity/MVVM/Page.razor b/src/BlazeKit.Website/Routes/Reactivity/MVVM/Page.razor
index 9b04438..c7ab340 100644
--- a/src/BlazeKit.Website/Routes/Reactivity/MVVM/Page.razor
+++ b/src/BlazeKit.Website/Routes/Reactivity/MVVM/Page.razor
@@ -1,14 +1,4 @@
-@using BlazeKit.Site.Pages.Reactivity.MVVM
@code {
- public VMCounter ViewModel { get; set; }
-
- public Page()
- { }
-
- override protected void OnInitialized()
- {
- ViewModel = new VMCounter(this);
- }
private MarkupString AsHtml(string code)
{
@@ -17,12 +7,9 @@
}
Model View ViewModel
You can even use an MVVM pattern if you like 👍
-
- Counter: @ViewModel.Counter.Value
- Doubled: @ViewModel.Doubled.Value
-
-
-
+
+
+
Code Example
diff --git a/src/BlazeKit.Website/_Imports.razor b/src/BlazeKit.Website/_Imports.razor
index 126bc4b..547234c 100644
--- a/src/BlazeKit.Website/_Imports.razor
+++ b/src/BlazeKit.Website/_Imports.razor
@@ -4,7 +4,6 @@
@using Microsoft.AspNetCore.Components.Web
@* @using Microsoft.AspNetCore.Components.WebAssembly.Http *@
@using Microsoft.JSInterop
-@using BlazeKit.Site
@using BlazeKit.Website.Components
@using BlazeKit.Website
@using BlazeKit.Website.Islands.Components
diff --git a/src/BlazeKit.Website/appsettings.Development.json b/src/BlazeKit.Website/appsettings.Development.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/src/BlazeKit.Website/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/src/BlazeKit.Website/appsettings.json b/src/BlazeKit.Website/appsettings.json
new file mode 100644
index 0000000..10f68b8
--- /dev/null
+++ b/src/BlazeKit.Website/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}