You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE_2.01_-_Developpement_du.../Sources/Vues/SearchMob.xaml

215 lines
12 KiB

<?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"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:shape="Microsoft.Maui.Controls.Shapes"
x:Class="Vues.SearchMob"
BackgroundImageSource="backcollection.jpg">
<!--BackgroundImageSource="backcollection.jpg"-->
<Grid ColumnDefinitions="Auto, *">
<Grid.Resources>
<Style x:Key="sectionStyle" TargetType="Border">
<Setter Property="Stroke" Value="#735751" />
<Setter Property="StrokeThickness" Value="4" />
<Setter Property="StrokeShape" Value="RoundRectangle 15" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="Padding" Value="20" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#efccb2" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#f6ccb2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="FontSize" Value="Small" />
<Setter Property="WidthRequest" Value="100" />
<Setter Property="HeightRequest" Value="50" />
<Setter Property="BorderColor" Value="Black" />
<Setter Property="BorderWidth" Value="1" />
<Setter Property="Margin" Value="5" />
<Setter Property="BackgroundColor" Value="{StaticResource buttonBackgroundColor}" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Scale"
Value="1" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Scale"
Value="1.05" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</Grid.Resources>
<Grid RowDefinitions="Auto, *" RowSpacing="25" WidthRequest="300"
BackgroundColor="{StaticResource buttonBackgroundColor}">
<VerticalStackLayout>
<HorizontalStackLayout Grid.Row="0">
<ImageButton Source="exit.png" WidthRequest="20" BackgroundColor="{StaticResource buttonBackgroundColor}"/>
<SearchBar Placeholder="Rechercher un monstre"
PlaceholderColor="DimGray"
CancelButtonColor="DimGray"/>
</HorizontalStackLayout>
<Button Style="{StaticResource buttonStyle}"
Grid.Row="1"
Text="Filtrer"
Clicked="FilterClicked"/>
<HorizontalStackLayout x:Name="Filtrer">
<Grid ColumnDefinitions="Auto, Auto, Auto, Auto, Auto, Auto"
RowDefinitions="Auto">
<Label Grid.Column="0">Passive</Label>
<CheckBox x:Name="passive"
Color="Green"
Grid.Column="1"/>
<Label Grid.Column="2">Hostile</Label>
<CheckBox x:Name="hostile"
Color="Red"
Grid.Column="3"/>
<Label Grid.Column="4">Boss</Label>
<CheckBox x:Name="boss"
Color="Purple"
Grid.Column="5"/>
</Grid>
</HorizontalStackLayout>
</VerticalStackLayout>
<ListView x:Name="ListViewMonsters" ItemsSource="{Binding ListMonsters}" Grid.Row="1" ItemTapped="OnClick">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<VerticalStackLayout>
<Image Source="{Binding ImageLink}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Opacity" Value="1" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.9" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
</Image>
</VerticalStackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
<ScrollView Grid.Column="1" Margin="10">
<!-- Grid du Detail contenant toutes les informations du monstre -->
<Grid RowDefinitions="Auto,Auto,Auto,Auto" BindingContext="{Binding SelectedItem, Source={x:Reference ListViewMonsters}}">
<Grid ColumnDefinitions="3*, *" Grid.Row="0">
<HorizontalStackLayout Grid.Column="0" VerticalOptions="Start">
<Label Text="Déjà vu ?" FontSize="20" TextColor="White" Margin="7"/>
<CheckBox Color="Green"/>
</HorizontalStackLayout>
<VerticalStackLayout VerticalOptions="Center" Grid.Column="0">
<!-- Description du monstre -->
<Border Style="{StaticResource sectionStyle}">
<StackLayout>
<Label TextDecorations="Underline" Text="Description :" FontSize="Medium"/>
<Label FontSize="Small" Text="{Binding Description, StringFormat='{0}'}"/>
</StackLayout>
</Border>
</VerticalStackLayout>
<!-- Image du monstre -->
<VerticalStackLayout Grid.Column="1">
<Image x:Name="imageCollection" HeightRequest="600" HorizontalOptions="End"/>
<Border Grid.Row="1" Style="{StaticResource sectionStyle}" HorizontalOptions="Fill">
<Label FontSize="Small" Text="{Binding Dangerosite, StringFormat='Dangerosité : {0}'}"/>
</Border>
</VerticalStackLayout>
</Grid>
<StackLayout Grid.Row="1">
<Border Style="{StaticResource sectionStyle}">
<StackLayout>
<Label TextDecorations="Underline" Text="Caractéristiques du monstre :" FontSize="Medium"/>
<ListView ItemsSource="{Binding CharacteristicsList}" Grid.Row="1">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding ., StringFormat='{0}'}" FontSize="Small"/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</Border>
<Border Style="{StaticResource sectionStyle}">
<StackLayout>
<Label TextDecorations="Underline" Text="Apparences :" FontSize="Medium"/>
<ListView x:Name="ListAppearance" ItemsSource="{Binding AppearanceList}" Grid.Row="1" ItemTapped="ListAppearance_ItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding ., StringFormat='{0}'}" FontSize="Small"/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</Border>
<!-- Conseils -->
<Border Grid.Row="3" Style="{StaticResource sectionStyle}">
<StackLayout>
<Button Text="Ajouter un conseil" Grid.Row="0" Grid.Column="1" Clicked="OnAddConseilClicked" />
<StackLayout x:Name="AddConseilLayout" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" IsVisible="False">
<Editor x:Name="texteConseilEntry" Placeholder="Texte du conseil" PlaceholderColor="{StaticResource Gray500}"/>
<Button Text="Valider" Clicked="OnValiderConseilClicked" />
<Button Text="Annuler" Clicked="OnExitConseilClicked" />
</StackLayout>
<ListView x:Name="ListViewConseils" ItemsSource="{Binding ListConseils}" Grid.Row="1">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto, Auto">
<Label Text="{Binding Id}" Grid.Column="0"/>
<Label Text="{Binding Auteur}" Grid.Column="0"/>
<Label Text="{Binding Texte}" Grid.Column="1" />
<!-- Bouton d'ajout de conseil -->
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</Border>
</StackLayout>
</Grid>
</ScrollView>
</Grid>
</ContentPage>