If you wish to show a component which requires no parameters, you can call the first overload of the ShowModal
method.
For example, if I had a component which displayed a list of movies called MovieList
. And I wanted to show it from a page component called Movies
. I would need to inject the IModalService
into the Movies
component. I could then add a button which invokes the modal.
@page "/movies"
@inject IModalService Modal
<button @onclick="@(() => Modal.Show("Movie List", typeof(MovieList)))"