Binding de la game list
continuous-integration/drone/push Build is passing Details

Popup_qui_marche_pas
Anthony RICHARD 2 years ago
parent 06cf81f6b3
commit d3b2ce4b12

@ -34,7 +34,7 @@
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image Margin="0, 10, 0, 0" Source="eldenring.jpg"/> <Image Margin="0, 10, 0, 0" Source="{Binding Cover}"/>
<Grid Grid.Column="2" Padding="5"> <Grid Grid.Column="2" Padding="5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

@ -1,10 +1,13 @@
using Model;
namespace Stim; namespace Stim;
public partial class DetailledPage : ContentPage public partial class DetailledPage : ContentPage
{ {
public DetailledPage() public DetailledPage(Game game)
{ {
InitializeComponent(); InitializeComponent();
BindingContext = game;
} }
private async void goToMainPage(object sender, EventArgs e) private async void goToMainPage(object sender, EventArgs e)
{ {

@ -22,10 +22,11 @@
<VerticalStackLayout BackgroundColor="Black" Grid.Column="0" Grid.Row="1"/> <VerticalStackLayout BackgroundColor="Black" Grid.Column="0" Grid.Row="1"/>
<VerticalStackLayout BackgroundColor="Black" Grid.Column="2" Grid.Row="1"/> <VerticalStackLayout BackgroundColor="Black" Grid.Column="2" Grid.Row="1"/>
<ListView ItemsSource="{Binding Games}" Grid.Column="1">
<ListView.ItemTemplate> <CollectionView ItemsSource="{Binding Games}" SelectionMode="Single" SelectionChanged="OnClickGameList" ItemsLayout="VerticalGrid, 3" Grid.Column="1">
<CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<ViewCell> <Border MinimumWidthRequest="200" Margin="10, 10, 10, 10">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
@ -34,7 +35,7 @@
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image Source="eldenring.jpg" Aspect="AspectFit" Margin="0,0,0,0"/> <Image Source="{Binding Cover}" Aspect="AspectFit" Margin="0,0,0,0" />
<Label TextColor="White" FontAttributes="Bold" FontSize="30" Margin="5" FontFamily="arial" Text="{Binding Name}" Grid.Row="1" HorizontalTextAlignment="Center"/> <Label TextColor="White" FontAttributes="Bold" FontSize="30" Margin="5" FontFamily="arial" Text="{Binding Name}" Grid.Row="1" HorizontalTextAlignment="Center"/>
<Grid Grid.Row="2"> <Grid Grid.Row="2">
@ -59,15 +60,10 @@
</Grid> </Grid>
<Label TextColor="White" FontSize="15" Margin="5" FontFamily="arial" Text="{Binding Description}" Grid.Row="3"/> <Label TextColor="White" FontSize="15" Margin="5" FontFamily="arial" Text="{Binding Description}" Grid.Row="3"/>
</Grid> </Grid>
</ViewCell> </Border>
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </CollectionView.ItemTemplate>
</ListView> </CollectionView>
</Grid> </Grid>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>

@ -14,9 +14,9 @@ public partial class MainPage : ContentPage
BindingContext = Manager; 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) private async void goToMainPage(object sender, EventArgs e)

Loading…
Cancel
Save