You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
956 B
34 lines
956 B
using System;
|
|
using System.Windows.Input;
|
|
using App.Pages;
|
|
using ViewModel;
|
|
|
|
namespace App.ViewModel
|
|
{
|
|
public class ChampionListPageVM
|
|
{
|
|
public INavigation Navigation { get; set; }
|
|
|
|
public ChampionManagerVM ChampionManagerVM { get; private set; }
|
|
|
|
public ICommand NavigateToChampionDetailCommand { get; private set; }
|
|
public ICommand NaviagteToChampionAddEditPageCommand { get; private set; }
|
|
|
|
public ChampionListPageVM(ChampionManagerVM championManager)
|
|
{
|
|
ChampionManagerVM = championManager;
|
|
|
|
NavigateToChampionDetailCommand = new Command (
|
|
execute: async () => await Shell.Current.GoToAsync(nameof(ChampionDetailPage)),
|
|
canExecute: () => ChampionManagerVM is not null
|
|
);
|
|
|
|
NaviagteToChampionAddEditPageCommand = new Command(
|
|
execute: async () => await Navigation.PushModalAsync(new ChampionAddEditPage()),
|
|
canExecute: () => ChampionManagerVM is not null
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|