essai data binding
continuous-integration/drone/push Build is failing Details

pull/34/head
Yvan CALATAYUD 2 years ago
parent 7a5353ec1c
commit 5a991c9ea4

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen> <IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
<ActiveDebugFramework>net7.0-android</ActiveDebugFramework> <ActiveDebugFramework>net7.0-android</ActiveDebugFramework>
<ActiveDebugProfile>Xiaomi 2201117SY (Android 12.0 - API 31)</ActiveDebugProfile> <ActiveDebugProfile>Google Pixel 6a (Android 13.0 - API 33)</ActiveDebugProfile>
<SelectedPlatformGroup>PhysicalDevice</SelectedPlatformGroup> <SelectedPlatformGroup>PhysicalDevice</SelectedPlatformGroup>
<DefaultDevice>pixel_5_-_api_33_1</DefaultDevice> <DefaultDevice>pixel_5_-_api_33_1</DefaultDevice>
</PropertyGroup> </PropertyGroup>

@ -4,6 +4,6 @@
x:Class="GameAtlas.Views.Composants.BoutonVoir"> x:Class="GameAtlas.Views.Composants.BoutonVoir">
<Button Text="Voir" FontFamily="PTSansNarrow-Bold" FontSize="16" BackgroundColor="#FF4D00" HeightRequest="45" WidthRequest="93" Scale="0.85" CornerRadius="25" /> <Button Text="Voir" FontFamily="PTSansNarrow-Bold" FontSize="16" BackgroundColor="#FF4D00" HeightRequest="45" WidthRequest="93" Scale="0.85" CornerRadius="25" Clicked="OnVoirClicked" />
</ContentView> </ContentView>

@ -6,4 +6,9 @@ public partial class BoutonVoir : ContentView
{ {
InitializeComponent(); InitializeComponent();
} }
private async void OnVoirClicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(PageJeu));
}
} }

@ -4,7 +4,7 @@
x:Class="GameAtlas.Views.PageJeu" x:Class="GameAtlas.Views.PageJeu"
Title="PageJeu"> Title="PageJeu">
<Grid x:Name="outerGrid"> <Grid x:Name="outerGrid" BindingContext="{Binding JeuManager}">
<Grid.Background> <Grid.Background>
<LinearGradientBrush EndPoint="1,0"> <LinearGradientBrush EndPoint="1,0">
@ -29,13 +29,13 @@
<Shadow Brush="Black" Offset="0,4" Radius="4" Opacity="0.4" /> <Shadow Brush="Black" Offset="0,4" Radius="4" Opacity="0.4" />
</Border.Shadow> </Border.Shadow>
<Frame HasShadow="False" CornerRadius="5" IsClippedToBounds="True"> <Frame HasShadow="False" CornerRadius="5" IsClippedToBounds="True">
<Image Source="https://cdn1.epicgames.com/offer/e97659b501af4e3981d5430dad170911/EGS_HogwartsLegacy_AvalancheSoftware_S1_2560x1440-2baf3188eb3c1aa248bcc1af6a927b7e" Aspect="AspectFill"/> <Image Source="{Binding JeuManager}" Aspect="AspectFill"/>
</Frame> </Frame>
</Border> </Border>
<VerticalStackLayout Grid.Row="1" Grid.ColumnSpan="3" Padding="20" Spacing="8"> <VerticalStackLayout Grid.Row="1" Grid.ColumnSpan="3" Padding="20" Spacing="8">
<Label Text="Hogwarts Legacy - L'Héritage de Poudlard" FontFamily="PTSansCBold" FontSize="14" TextColor="{StaticResource Black}"/> <Label Text="{Binding JeuManager}" FontFamily="PTSansCBold" FontSize="14" TextColor="{StaticResource Black}"/>
<Label Text="10 février 2023" FontFamily="RobotoRegular" FontSize="11" TextColor="{StaticResource Gray500}"/> <Label Text="10 février 2023" FontFamily="RobotoRegular" FontSize="11" TextColor="{StaticResource Gray500}"/>

@ -6,11 +6,15 @@ namespace GameAtlas.Views;
public partial class PageJeu : ContentPage public partial class PageJeu : ContentPage
{ {
public Manager JeuManager => (App.Current as App).MyManager; public Jeu jeuModel { get; set; }
public Manager JeuManager { get; set; } = new Manager();
public PageJeu() public PageJeu()
{ {
InitializeComponent(); InitializeComponent();
BindingContext = this;
} }
async void Back_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e) async void Back_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)

Loading…
Cancel
Save