Hello,
After testing, you could follow these steps to implement this requirement.
Step 1. Implement singletons and methods that need to be called in Index.razor.
@code {
public static Index Instance{ get; private set; }
public Index()
{
Instance = this;
}
public void ConsoleTest()
{
Console.WriteLine("test");
}
}
Step 2. Call ConsoleTest
from OnWebViewGoToRepoClicked()
var i = Pages.Index.Instance;
i.ConsoleTest();
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.