From d83c519a2259a3b0195d48d36860b939725b3afb Mon Sep 17 00:00:00 2001 From: Anu6is Date: Tue, 28 May 2024 09:56:08 -0400 Subject: [PATCH 1/2] Migrate to MudBlazor v7 --- .../Components/MyMudProviders.razor | 2 +- .../Components/MyMudThemeProvider.razor | 6 ++---- .../StaticSample.Client/StaticSample.Client.csproj | 2 +- demo/StaticSample/StaticSample/StaticSample.csproj | 1 - src/Components/MudStaticButton.razor | 2 +- src/Components/MudStaticButton.razor.cs | 6 +----- src/Components/MudStaticCheckBox.razor | 2 +- src/Components/MudStaticCheckBox.razor.cs | 3 +-- src/Components/MudStaticSwitch.razor | 2 +- src/Components/MudStaticSwitch.razor.cs | 9 ++++----- src/Components/MudStaticTextField.razor | 8 ++++---- src/Components/MudStaticTextField.razor.cs | 2 -- src/MudBlazor.StaticInput.csproj | 2 +- .../Components/Layout/MainLayout.razor | 2 +- .../Components/Tests/CheckBox/CheckBoxColorsTest.razor | 2 +- .../Components/Tests/Switch/SwitchColorsTest.razor | 2 +- .../StaticInput.UnitTests/Components/TextFieldTests.cs | 10 +++++----- 17 files changed, 26 insertions(+), 37 deletions(-) diff --git a/demo/StaticSample/StaticSample.Client/Components/MyMudProviders.razor b/demo/StaticSample/StaticSample.Client/Components/MyMudProviders.razor index 847ca7c..e95c615 100644 --- a/demo/StaticSample/StaticSample.Client/Components/MyMudProviders.razor +++ b/demo/StaticSample/StaticSample.Client/Components/MyMudProviders.razor @@ -1,6 +1,6 @@ @inject ISnackbar Snackbar - + diff --git a/demo/StaticSample/StaticSample.Client/Components/MyMudThemeProvider.razor b/demo/StaticSample/StaticSample.Client/Components/MyMudThemeProvider.razor index 963d5dd..97a8f0a 100644 --- a/demo/StaticSample/StaticSample.Client/Components/MyMudThemeProvider.razor +++ b/demo/StaticSample/StaticSample.Client/Components/MyMudThemeProvider.razor @@ -1,11 +1,9 @@ - - - + @code { public static MudTheme MyTheme => new() { - Palette = new PaletteLight() + PaletteLight = new PaletteLight() { Primary = Colors.Teal.Default, AppbarBackground = Colors.Teal.Default diff --git a/demo/StaticSample/StaticSample.Client/StaticSample.Client.csproj b/demo/StaticSample/StaticSample.Client/StaticSample.Client.csproj index 706819a..af52e49 100644 --- a/demo/StaticSample/StaticSample.Client/StaticSample.Client.csproj +++ b/demo/StaticSample/StaticSample.Client/StaticSample.Client.csproj @@ -11,7 +11,7 @@ - + diff --git a/demo/StaticSample/StaticSample/StaticSample.csproj b/demo/StaticSample/StaticSample/StaticSample.csproj index 6f2b8c2..fe865d7 100644 --- a/demo/StaticSample/StaticSample/StaticSample.csproj +++ b/demo/StaticSample/StaticSample/StaticSample.csproj @@ -17,7 +17,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/Components/MudStaticButton.razor b/src/Components/MudStaticButton.razor index 5822069..da4b8ca 100644 --- a/src/Components/MudStaticButton.razor +++ b/src/Components/MudStaticButton.razor @@ -62,7 +62,7 @@ else ; } - private RenderFragment RenderHiddenReturnUrl() + private RenderFragment? RenderHiddenReturnUrl() { if (!string.IsNullOrEmpty(ReturnUrl)) { diff --git a/src/Components/MudStaticButton.razor.cs b/src/Components/MudStaticButton.razor.cs index be43704..8dd6fe5 100644 --- a/src/Components/MudStaticButton.razor.cs +++ b/src/Components/MudStaticButton.razor.cs @@ -1,5 +1,4 @@ -using System.Windows.Input; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; namespace MudBlazor.StaticInput; @@ -14,10 +13,7 @@ public partial class MudStaticButton : MudButton protected new ButtonType ButtonType { get; set; } protected new string HtmlTag { get; set; } = "button"; protected new string? Href { get; set; } - protected new string? Link { get; set; } protected new string? Target { get; set; } - protected new ICommand? Command { get; set; } protected new bool ClickPropagation { get; set; } - protected new object? CommandParameter { get; set; } protected new EventCallback OnClick { get; set; } } \ No newline at end of file diff --git a/src/Components/MudStaticCheckBox.razor b/src/Components/MudStaticCheckBox.razor index 0dfad7d..2cead7e 100644 --- a/src/Components/MudStaticCheckBox.razor +++ b/src/Components/MudStaticCheckBox.razor @@ -12,7 +12,7 @@ id="@($"static-checkbox-{_elementId}")" disabled="@GetDisabledState()" @onclick:preventDefault="@GetReadOnlyState()"/>