diff --git a/samples/InteractiveServer/Components/Pages/Animation.razor b/samples/InteractiveServer/Components/Pages/Animation.razor index 5960ddb..7dcc658 100644 --- a/samples/InteractiveServer/Components/Pages/Animation.razor +++ b/samples/InteractiveServer/Components/Pages/Animation.razor @@ -35,6 +35,8 @@ + +

@@ -65,6 +67,20 @@ Modal.Show("Animation Type: PopIn", options); } + void AnimationFadeIn() + { + var options = new ModalOptions { AnimationType = ModalAnimationType.FadeIn }; + + Modal.Show("Animation Type: FadeIn", options); + } + + void AnimationMoveInOut() + { + var options = new ModalOptions { AnimationType = ModalAnimationType.MoveInOut }; + + Modal.Show("Animation Type: MoveInOut", options); + } + void NoAnimation() { var options = new ModalOptions { AnimationType = ModalAnimationType.None }; diff --git a/samples/InteractiveServer/Components/Pages/CustomLayout.razor b/samples/InteractiveServer/Components/Pages/CustomLayout.razor index 948970e..8d746bb 100644 --- a/samples/InteractiveServer/Components/Pages/CustomLayout.razor +++ b/samples/InteractiveServer/Components/Pages/CustomLayout.razor @@ -33,6 +33,8 @@ + + @code { [CascadingParameter] public IModalService Modal { get; set; } = default!; @@ -40,8 +42,17 @@ void ShowModalCustomLayout() { var options = new ModalOptions { UseCustomLayout = true }; - var parameters = new ModalParameters {{nameof(CustomBootstrapModal.Message), "Hello custom modal!!"}}; + var parameters = new ModalParameters(); + parameters.Add(nameof(CustomBootstrapModal.Message), "Hello Bootstrap modal!!"); Modal.Show("Custom Layout", parameters, options); } + void ShowAnimatedModalCustomLayout() + { + var options = new ModalOptions { UseCustomLayout = true, AnimationType = ModalAnimationType.MoveInOut }; + var parameters = new ModalParameters(); + parameters.Add(nameof(CustomBootstrapModal.Message), "Hello Bootstrap modal!!"); + Modal.Show("Custom Layout", parameters, options); + } + } diff --git a/samples/InteractiveServer/Components/Shared/CustomAnimatedBootstrapModal.razor b/samples/InteractiveServer/Components/Shared/CustomAnimatedBootstrapModal.razor new file mode 100644 index 0000000..995ed77 --- /dev/null +++ b/samples/InteractiveServer/Components/Shared/CustomAnimatedBootstrapModal.razor @@ -0,0 +1,29 @@ +

+ +@code { + + [CascadingParameter] BlazoredModalInstance BlazoredModal { get; set; } = default!; + + [Parameter] public string? Message { get; set; } + + async Task Close() => await BlazoredModal.CloseAsync(ModalResult.Ok(true)); + async Task Cancel() => await BlazoredModal.CancelAsync(); + +} \ No newline at end of file diff --git a/samples/InteractiveServer/Components/Shared/CustomBootstrapModal.razor b/samples/InteractiveServer/Components/Shared/CustomBootstrapModal.razor index 54572a2..6f03427 100644 --- a/samples/InteractiveServer/Components/Shared/CustomBootstrapModal.razor +++ b/samples/InteractiveServer/Components/Shared/CustomBootstrapModal.razor @@ -4,9 +4,7 @@