I have implemented xamarin project using MVVM. I wrote button click command in view model. I am trying to open a Displayactionsheet using below code on the button click but Actionsheet is not opening in IOS but in Android it is working fine. If I put the same code in View.cs file then it is working fine in IOS as well. But if I put same code in viewmodel why Action sheet is not opening?
String[] LogInOptions = {"Option1", "Option2"};
var action = await App.Current.MainPage..DisplayActionSheet("Log In","Cancel","",LogInOptions);
switch(action) {
case "Option1" : {
break; }
case "Option2" : {
break; }
}