Hello,
Welcome to our Microsoft Q&A platform!
Please change the code like following format.
public Command ConfirmLogoutCommand { get; }
public LogoutPageViewModel()
{
ConfirmLogoutCommand = new Command( ExecuteConfirmLogoutCommand);
}
private async void ExecuteConfirmLogoutCommand()
{
await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
}
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
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.