Skip to content

Commit

Permalink
RX State
Browse files Browse the repository at this point in the history
Disabled with parameter
  • Loading branch information
Bernhard Straub committed Feb 19, 2024
1 parent 531feab commit b31b42e
Show file tree
Hide file tree
Showing 28 changed files with 110 additions and 69 deletions.
4 changes: 2 additions & 2 deletions RxMudBlazorLight/Buttons/MudButtonPRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
public Color? CancelColor { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

private RenderFragment RenderBase() => builder => base.BuildRenderTree(builder);
private ButtonPRx<T>? _buttonPRx;
private Color _buttonColor;

protected override void OnInitialized()
{
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.DEFAULT, ValueFactoryAsync, Color, ChildContent, CancelText, CancelColor, DisabledFactory);
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.DEFAULT, ValueFactoryAsync, Color, ChildContent, CancelText, CancelColor, Context);

Check failure on line 28 in RxMudBlazorLight/Buttons/MudButtonPRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'
_buttonColor = Color;

base.OnInitialized();
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/Buttons/MudButtonRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
public Color? CancelColor { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

private RenderFragment RenderBase() => builder => base.BuildRenderTree(builder);
private ButtonRx<T>? _buttonRx;
private Color _buttonColor;

protected override void OnInitialized()
{
_buttonRx = ButtonRx<T>.Create(MBButtonType.DEFAULT, ConfirmExecutionAsync, Color, ChildContent, CancelText, CancelColor, DisabledFactory);
_buttonRx = ButtonRx<T>.Create(MBButtonType.DEFAULT, ConfirmExecutionAsync, Color, ChildContent, CancelText, CancelColor, Context);

Check failure on line 28 in RxMudBlazorLight/Buttons/MudButtonRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'
_buttonColor = Color;

base.OnInitialized();
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Dialogs/DialogAsyncPRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<MudButton Disabled=@CanNotCancel() Variant="Variant.Filled" Color=@(SuccessOnConfirm ? Color.Error : Color.Success) OnClick="Cancel">@CancelButton</MudButton>
<MudButtonPRx @ref=_buttonRef Variant="Variant.Filled" Color=@(SuccessOnConfirm ? Color.Success : Color.Error)
T=@TParam StateTransformer=@StateTransformer ValueFactoryAsync=@ValueFactoryAsync
CancelColor=@CancelColor CancelText=@CancelText DisabledFactory=@DisabledFactory>
CancelColor=@CancelColor CancelText=@CancelText Context=@Context>
@ConfirmButton
</MudButtonPRx>
</DialogActions>
Expand Down
6 changes: 3 additions & 3 deletions RxMudBlazorLight/Dialogs/DialogAsyncPRx.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public partial class DialogAsyncPRx<TService, TParam> : RxBLServiceChangeSubscri
public Color? CancelColor { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public TParam? Context { get; set; }

private MudButtonPRx<TParam>? _buttonRef;
private IDisposable? _buttonDisposable;
Expand All @@ -44,15 +44,15 @@ public partial class DialogAsyncPRx<TService, TParam> : RxBLServiceChangeSubscri
public static async Task<bool> Show(IDialogService dialogService,
IStateTransformer<TParam> stateTransformer, Func<IStateTransformer<TParam>, Task> valueFactoryAsync, string title,
string message, string confirmButton, string cancelButton, bool successOnConfirm,
string? cancelText = null, Color? cancelColor = null, Func<bool> ? disabledFactory = null)
string? cancelText = null, Color? cancelColor = null, TParam? context = default)
{
var parameters = new DialogParameters
{
["StateTransformer"] = stateTransformer,
["ValueFactoryAsync"] = valueFactoryAsync,
["CancelText"] = cancelText,
["CancelColor"] = cancelColor,
["DisabledFactory"] = disabledFactory,
["Context"] = context,
["Message"] = message,
["ConfirmButton"] = confirmButton,
["CancelButton"] = cancelButton,
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Dialogs/DialogAsyncRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<DialogActions>
<MudButton Disabled=@CanNotCancel() Variant="Variant.Filled" Color=@(SuccessOnConfirm ? Color.Error : Color.Success) OnClick="Cancel">Cancel</MudButton>
<MudButtonRx @ref=_buttonRef Variant="Variant.Filled" Color=@(SuccessOnConfirm ? Color.Success : Color.Error)
StateProvider=@StateProvider CancelColor=@CancelColor CancelText=@CancelText DisabledFactory=@DisabledFactory>
T=@TParam StateProvider=@StateProvider CancelColor=@CancelColor CancelText=@CancelText Context=@Context>
@ConfirmButton
</MudButtonRx>
</DialogActions>
Expand Down
6 changes: 3 additions & 3 deletions RxMudBlazorLight/Dialogs/DialogAsyncRx.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public partial class DialogAsyncRx<TService, TParam> : RxBLServiceChangeSubscrib
public Color? CancelColor { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public TParam? Context { get; set; }

private MudButtonRx<TParam>? _buttonRef;
private IDisposable? _buttonDisposable;
Expand All @@ -41,14 +41,14 @@ public partial class DialogAsyncRx<TService, TParam> : RxBLServiceChangeSubscrib
public static async Task<bool> Show(IDialogService dialogService,
IStateProvider<TParam> stateProvider, string title,
string message, string confirmButton, string cancelButton, bool successOnConfirm,
string? cancelText = null, Color? cancelColor = null, Func<bool>? disabledFactory = null)
string? cancelText = null, Color? cancelColor = null, TParam? context = default)
{
var parameters = new DialogParameters
{
["StateProvider"] = stateProvider,
["CancelColor"] = cancelColor,
["CancelText"] = cancelText,
["DisabledFactory"] = disabledFactory,
["Context"] = context,
["Message"] = message,
["ConfirmButton"] = confirmButton,
["CancelButton"] = cancelButton,
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/FabButtons/MudFabPRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public Color? CancelColor { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

[Parameter]
public MBIconVariant? IconVariant { get; set; }
Expand All @@ -31,7 +31,7 @@

protected override void OnInitialized()
{
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.FAB, ValueFactoryAsync, Color, null, CancelText, CancelColor, DisabledFactory);
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.FAB, ValueFactoryAsync, Color, null, CancelText, CancelColor, Context);

Check failure on line 34 in RxMudBlazorLight/FabButtons/MudFabPRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

base.OnInitialized();
}
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/FabButtons/MudFabRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public Color? CancelColor { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

[Parameter]
public MBIconVariant? IconVariant { get; set; }
Expand All @@ -30,7 +30,7 @@

protected override void OnInitialized()
{
_buttonRx = ButtonRx<T>.Create(MBButtonType.FAB, ConfirmExecutionAsync, Color, null, CancelText, CancelColor, DisabledFactory);
_buttonRx = ButtonRx<T>.Create(MBButtonType.FAB, ConfirmExecutionAsync, Color, null, CancelText, CancelColor, Context);

Check failure on line 33 in RxMudBlazorLight/FabButtons/MudFabRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

base.OnInitialized();
}
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/IconButtons/MudIconButtonPRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
public MBIconVariant? IconVariant { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

private RenderFragment RenderBase() => builder => base.BuildRenderTree(builder);
private ButtonPRx<T>? _buttonPRx;

protected override void OnInitialized()
{
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.ICON, ValueFactoryAsync, Color, null, null, null, DisabledFactory);
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.ICON, ValueFactoryAsync, Color, null, null, null, Context);

Check failure on line 27 in RxMudBlazorLight/IconButtons/MudIconButtonPRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

base.OnInitialized();
}
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/IconButtons/MudIconButtonRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
public MBIconVariant? IconVariant { get; set; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

private RenderFragment RenderBase() => builder => base.BuildRenderTree(builder);
private ButtonRx<T>? _buttonRx;

protected override void OnInitialized()
{
_buttonRx = ButtonRx<T>.Create(MBButtonType.ICON, ConfirmExecutionAsync, Color, null, null, null, DisabledFactory);
_buttonRx = ButtonRx<T>.Create(MBButtonType.ICON, ConfirmExecutionAsync, Color, null, null, null, Context);

Check failure on line 27 in RxMudBlazorLight/IconButtons/MudIconButtonRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

base.OnInitialized();
}
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudAutocompleteRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Text = Value.ToString();
}

Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

Check warning on line 38 in RxMudBlazorLight/Inputs/MudAutocompleteRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

base.OnParametersSet();
}
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudCheckBoxRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Value = RxState.Value;
}

Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

Check warning on line 32 in RxMudBlazorLight/Inputs/MudCheckBoxRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

base.OnParametersSet();
}
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudNumericFieldRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Value = RxState.Value;
Text = Value.ToString();
}
Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

Check warning on line 35 in RxMudBlazorLight/Inputs/MudNumericFieldRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

base.OnParametersSet();
}
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudRatingRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
SelectedValue = RxState.Value;
}

Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;
base.OnParametersSet();
}
}
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudSliderRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Value = RxState.Value;
}

Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

