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"/>
</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.ColumnDefinitions>

@ -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)
{

@ -22,10 +22,11 @@
<VerticalStackLayout BackgroundColor="Black" Grid.Column="0" 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>
<ViewCell>
<Border MinimumWidthRequest="200" Margin="10, 10, 10, 10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
@ -34,7 +35,7 @@
<RowDefinition Height="auto"/>
</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"/>
<Grid Grid.Row="2">
@ -59,15 +60,10 @@
</Grid>
<Label TextColor="White" FontSize="15" Margin="5" FontFamily="arial" Text="{Binding Description}" Grid.Row="3"/>
</Grid>
</ViewCell>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView>
</ContentPage>

@ -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)

Loading…
Cancel
Save