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.
LivreLand/LivreLand/View/TousView.xaml.cs

46 lines
935 B

using LivreLand.Model;
using LivreLand.ViewModel;
using ViewModels;
namespace LivreLand.View;
public partial class TousView : ContentPage
{
#region Properties
public TousVM TousVM { get; set; }
#endregion
#region Constructor
public TousView(TousVM tousVM)
{
TousVM = tousVM;
InitializeComponent();
BindingContext = this;
}
#endregion
#region Methods
void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.FirstOrDefault() is BookVM)
{
var result = new DetailsLivreVM(this.TousVM.Manager, e.CurrentSelection.FirstOrDefault() as BookVM);
App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView(result));
}
}
protected override void OnAppearing()
{
base.OnAppearing();
TousVM.Manager.GetBooksFromCollectionCommand.Execute(null);
}
#endregion
}