Check warning on line 32 in RxMudBlazorLight/Inputs/MudSliderRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.
base.OnParametersSet();
}
}
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudSwitchRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Value = RxState.Value;
}

Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

Check warning on line 32 in RxMudBlazorLight/Inputs/MudSwitchRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

Check warning on line 32 in RxMudBlazorLight/Inputs/MudSwitchRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

base.OnParametersSet();
}
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/Inputs/MudTextFieldRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Text = Value.ToString();
}

Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

Check warning on line 38 in RxMudBlazorLight/Inputs/MudTextFieldRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

Check warning on line 38 in RxMudBlazorLight/Inputs/MudTextFieldRx.razor

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

base.OnParametersSet();
}
Expand Down
3 changes: 2 additions & 1 deletion RxMudBlazorLight/Inputs/Radio/MudRadioGroupBaseRx.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.VisualBasic;
using MudBlazor;
using RxBlazorLightCore;

Expand Down Expand Up @@ -51,7 +52,7 @@ protected override void OnParametersSet()
Value = RxStateGroupBase.Value;
ValueChanged = EventCallback.Factory.Create<T>(this, RxStateGroupBase.Transform);
}
Disabled = !RxStateGroupBase.CanRun || RxStateGroupBase.Phase is StateChangePhase.CHANGING;
Disabled = !RxStateGroupBase.CanTransform(RxStateGroupBase.Value) || RxStateGroupBase.Phase is StateChangePhase.CHANGING;

