Call a method with the OK confirmation button in a dialog

Hello
When I click to a button I want, that a simple dialog box opens with the buttons "OK" and "Cancel". With "Cancel" the dialog shall close and with "OK" a method in my blazor razor.cs page shall be executed (My_Method). This method will navigate to another razor page, so the dialog box will automatically close. I have tried with following code and it is generally working. But there is just one small problem:
The execution of "My_Method" ( to change to another razor page) takes up to 2-3 seconds. In this case the dialog closes after 2-3 seconds. How can I close the dialog box immediatly with pressing "OK" button. With other words for Click I want to define in parallel (to calling the method) also the "ds.Close" action. How can I do that?

public async Task Open_Connect_Dialog(Int32 index)
{

    var result = await DialogService.OpenAsync("Connect to Machine" + , ds =>
@<RadzenStack Gap="1.5rem">        
    <RadzenStack Orientation="Radzen.Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center" JustifyContent="Radzen.JustifyContent.SpaceBetween">
        <RadzenStack Orientation="Radzen.Orientation.Horizontal">
            <RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">"Dou you want to connect to" + TagService.Mach_Ovw_Connect_resquest_selected_MAE</RadzenText>
            <RadzenButton Text="Ok" Click="() => My_Method()" Style="width: 80px;" />
            <RadzenButton Text="Cancel" Click="() => ds.Close(true)" ButtonStyle="ButtonStyle.Light" />
        </RadzenStack>            
    </RadzenStack>
    </RadzenStack>
);
}

Something like this:

Click="() => { ds.Close(true); My_Method(); }