Displaying pop-up message to the screen, but from within ViewModel?

ljubinkovicdljubinkovicd USMember
edited November 2016 in Xamarin.Forms

Hi everyone,

I am having trouble displaying the pop-up message to the screen. The main reason why is because I don't want to display a message from Page class, but from view model. So, what I am doing is this:

ItemTappedCommand = new Command(() => { var item = LastTappedItem as SimpleItem; if (item != null) { Debug.WriteLine("Tapped {0}", item.ToString()); // I'd like to display a pop-up message here. Something like: DisplayPopUpMessage(item.toString()); } });

I'm using XAMVVM and this class implements BasePageModel. So, my question is, is it even possible to do something like DisplayAlert function from Page class, but from within the view model class?



Sign In or Register to comment.