Check warning on line 55 in RxMudBlazorLight/Inputs/Radio/MudRadioGroupBaseRx.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

base.OnParametersSet();
}
Expand Down
5 changes: 3 additions & 2 deletions RxMudBlazorLight/Inputs/Select/MudSelectBaseRx.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.VisualBasic;
using MudBlazor;
using RxBlazorLightCore;

Expand All @@ -24,7 +25,7 @@ protected override void OnParametersSet()
}

ValueChanged = EventCallback.Factory.Create<T>(this, RxStateGroupBase.Transform);
Disabled = !RxStateGroupBase.CanRun;
Disabled = !RxStateGroupBase.CanTransform(RxStateGroupBase.Value);

Check warning on line 28 in RxMudBlazorLight/Inputs/Select/MudSelectBaseRx.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'bool IStateTransformer<T>.CanTransform(T value)'.

if (ChildContent is null)
{
Expand All @@ -48,7 +49,7 @@ protected override void OnParametersSet()
};
}

Disabled = !RxStateGroupBase.CanRun || RxStateGroupBase.Phase is StateChangePhase.CHANGING;
Disabled = !RxStateGroupBase.CanTransform(RxStateGroupBase.Value) || RxStateGroupBase.Phase is StateChangePhase.CHANGING;

base.OnParametersSet();
}
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/Menus/MudMenuItemPRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
public required Func<IStateTransformer<T>, Task> ValueFactoryAsync { get; init; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

private RenderFragment RenderBase() => builder => base.BuildRenderTree(builder);
private ButtonPRx<T>? _buttonPRx;

protected override void OnInitialized()
{
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.DEFAULT, ValueFactoryAsync, Color.Default, null, null, null, DisabledFactory);
_buttonPRx = ButtonPRx<T>.Create(MBButtonType.DEFAULT, ValueFactoryAsync, Color.Default, null, null, null, Context);

Check failure on line 21 in RxMudBlazorLight/Menus/MudMenuItemPRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

Check failure on line 21 in RxMudBlazorLight/Menus/MudMenuItemPRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

base.OnInitialized();
}
Expand Down
4 changes: 2 additions & 2 deletions RxMudBlazorLight/Menus/MudMenuItemRx.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
public Func<Task<bool>>? ConfirmExecutionAsync { get; init; }

[Parameter]
public Func<bool>? DisabledFactory { get; set; }
public T? Context { get; set; }

private RenderFragment RenderBase() => builder => base.BuildRenderTree(builder);
private ButtonRx<T>? _buttonRx;

