MvvmCross plugin for interacting with the user from a view model.
public ICommand SubmitCommand
{
get
{
return new MvxCommand(async () =>
{
if (string.IsNullOrEmpty(FirstName))
{
await Mvx.Resolve<IUserInteraction>().AlertAsync("First Name is Required");
return;
}
//do work
});
}
}
public ICommand SubmitCommand
{
get
{
return new MvxCommand(() =>
{
if (string.IsNullOrEmpty(FirstName))
{
Mvx.Resolve<IUserInteraction>().Alert("First Name is Required");
return;
}
//do work
});
}
}
public ICommand SubmitCommand
{
get
{
return new MvxCommand(async () =>
{
if (await Mvx.Resolve<IUserInteraction>().ConfirmAsync("Are you sure?"))
{
//do work
}
});
}
}
public ICommand SubmitCommand
{
get
{
return new MvxCommand(() =>
{
Mvx.Resolve<IUserInteraction>().Confirm("Are you sure?", async () =>
{
//Do work
});
});
}
}
I will be working on a nuget package as time permits.