Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

ToolbarItem MVVM command

$
0
0

I have been struggeling with this.
I'm trying to move my toolbar item commands to my viewmodel
Right now my code is like this

` public class SwipePageViewModel : BaseViewModel
{
public ICommand ShowBaskedCommand { get; private set; }

    public SwipePageViewModel()
    {
        ShowBaskedCommand = new Command(ShowBasket);
    }

    private void ShowBasket()
    {
        Navigation.PushAsync(new HomePage() {Title = AppResources.Page2});
    }

}`

My problem is that Navigation is not found in my view model. And therefore I can't push my view.
What to do?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>