Skip to content

Passing data from MudDialog back to parent #5013

Discussion options

You must be logged in to vote

This is what I use to pass parameters, launch and receive an object back from a dialog

private async Task OpenDialog()
{
    var parameters = new DialogParameters { ["DialogParameter"] = objectToPassThrough};
    var dialog = dialogService.Show<NameOfYourDialog>("Title of the dialog", parameters);
    var result = await dialog.Result;

    if (!result.Cancelled)
    {
          result.Data //This will be your received object
          //Do what ever you need to with the received object
    }
}

Then from your table within your dialog you can add a button to the row or a on row click event (not sure about double click) to run what ever code you need and then close the dialog with this:

Mud…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zhongyousun
Comment options

@jcaruso001
Comment options

@ScarletKuro
Comment options

Answer selected by DoubleD82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants