Page information bestiaire et style dynamique sur les frames objets

devGuillaume
Yoan 2 years ago
parent 201c874875
commit 9dac0222dc

@ -13,8 +13,8 @@
<ShellContent <ShellContent
ContentTemplate="{DataTemplate local:PageBestiaire}" ContentTemplate="{DataTemplate local:PageInfoBestiaire}"
Route="PageFDD" /> Route="PageInfoBestiaire" />
</Shell> </Shell>

@ -57,6 +57,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="PageInfoBestiaire.xaml.cs">
<DependentUpon>PageInfoBestiaire.xaml</DependentUpon>
</Compile>
<Compile Update="PageIle.xaml.cs"> <Compile Update="PageIle.xaml.cs">
<DependentUpon>PageIle.xaml</DependentUpon> <DependentUpon>PageIle.xaml</DependentUpon>
</Compile> </Compile>
@ -81,6 +84,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="PageInfoBestiaire.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageIle.xaml"> <MauiXaml Update="PageIle.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

@ -83,37 +83,24 @@
<Frame CornerRadius="20" <Frame Style="{StaticResource frameObjet2}">
BorderColor="#72a3b3"
BackgroundColor="#72a3b3"
Margin="20, 50" Padding="15"
WidthRequest="275"
HeightRequest="150"
Grid.Row="0"
VerticalOptions="End">
<StackLayout Orientation="Vertical" Spacing="10" VerticalOptions="Center"> <StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label <Label
Text="{Binding Nom}" Text="{Binding Nom}"
FontAttributes="Bold" FontAttributes="Bold"
FontSize="22" FontSize="22"
TextColor="White" TextColor="#72a3b3"
HorizontalOptions="Center"
/>
<Label
Text="-----------------------------"
FontAttributes="Bold"
FontSize="20"
TextColor="White"
HorizontalOptions="Center" HorizontalOptions="Center"
/> />
<Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
<Label <Label
Text="Cliquez ici pour voir en détail" Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic" FontAttributes="Bold,Italic"
FontSize="15" FontSize="15"
TextColor="White" TextColor="#72a3b3"
TextDecorations="Underline" TextDecorations="Underline"
HorizontalOptions="Center"/> HorizontalOptions="Center"/>
@ -125,18 +112,6 @@
</CollectionView> </CollectionView>
</ScrollView> </ScrollView>
</VerticalStackLayout> </VerticalStackLayout>
<!--<Rectangle WidthRequest="200" HeightRequest="300" HorizontalOptions="Start" BackgroundColor="#72a3b3">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="#cdffd8" Offset="0.0" />-->
<!--<GradientStop Color="#94b9ff" Offset="1.0" /></LinearGradientBrush></Rectangle.Fill></Rectangle>-->
</Grid> </Grid>

@ -57,7 +57,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/> <ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Frame CornerRadius="25" BackgroundColor="#e2edf1" BorderColor="#72a3b3" > <Frame Style="{StaticResource frameObjet}">
<StackLayout Orientation="Vertical" Padding="5"> <StackLayout Orientation="Vertical" Padding="5">
<Image <Image
Source="{Binding Image}" Source="{Binding Image}"

@ -30,7 +30,8 @@
<Button Style="{StaticResource buttonMenu}" Text="Bestiaire" Clicked="Hyperlink_Bestiaire"/> <Button Style="{StaticResource buttonMenu}" Text="Bestiaire" Clicked="Hyperlink_Bestiaire"/>
<Button Style="{StaticResource buttonMenu2}" Text="Équipages"/> <Button Style="{StaticResource buttonMenu2}" Text="Équipages"/>
</VerticalStackLayout> </VerticalStackLayout>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="10"> <ScrollView Grid.Row="0" Grid.Column="1" >
<VerticalStackLayout Spacing="10">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" > <Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="10*"/> <RowDefinition Height="10*"/>
@ -51,21 +52,18 @@
</Frame> </Frame>
</Grid> </Grid>
<CollectionView x:Name="listeEquip" VerticalScrollBarVisibility="Always" ItemsLayout="VerticalGrid, 4"> <CollectionView x:Name="listeEquip" ItemsLayout="VerticalGrid, 4">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20"> <Grid Padding="20" ColumnSpacing="20" RowSpacing="20">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/> <ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Frame CornerRadius="25" BackgroundColor="Black" BorderColor="Black" > <Frame Style="{StaticResource frameEquip}" >
<StackLayout Orientation="Vertical" Padding="5"> <StackLayout Orientation="Vertical" Padding="5">
<Image <Image Source="{Binding Image}"
Source="{Binding Image}"
HeightRequest="290" HeightRequest="290"
WidthRequest="290" WidthRequest="290"/>
/>
<Label <Label
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Start" VerticalOptions="Start"
@ -82,9 +80,7 @@
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView>
</Grid> </Grid>
</ContentPage> </ContentPage>

@ -7,10 +7,7 @@ public partial class PageEquipage : ContentPage
public PageEquipage() public PageEquipage()
{ {
InitializeComponent(); InitializeComponent();
List<Equipage> Lequipage = StubEquipage.RecupererEquipage().ToList(); List<Equipage> Lequipage = StubEquipage.RecupererEquipage().ToList();
listeEquip.ItemsSource = Lequipage; listeEquip.ItemsSource = Lequipage;
} }
private async void Hyperlink_Accueil(object sender, EventArgs e) private async void Hyperlink_Accueil(object sender, EventArgs e)

@ -65,9 +65,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Frame CornerRadius="25" <Frame Style="{StaticResource frameObjet}"
BackgroundColor="#e2edf1"
BorderColor="#72a3b3"
> >
<StackLayout Orientation="Vertical" Padding="5"> <StackLayout Orientation="Vertical" Padding="5">

@ -83,37 +83,23 @@
<Frame CornerRadius="20" <Frame Style="{StaticResource frameObjet2}">
BorderColor="#72a3b3"
BackgroundColor="#72a3b3"
Margin="20, 50" Padding="15"
WidthRequest="275"
HeightRequest="150"
Grid.Row="0"
VerticalOptions="End">
<StackLayout Orientation="Vertical" Spacing="10" VerticalOptions="Center"> <StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label <Label
Text="{Binding Nom}" Text="{Binding Nom}"
FontAttributes="Bold" FontAttributes="Bold"
FontSize="22" FontSize="22"
TextColor="White" TextColor="#72a3b3"
HorizontalOptions="Center" HorizontalOptions="Center"
/> />
<Label <Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
Text="-----------------------------"
FontAttributes="Bold"
FontSize="20"
TextColor="White"
HorizontalOptions="Center"
/>
<Label <Label
Text="Cliquez ici pour voir en détail" Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic" FontAttributes="Bold,Italic"
FontSize="15" FontSize="15"
TextColor="White" TextColor="#72a3b3"
TextDecorations="Underline" TextDecorations="Underline"
HorizontalOptions="Center"/> HorizontalOptions="Center"/>

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageInfoBestiaire"
Title="PageInfoBestiaire"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<VerticalStackLayout BackgroundColor="#72a3b3" Grid.Row="0" Grid.Column="0" Spacing="10">
<Image Source="ohara2.png" HeightRequest="300" HorizontalOptions="Center" >
<Image.Clip>
<EllipseGeometry Center="150,90" RadiusX="80" RadiusY="80"/>
</Image.Clip>
</Image>
<Button Style="{StaticResource buttonMenu}" Text="Accueil"/>
<Button Style="{StaticResource buttonMenu}" Text="Carte"/>
<Button Style="{StaticResource buttonMenu}" Text="Personnages"/>
<Button Style="{StaticResource buttonMenu}" Text="Fruits du démon"/>
<Button Style="{StaticResource buttonMenu}" Text="Bateaux"/>
<Button Style="{StaticResource buttonMenu}" Text="Îles"/>
<Button Style="{StaticResource buttonMenu}" Text="Bestiaire"/>
<Button Style="{StaticResource buttonMenu2}" Text="Équipages"/>
</VerticalStackLayout>
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="40">
<CollectionView x:Name="listeBest">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Origine :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Origine}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ContentPage>

