From d3b2ce4b126858ffdd040284b17c1b42b884cd90 Mon Sep 17 00:00:00 2001 From: Anthony RICHARD Date: Wed, 17 May 2023 17:34:12 +0200 Subject: [PATCH] Binding de la game list --- Sources/Stim/DetailledPage.xaml | 2 +- Sources/Stim/DetailledPage.xaml.cs | 5 ++++- Sources/Stim/MainPage.xaml | 20 ++++++++------------ Sources/Stim/MainPage.xaml.cs | 12 ++++++------ 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Sources/Stim/DetailledPage.xaml b/Sources/Stim/DetailledPage.xaml index 5686d04..178e045 100644 --- a/Sources/Stim/DetailledPage.xaml +++ b/Sources/Stim/DetailledPage.xaml @@ -34,7 +34,7 @@ - + diff --git a/Sources/Stim/DetailledPage.xaml.cs b/Sources/Stim/DetailledPage.xaml.cs index f4385bc..10924f7 100644 --- a/Sources/Stim/DetailledPage.xaml.cs +++ b/Sources/Stim/DetailledPage.xaml.cs @@ -1,10 +1,13 @@ +using Model; + namespace Stim; public partial class DetailledPage : ContentPage { - public DetailledPage() + public DetailledPage(Game game) { InitializeComponent(); + BindingContext = game; } private async void goToMainPage(object sender, EventArgs e) { diff --git a/Sources/Stim/MainPage.xaml b/Sources/Stim/MainPage.xaml index 8762bba..5ca4bcd 100644 --- a/Sources/Stim/MainPage.xaml +++ b/Sources/Stim/MainPage.xaml @@ -22,10 +22,11 @@ - - + + + - + @@ -34,7 +35,7 @@ - + - + - - - - - - - + + diff --git a/Sources/Stim/MainPage.xaml.cs b/Sources/Stim/MainPage.xaml.cs index 5e2b7c8..92a7f18 100644 --- a/Sources/Stim/MainPage.xaml.cs +++ b/Sources/Stim/MainPage.xaml.cs @@ -7,16 +7,16 @@ public partial class MainPage : ContentPage public IPersistance persistance = new Persistance(); public Manager Manager; - public MainPage() - { - InitializeComponent(); + public MainPage() + { + InitializeComponent(); Manager = new(persistance); BindingContext = Manager; - } + } - private async void Button_Clicked(object sender, EventArgs e) + private async void OnClickGameList(object sender, EventArgs e) { - await Navigation.PushAsync(new DetailledPage()); + //await Navigation.PushAsync((sender as CollectionView).SelectedItem); } private async void goToMainPage(object sender, EventArgs e)