protected override void OnInitialized()
{
_buttonRx = ButtonRx<T>.Create(MBButtonType.DEFAULT, ConfirmExecutionAsync, Color.Default, null, null, null, DisabledFactory);
_buttonRx = ButtonRx<T>.Create(MBButtonType.DEFAULT, ConfirmExecutionAsync, Color.Default, null, null, null, Context);

Check failure on line 21 in RxMudBlazorLight/Menus/MudMenuItemRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'

Check failure on line 21 in RxMudBlazorLight/Menus/MudMenuItemRx.razor

View workflow job for this annotation

GitHub Actions / build

Argument 7: cannot convert from 'T' to 'System.Func<bool>?'
base.OnInitialized();
}

Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/RxMudBlazorLight.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageTags>Blazor,MudBlazor,Rx,Reactive</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>..\Nuget</PackageOutputPath>
<PackageVersion>0.9.0</PackageVersion>
<PackageVersion>0.9.1</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{
Toggled = RxState.Value;
ToggledChanged = EventCallback.Factory.Create<bool>(this, v => RxState.Transform(v));
Disabled = !RxState.CanRun || RxState.Phase is StateChangePhase.CHANGING;
Disabled = !RxState.CanTransform(RxState.Value) || RxState.Phase is StateChangePhase.CHANGING;

base.OnParametersSet();
}
Expand Down
8 changes: 4 additions & 4 deletions RxMudBlazorLightTestBase/Components/ButtonTest.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<MudStack Row=@true AlignItems=@AlignItems.Center>
<MudButtonRx Color="Color.Primary" Variant="Variant.Filled" StateProvider=@Service.Increment ConfirmExecutionAsync=@ConfirmIncrement>Increment</MudButtonRx>
<MudButtonPRx Color="Color.Primary" Variant="Variant.Filled" ValueFactoryAsync=@DVFA.Factory(5) StateTransformer=@Service.Add>Add 5</MudButtonPRx>
<MudButtonRx Color="Color.Secondary" Variant="Variant.Filled" StateProvider=@Service.IncrementAsync DisabledFactory=@(() => Service.IncrementAsync.CanProvide(4))>IncrementAsync</MudButtonRx>
<MudButtonRx Color="Color.Secondary" Variant="Variant.Filled" StateProvider=@Service.IncrementAsync Context=@(4)>IncrementAsync</MudButtonRx>
<MudButtonPRx Color="Color.Secondary" Variant="Variant.Filled" StateTransformer=@Service.AddAsync ValueFactoryAsync=@DoPrepareAddAsync CancelColor=Color.Error CancelText="Cancel Add">
AddAsync 2
</MudButtonPRx>
Expand All @@ -37,7 +37,7 @@
<MudFabPRx Color="Color.Secondary" EndIcon="@Icons.Material.Filled.Add" StateTransformer=@Service.AddAsync ValueFactoryAsync=@DoPrepareAddAsync Label="AddAsync 10" />
</MudStack>

<RxBLServiceScope TScope=@TestService.SubScope TService=@TestService>
<RxBLServiceScope TScope=@TestService.Scope TService=@TestService>
<IconButtons />
</RxBLServiceScope>

Expand Down Expand Up @@ -127,11 +127,11 @@
if (parameter is null)
{
return await DialogAsyncRx<TestService, int>.Show(DialogService, Service.IncrementAsync,
"Increment", "Increment counter.", "Increment", "Cancel", false, null, null, () => Service.CountState.Value > 2);
"Increment", "Increment counter.", "Increment", "Cancel", false, null, null, 2);
}

return await DialogAsyncPRx<TestService, int>.Show(DialogService, Service.AddAsync, DVFA.Factory((int)parameter),
$"Add {parameter}", $"Add {parameter} to counter?", $"Add {parameter}", "Cancel", true, "Cancel adding!", Color.Error, () => Service.CountState.Value > 3);
$"Add {parameter}", $"Add {parameter} to counter?", $"Add {parameter}", "Cancel", true, "Cancel adding!", Color.Error, 3);
}

private async Task DoPrepareAddRemoveAsync(IStateTransformer<int> st)
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLightTestBase/Components/IconButtons.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
public required TestService Service { get; init; }

[CascadingParameter]
public required TestService.SubScope Scope { get; init; }
public required TestService.Scope Scope { get; init; }
}
Loading

0 comments on commit b31b42e

Please sign in to comment.