@ -0,0 +1,16 @@
using Model.Stub;
using Model;
namespace Ohara;
public partial class PageInfoBestiaire : ContentPage
{
public PageInfoBestiaire()
{
InitializeComponent();
List<Bestiaire> Lbest = StubBestiaire.RecupererBestiaire().ToList();
listeBest.ItemsSource = Lbest;
}
}

@ -69,13 +69,13 @@
<RowDefinition Height="750"/> <RowDefinition Height="750"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Frame <Frame CornerRadius="25"
CornerRadius="25"
BorderColor="#e2edf1" BorderColor="#e2edf1"
IsClippedToBounds="True" IsClippedToBounds="True"
Padding="0" Padding="0"
HeightRequest="800" HeightRequest="800"
WidthRequest="450"> WidthRequest="450">
<Image <Image
Source="{Binding Image}" Source="{Binding Image}"
@ -83,36 +83,23 @@
/> />
</Frame> </Frame>
<Frame CornerRadius="20" <Frame Style="{StaticResource frameObjet2}">
BorderColor="#72a3b3"
BackgroundColor="#72a3b3"
Margin="20, 50" Padding="15"
WidthRequest="275"
HeightRequest="150"
Grid.Row="0"
VerticalOptions="End">
<StackLayout Orientation="Vertical" Spacing="10" VerticalOptions="Center"> <StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label <Label
Text="{Binding Nom}" Text="{Binding Nom}"
FontAttributes="Bold" FontAttributes="Bold"
FontSize="22" FontSize="22"
TextColor="White" TextColor="#72a3b3"
HorizontalOptions="Center"
/>
<Label
Text="-----------------------------"
FontAttributes="Bold"
FontSize="20"
TextColor="White"
HorizontalOptions="Center" HorizontalOptions="Center"
/> />
<Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
<Label <Label
Text="Cliquez ici pour voir en détail" Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic" FontAttributes="Bold,Italic"
FontSize="15" FontSize="15"
TextColor="White" TextColor="#72a3b3"
TextDecorations="Underline" TextDecorations="Underline"
HorizontalOptions="Center"/> HorizontalOptions="Center"/>

@ -525,22 +525,71 @@
</VisualState> </VisualState>
<VisualState x:Name="PointerOver"> <VisualState x:Name="PointerOver">
<VisualState.Setters> <VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="1.0" />
</LinearGradientBrush>
</Setter.Value>
<Setter Property="BackgroundColor" Value="#d8dddf"/>
<Setter Property="CornerRadius" Value="25"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter> </Setter>
</Style>
<Setter Property="WidthRequest" Value="275" /> <Style x:Key="frameObjet2" TargetType="Frame">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="CornerRadius" Value="20"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
<Setter Property="BackgroundColor" Value="#e2edf1"/>
<Setter Property="Margin" Value="20,0,20,50"/>
<Setter Property="Grid.Row" Value="0"/>
<Setter Property="VerticalOptions" Value="End"/>
<Setter Property="HeightRequest" Value="150"/>
<Setter Property="WidthRequest" Value="275"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="CornerRadius" Value="20"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
<Setter Property="BackgroundColor" Value="#e2edf1"/>
<Setter Property="Margin" Value="20,50,20,50"/>
<Setter Property="Grid.Row" Value="0"/>
<Setter Property="VerticalOptions" Value="End"/>
<Setter Property="HeightRequest" Value="160"/>
<Setter Property="WidthRequest" Value="285"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style x:Key="frameEquip" TargetType="Frame">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="CornerRadius" Value="25"/>
<Setter Property="BorderColor" Value="Black"/>
<Setter Property="BackgroundColor" Value="Black"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="CornerRadius" Value="25"/>
<Setter Property="BorderColor" Value="Black"/>
<Setter Property="BackgroundColor" Value="#424545"/>
</VisualState.Setters> </VisualState.Setters>
</VisualState> </VisualState>
</VisualStateGroup> </VisualStateGroup>
</VisualStateGroupList> </VisualStateGroupList>
</Setter> </Setter>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

Loading…
Cancel
Save