Why my Alert do not working in IOS but in Android i working????
page.DisplayAlert(mess, "Enter any username and password" + mess, "OK");
there my solution..............
public partial class Login: ContentPage
{
LoginViewModel viewModel;
public Login ()
{
InitializeComponent ();
viewModel = new LoginViewModel ();
BindingContext = viewModel;
}
}
my XAML
<Button Text="Login" Command="{Binding OnLoginClicked}" />
public class LoginViewModel : ViewModelBase
{
public ICommand OnHelpClicked
{
get{ return onHelpClicked ?? (onHelpClicked = new Command(() => DisplayAlert()) {
});}
}
private void DisplayAlert()
{
page = new ContentPage();
var mess = "";
//if()
// mess = "Android";
if(Device.OS == TargetPlatform.Android)
mess = "Android";
if (Device.OS == TargetPlatform.iOS)
mess = "IOS";
//#if __IOS__
// mess = "IOS";
//#endif
page.DisplayAlert(mess, "Enter any username and password" + mess, "OK");
}
}