Flexlayout pour les fruit du démon, les équipages et les bestiaires
continuous-integration/drone/push Build is failing Details

pull/15/head
Yoan 2 years ago
parent f76cc48ea6
commit c07b8cfd42

@ -12,17 +12,69 @@ namespace Model.Classes
public class Bateau : ObjetOhara
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
private string nomromanise;
public string NomRomanise {
get=>nomromanise;
set
{
if(nomromanise == value) return;
nomromanise = value;
}
}
[DataMember(Name = "affiliation", EmitDefaultValue = false)]
public Equipage? Affiliation { get; set; }
private Equipage? equipage;
public Equipage? Affiliation {
get=>equipage;
set
{
if(equipage == value) return;
equipage = value;
}
}
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
private int premierchap;
public int PremierChap
{
get => premierchap;
set
{
if (premierchap == value) return;
premierchap = value;
}
}
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
private int premierep;
public int PremierEp
{
get => premierep;
set
{
if (premierep == value) return;
premierep = value;
}
}
[DataMember(Name = "description")]
public string Description { get; set; }
private string description;
public string Description
{
get => description;
set
{
if (description == value) return;
description = value;
}
}
[DataMember(Name = "caracteristique")]
public string Caracteristique { get; set; }
private string caracteristique;
public string Caracteristique {
get=> caracteristique;
set
{
if(caracteristique == value) return;
caracteristique = value;
}
}
public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique) : base(nom)

@ -13,11 +13,35 @@ namespace Model.Classes
public class Bestiaire : ObjetOhara
{
[DataMember(Name = "origine")]
public string Origine { get; set; }
private string origine;
public string Origine {
get=>origine;
set
{
if (origine == value) return;
origine = value;
}
}
[DataMember(Name = "description")]
public string Description { get; set; }
private string description;
public string Description {
get=>description;
set
{
if (description == value) return;
description = value;
}
}
[DataMember(Name = "caracteristique")]
public string Caracteristique { get; set; }
private string caracteristique;
public string Caracteristique {
get=>caracteristique;
set
{
if(caracteristique == value) return;
caracteristique = value;
}
}
public Bestiaire(string nom, string origine, string description, string caracteristique) : base(nom)
{

@ -12,17 +12,67 @@ namespace Model.Classes
public class Ile : ObjetOhara
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
private string nomromanise;
public string NomRomanise
{
get => nomromanise;
set
{
if (nomromanise == value) return;
nomromanise = value;
}
}
[DataMember(Name = "region")]
public string Region { get; set; }
private string region;
public string Region {
get=>region;
set
{
if (region == value) return;
region = value;
}
}
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
private int premierchap;
public int PremierChap {
get=>premierchap;
set
{
if(premierchap == value) return;
premierchap = value;
}
}
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
private int premierep;
public int PremierEp {
get=>premierep;
set
{
if(premierep == value) return;
premierep = value;
}
}
[DataMember(Name = "description")]
public string Description { get; set; }
private string description;
public string Description {
get=>description;
set
{
if (description == value) return;
description = value;
}
}
[DataMember(Name = "geographie")]
public string Geographie { get; set; }
private string geographie;
public string Geographie {
get=>geographie;
set
{
if (geographie == value) return;
geographie = value;
}
}

@ -46,7 +46,16 @@ namespace Model.Classes
}
[DataMember(Name = "estfavori")]
public bool EstFavori { get; set; }
private bool estfavori;
public bool EstFavori {
get=>estfavori;
set
{
if (estfavori == value)
return;
estfavori = value;
}
}

@ -7,21 +7,109 @@ namespace Model.Classes
public class Personnage : ObjetOhara
{
[DataMember(Name = "prime")]
public double Prime { get; set; }
private double prime;
public double Prime {
get=>prime;
set
{
if (prime == value)
{
return;
}
prime = value;
}
}
[DataMember(Name = "epithete")]
public string Epithete { get; set; }
private string epithete;
public string Epithete {
get=>epithete;
set
{
if (epithete == value)
{
return;
}
epithete = value;
}
}
[DataMember(Name = "age")]
public int Age { get; set; }
private int age;
public int Age {
get=>age;
set
{
if (age == value)
{
return;
}
age = value;
}
}
[DataMember(Name = "taille")]
public double Taille { get; set; }
private double taille;
public double Taille {
get=>taille;
set
{
if (taille == value)
{
return;
}
taille = value;
}
}
[DataMember(Name = "origine")]
public string Origine { get; set; }
private string origine;
public string Origine {
get=>origine;
set
{
if (origine == value)
{
return;
}
origine = value;
}
}
[DataMember(Name = "biographie")]
public string Biographie { get; set; }
private string biographie;
public string Biographie {
get=>biographie;
set
{
if (biographie == value)
{
return;
}
biographie = value;
}
}
[DataMember(Name = "citation")]
public string Citation { get; set; }
private string citation;
public string Citation {
get=>citation;
set
{
if (citation == value)
{
return;
}
citation = value;
}
}
[DataMember(Name = "equipage", EmitDefaultValue = false)]
public Equipage Equipage { get; set; }
private Equipage equipage;
public Equipage Equipage {
get => equipage;
set
{
if (equipage == value)
{
return;
}
equipage = value;
}
}
[DataMember(Name = "fruit", EmitDefaultValue = false)]
public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>();

@ -160,82 +160,120 @@ namespace Model.Managers
return listeFavoris;
}
public void ModifierFavoris(ObjetOhara obj,bool value)
public void ModifierFavFDD(FruitDuDemon fruit,bool value)
{
Type t = obj.GetType();
if (t.Equals(typeof(Bateau)))
foreach(Bateau b in Bateaux)
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetBateau(Bateaux.ToList());
}
}
else if (t.Equals(typeof(Equipage)))
foreach (Equipage b in Equipages)
foreach (FruitDuDemon b in Fruits)
{
if (b.Equals(fruit))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetEquipage(Equipages.ToList());
}
b.EstFavori = value;
DataManager.SetFDD(Fruits.ToList());
}
}
}
else if (t.Equals(typeof(Personnage)))
foreach (Personnage b in Personnages)
public void ModifierFavEquip(Equipage equip, bool value)
{
foreach (Equipage b in Equipages)
{
if (b.Equals(equip))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetPersonnage(Personnages.ToList());
}
b.EstFavori = value;
DataManager.SetEquipage(Equipages.ToList());
}
else if (t.Equals(typeof(Ile)))
foreach (Ile b in Iles)
}
}
public void ModifierFavBest(Bestiaire best, bool value)
{
foreach (Bestiaire b in Bestiaire)
{
if (b.Equals(best))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetIle(Iles.ToList());
}
b.EstFavori = value;
DataManager.SetBestiaire(Bestiaire.ToList());
}
else if (t.Equals(typeof(FruitDuDemon)))
foreach (FruitDuDemon b in Fruits)
}
}
public void ModifierFavPerso(Personnage perso, bool value)
{
foreach (Personnage b in Personnages)
{
if (b.Equals(perso))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetFDD(Fruits.ToList());
}
b.EstFavori = value;
DataManager.SetPersonnage(Personnages.ToList());
}
else if (t.Equals(typeof(Bestiaire)))
foreach (Bestiaire b in Bestiaire)
}
}
public void ModifierFavIle(Ile ile, bool value)
{
foreach (Ile b in Iles)
{
if (b.Equals(ile))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetBestiaire(Bestiaire.ToList());
}
b.EstFavori = value;
DataManager.SetIle(Iles.ToList());
}
}
}
public void AjouterFDD(FruitDuDemon fruit)
public void ModifierFavBateau(Bateau bateau, bool value)
{
if (fruit == null)
foreach (Bateau b in Bateaux)
{
return;
if (b.Equals(bateau))
{
b.EstFavori = value;
DataManager.SetBateau(Bateaux.ToList());
}
}
}
public void AjouterFDD(FruitDuDemon fruit)
{
Fruits.Add(fruit);
}
public void AjouterEquip(Equipage equip)
{
Equipages.Add(equip);
}
public void AjouterBest(Bestiaire best)
{
Bestiaire.Add(best);
}
public void AjouterPerso(Personnage perso)
{
Personnages.Add(perso);
}
public void AjouterIle(Ile ile)
{
Iles.Add(ile);
}
public void AjouterBateau(Bateau bateau)
{
Bateaux.Add(bateau);
}
public void SupprimerFDD(FruitDuDemon fruit)
{
Fruits.Remove(fruit);
}
public void SupprimerEquip(Equipage equip)
{
Equipages.Remove(equip);
}
public void SupprimerBest(Bestiaire best)
{
Bestiaire.Remove(best);
}
public void SupprimerPerso(Personnage perso)
{
Personnages.Remove(perso);
}
public void SupprimerIle(Ile ile)
{
Iles.Remove(ile);
}
public void SupprimerBateau(Bateau bateau)
{
Bateaux.Remove(bateau);
}
}
}

@ -0,0 +1,21 @@
<?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.ModalBestiaire"
Title="ModalBestiaire"
BackgroundColor="#e2edf1">
<Grid ColumnDefinitions="*,*" RowDefinitions="*,*,*,*,*" RowSpacing="10" BackgroundColor="#72a3b3" Padding="30" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Label Text="Nom :" TextColor="White" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" Grid.Column="1"/>
<Label Text="Origine :" TextColor="White" FontAttributes="Bold" Grid.Row="1"/>
<Entry Text="{Binding Origine}" Grid.Column="1" Grid.Row="1"/>
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
<Label Text="Description :" TextColor="White" FontAttributes="Bold" Grid.Row="3" />
<Editor Text="{Binding Description}" Grid.Column="1" Grid.Row="3" WidthRequest="300" HeightRequest="200"/>
<Button Text="Annuler" Clicked="ButtonAnnuler_Clicked" Grid.Row="4" />
<Button Text="Confirmer" Clicked="ButtonConfirmer_Clicked" Grid.Column="1" Grid.Row="4" />
</Grid>
</ContentPage>

@ -0,0 +1,26 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalBestiaire : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Bestiaire nouveauBest = new Bestiaire("Bestiaire", " ", " ", " ");
public ModalBestiaire()
{
InitializeComponent();
BindingContext = nouveauBest;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
manager.AjouterBest(nouveauBest);
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
}

@ -1,68 +1,68 @@
<?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.ModalFDD"
Title="ModalFDD"
BackgroundColor="#e2edf1">
<HorizontalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
<VerticalStackLayout Spacing="2" Padding="5">
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Type :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Type}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Description}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Forces :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Forces}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Faiblesses :" TextColor="#72a3b3" FontAttributes="Bold" />
<Entry Text="{Binding Faiblesses}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Button Text="Annuler" Clicked="ButtonAnnuler_Clicked" />
<Button Text="Confirmer" Clicked="ButtonConfirmer_Clicked" />
</HorizontalStackLayout>
</Frame>
</VerticalStackLayout>
<!--<VerticalStackLayout Spacing="2" Padding="5">
<?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.ModalFDD"
Title="ModalFDD"
BackgroundColor="#e2edf1">
<HorizontalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
<VerticalStackLayout Spacing="2" Padding="5">
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Type :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Type}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Description}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Forces :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Entry Text="{Binding Forces}"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Faiblesses :" TextColor="#72a3b3" FontAttributes="Bold" />
<Entry Text="{Binding Faiblesses}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout HorizontalOptions="Center">
<Button Text="Annuler" Clicked="ButtonAnnuler_Clicked" />
<Button Text="Confirmer" Clicked="ButtonConfirmer_Clicked" />
</HorizontalStackLayout>
</Frame>
</VerticalStackLayout>
<VerticalStackLayout Spacing="2" Padding="5">
<Frame Style="{StaticResource frameInfo}" >
<Label Text="Aperçu de l'objet :" HorizontalOptions="Center" Style="{StaticResource titreInfo}"/>
</Frame>
@ -100,7 +100,7 @@
</HorizontalStackLayout>
</Frame>
</VerticalStackLayout>-->
</HorizontalStackLayout>
</VerticalStackLayout>
</HorizontalStackLayout>
</ContentPage>

@ -1,26 +1,26 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalFDD : ContentPage
namespace Ohara;
public partial class ModalFDD : ContentPage
{
public Manager manager => (App.Current as App).manager;
public FruitDuDemon nouveauFDD = new FruitDuDemon("Fruit","","",0,0,"","","");
public ModalFDD()
{
InitializeComponent();
BindingContext = nouveauFDD;
public FruitDuDemon nouveauFDD = new FruitDuDemon("Fruit","","",0,0,"","","");
public ModalFDD()
{
InitializeComponent();
BindingContext = nouveauFDD;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
manager.AjouterFDD(nouveauFDD);
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
}

@ -0,0 +1,23 @@
<?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.ModalPersonnage"
Title="ModalPersonnage"
BackgroundColor="#e2edf1">
<Grid ColumnDefinitions="*,*,*,*" RowDefinitions="*,*,*,*,*" RowSpacing="10" BackgroundColor="#72a3b3" Padding="30" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Label Text="Nom :" TextColor="White" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" Grid.Column="1"/>
<Label Text="Prime :" TextColor="White" FontAttributes="Bold" Grid.Column="2"/>
<Entry Text="{Binding Prime}" Grid.Column="3" WidthRequest="300"/>
<Label Text="Epithete :" TextColor="White" FontAttributes="Bold" Grid.Row="1"/>
<Entry Text="{Binding Epithete}" Grid.Column="1" Grid.Row="1"/>
<Label Text="Origine :" TextColor="White" FontAttributes="Bold" Grid.Column="2" Grid.Row="1"/>
<Entry Text="{Binding Origine}" Grid.Column="3" Grid.Row="1"/>
<Label Text="Description :" TextColor="White" FontAttributes="Bold" Grid.Row="3" />
<Editor Text="{Binding Description}" Grid.Column="1" Grid.Row="3" WidthRequest="300" HeightRequest="200"/>
<Label Text="Citation :" TextColor="White" FontAttributes="Bold" Grid.Column="2" Grid.Row="3"/>
<Editor Text="{Binding Citation}" Grid.Column="3" Grid.Row="3"/>
<Button Text="Annuler" Clicked="ButtonAnnuler_Clicked" Grid.Row="4" Grid.ColumnSpan="2" WidthRequest="200" />
<Button Text="Confirmer" Clicked="ButtonConfirmer_Clicked" Grid.Column="2" Grid.Row="4" Grid.ColumnSpan="2" WidthRequest="200"/>
</Grid>
</ContentPage>

@ -0,0 +1,24 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalPersonnage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Personnage nouveauPerso = new Personnage("Personnage", 0, "", 0, 0, "", "", "");
public ModalPersonnage()
{
InitializeComponent();
BindingContext = nouveauPerso;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
manager.AjouterPerso(nouveauPerso);
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
}

@ -61,6 +61,12 @@
<Compile Update="ModalFDD.xaml.cs">
<DependentUpon>ModalFDD.xaml</DependentUpon>
</Compile>
<Compile Update="ModalBestiaire.xaml.cs">
<DependentUpon>ModalBestiaire.xaml</DependentUpon>
</Compile>
<Compile Update="ModalPersonnage.xaml.cs">
<DependentUpon>ModalPersonnage.xaml</DependentUpon>
</Compile>
<Compile Update="PageFavoris.xaml.cs">
<DependentUpon>PageFavoris.xaml</DependentUpon>
</Compile>
@ -94,6 +100,12 @@
<MauiXaml Update="ModalFDD.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalBestiaire.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalPersonnage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageFavoris.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -6,53 +6,59 @@
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<VerticalStackLayout Spacing="20">
<CollectionView x:Name="listeBest" ItemsSource="{Binding Bestiaire}" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBest_SelectionChanged">
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Frame Style="{StaticResource frameObjet}">
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<!--<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>-->
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<FlexLayout x:Name="listeBest" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center"
BindableLayout.ItemsSource="{Binding Bestiaire}" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290" />
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -17,26 +17,27 @@ public partial class PageBestiaire : ContentPage
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeBest.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bestiaire.ToList()));
BindableLayout.SetItemsSource(listeBest, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bestiaire.ToList())));
}
searchBar.TextChanged += OnTextChanged;
}
async void listeBest_SelectionChanged(object sender, SelectionChangedEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Bestiaire)listeBest.SelectedItem;
await Navigation.PushAsync(new PageInfoBestiaire());
Bestiaire SelectedItem = manager.Bestiaire.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
//do something you want
manager.SelectedItem = SelectedItem;
await Navigation.PushAsync(new PageInfoBestiaire());
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeBest.SelectedItem = null;
BindableLayout.SetItemsSource(listeBest, manager.Bestiaire);
}
private void ContentPage_Appearing_1(object sender, EventArgs e)
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
await Navigation.PushModalAsync(new ModalBestiaire());
}
}

@ -5,48 +5,57 @@
Title="PageEquipage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<CollectionView x:Name="listeEquip" ItemsSource="{Binding Equipages}" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeEquip_SelectionChanged">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="15" VerticalItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,100,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="5">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<!--<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>-->
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" >
<StackLayout Orientation="Vertical" Padding="5">
<Image Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<FlexLayout x:Name="listEquip" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -10,25 +10,27 @@ public partial class PageEquipage : ContentPage
public PageEquipage()
{
InitializeComponent();
BindingContext = manager;
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeEquip.ItemsSource = manager.RechercheObjetOhara(searchBar.Text,new List<ObjetOhara>(manager.Equipages.ToList()));
BindableLayout.SetItemsSource(listEquip,manager.RechercheObjetOhara(searchBar.Text,new List<ObjetOhara>(manager.Equipages.ToList())));
}
searchBar.TextChanged += OnTextChanged;
}
async void listeEquip_SelectionChanged(object sender, SelectionChangedEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Equipage)listeEquip.SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage());
}
Equipage SelectedItem = manager.Equipages.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
manager.SelectedItem = SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage());
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeEquip.SelectedItem = null;
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
}
}

@ -3,58 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageFDD"
Title="PageFDD"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<!--<CollectionView x:Name="listeFDD" ItemsSource="{Binding Fruits}" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeFDD_SelectionChanged" >
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="15" VerticalItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,150,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Picker Title="Filtrer" Grid.Column="2" BackgroundColor="white" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" TitleColor="White" FontSize="15" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
<Picker Title="Trier" Grid.Column="4" BackgroundColor="White" TitleColor="White" FontSize="15">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate >
<DataTemplate >
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>-->
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="Button_Clicked" />
<!--<Picker Title="Filtrer" Grid.Column="2" BackgroundColor="white" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" TitleColor="White" FontSize="15" >
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
@ -65,54 +21,46 @@
</x:Array>
</Picker.ItemsSource>
</Picker>
<Picker Title="Trier" Grid.Column="4" BackgroundColor="White" TitleColor="White" FontSize="15">
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>-->
</Picker>
</Grid>
<FlexLayout x:Name="listeFDD" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center"
BindableLayout.ItemsSource="{Binding Fruits}" JustifyContent="SpaceEvenly">
BindableLayout.ItemsSource="{Binding Fruits}" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
<Label
VerticalOptions="Center"
HorizontalOptions="Center"
Text="{Binding Type}"
FontAttributes="Italic"
TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</DataTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
<Label
VerticalOptions="Center"
HorizontalOptions="Center"
Text="{Binding Type}"
FontAttributes="Italic"
TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>

@ -5,29 +5,26 @@ using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;
using System.Collections.ObjectModel;
using System.Windows.Input;
public partial class PageFDD : ContentPage
{
public ICommand FiltrerType { get; private set; }
public Manager manager => (App.Current as App).manager;
public PageFDD()
{
{
InitializeComponent();
BindingContext = manager;
//void OnTextChanged(object sender, EventArgs e)
//{
// SearchBar searchBar = (SearchBar)sender;
// listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.Fruits.ToList());
//}
//searchBar.TextChanged += OnTextChanged;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
BindableLayout.SetItemsSource(listeFDD, manager.RechercheFDD(searchBar.Text, manager.Fruits.ToList()));
}
searchBar.TextChanged += OnTextChanged;
}
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
{
}
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
@ -47,34 +44,23 @@ public partial class PageFDD : ContentPage
await Navigation.PushModalAsync(new ModalFDD());
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
}
else
{
BindableLayout.SetItemsSource(listeFDD, manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList());
}
}
//async void listeFDD_SelectionChanged(object sender, SelectionChangedEventArgs e)
//{
// if (e.CurrentSelection.Count == 0) return;
// manager.SelectedItem=(FruitDuDemon)listeFDD.SelectedItem;
// await Navigation.PushAsync(new PageInfoFdd());
//}
//private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
//{
// var picker=(Picker)sender;
// int selectedIndex = picker.SelectedIndex;
// if(selectedIndex == 0)
// {
// listeFDD.=manager.Fruits.ToList();
// }
// else
// {
// listeFDD.ItemsSource = manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList();
// }
//}
//private void ContentPage_Appearing(object sender, EventArgs e)
//{
// manager.SelectedItem = null;
// listeFDD.SelectedItem = null;
//}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
}
}

@ -6,15 +6,12 @@
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<CollectionView x:Name="listeFavs" SelectionMode="Single" SelectionChanged="listeFavs_SelectionChanged" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="15" VerticalItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Picker Title="Filtrer" Grid.Column="2" BackgroundColor="white" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" TitleColor="White" FontSize="15" >
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<!--<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
@ -24,42 +21,43 @@
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>-->
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}">
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<FlexLayout x:Name="listeFav" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -11,67 +11,54 @@ public partial class PageFavoris : ContentPage
public PageFavoris()
{
InitializeComponent();
listeFavs.ItemsSource = manager.GetFavoris();
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeFavs.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris());
BindableLayout.SetItemsSource(listeFav, manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris()));
}
searchBar.TextChanged += OnTextChanged;
}
void listeFavs_SelectionChanged(object sender, SelectionChangedEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
Type t = listeFavs.SelectedItem.GetType();
Console.WriteLine(t);
if (t.Equals(typeof(Bateau)))
{
manager.SelectedItem = (Bateau)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoBateau());
}
else if (t.Equals(typeof(Equipage)))
{
manager.SelectedItem = (Equipage)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoEquipage());
}
else if (t.Equals(typeof(Personnage)))
{
manager.SelectedItem = (Personnage)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoPersonnage());
}
else if (t.Equals(typeof(Ile)))
{
manager.SelectedItem=(Ile)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoIle());
}
else if (t.Equals(typeof(FruitDuDemon)))
{
manager.SelectedItem = (FruitDuDemon)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoFdd());
}
else if (t.Equals(typeof(Bestiaire)))
ObjetOhara SelectedItem = manager.GetFavoris().FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
manager.SelectedItem = (Bestiaire)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoBestiaire());
manager.SelectedItem = SelectedItem;
Type t = manager.SelectedItem.GetType();
if (t.Equals(typeof(Bateau)))
{
await Navigation.PushAsync(new PageInfoBateau());
}
else if (t.Equals(typeof(Equipage)))
{
await Navigation.PushAsync(new PageInfoEquipage());
}
else if (t.Equals(typeof(Personnage)))
{
await Navigation.PushAsync(new PageInfoPersonnage());
}
else if (t.Equals(typeof(Ile)))
{
await Navigation.PushAsync(new PageInfoIle());
}
else if (t.Equals(typeof(FruitDuDemon)))
{
await Navigation.PushAsync(new PageInfoFdd());
}
else if (t.Equals(typeof(Bestiaire)))
{
await Navigation.PushAsync(new PageInfoBestiaire());
}
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
listeFavs.ItemsSource = manager.GetFavoris();
manager.SelectedItem = null;
listeFavs.SelectedItem = null;
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
}
@ -81,7 +68,7 @@ public partial class PageFavoris : ContentPage
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
listeFavs.ItemsSource = manager.GetFavoris();
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
}
else
{

@ -29,7 +29,7 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="{Binding EstFavori}" TextColor="#72a3b3"/>
</Frame>
<Button Text="Suppimer ce bateau" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">

@ -25,7 +25,7 @@ public partial class PageInfoBateau : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem,true);
manager.ModifierFavBateau((Bateau)manager.SelectedItem,true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -33,7 +33,7 @@ public partial class PageInfoBateau : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavBateau((Bateau)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
@ -46,4 +46,10 @@ public partial class PageInfoBateau : ContentPage
manager.SelectedItem = bateau.Affiliation;
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerBateau((Bateau)manager.SelectedItem);
await Navigation.PopAsync();
}
}

@ -26,7 +26,7 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<Button Text="Suppimer ce bestiaire" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">

@ -22,7 +22,7 @@ public partial class PageInfoBestiaire : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavBest((Bestiaire)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +30,14 @@ public partial class PageInfoBestiaire : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavBest((Bestiaire)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerBest((Bestiaire)manager.SelectedItem);
await Navigation.PopAsync();
}
}

@ -31,6 +31,7 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="3 - Allié(s)" TextColor="#72a3b3"/>
</Frame>
<Button Text="Suppimer cet équipage" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">

@ -24,7 +24,7 @@ public partial class PageInfoEquipage : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavEquip((Equipage)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -32,7 +32,7 @@ public partial class PageInfoEquipage : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavEquip((Equipage)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
@ -53,6 +53,11 @@ public partial class PageInfoEquipage : ContentPage
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerEquip((Equipage)manager.SelectedItem);
await Navigation.PopAsync();
}
private void ContentPage_Appearing(object sender, EventArgs e)
{

@ -29,6 +29,7 @@
<Frame Style="{StaticResource frameInfo}" >
<Label Text="3 Utilisateurs" TextColor="#72a3b3"/>
</Frame>
<Button Text="Suppimer ce fruit du démon" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="2" Padding="5">
<Frame Style="{StaticResource frameInfo}" >

@ -22,7 +22,7 @@ public partial class PageInfoFdd : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +30,14 @@ public partial class PageInfoFdd : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerFDD((FruitDuDemon)manager.SelectedItem);
await Navigation.PopAsync();
}
}

@ -27,7 +27,7 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<Button Text="Suppimer cet île" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">

@ -22,7 +22,7 @@ public partial class PageInfoIle : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavIle((Ile)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +30,14 @@ public partial class PageInfoIle : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavIle((Ile)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerIle((Ile)manager.SelectedItem);
await Navigation.PopAsync();
}
}

@ -31,7 +31,7 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="4 - Fruit(s)" TextColor="#72a3b3"/>
</Frame>
<Button Text="Suppimer ce personnage" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">

@ -23,7 +23,7 @@ public partial class PageInfoPersonnage : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavPerso((Personnage)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -31,7 +31,7 @@ public partial class PageInfoPersonnage : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavPerso((Personnage)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
@ -59,4 +59,9 @@ public partial class PageInfoPersonnage : ContentPage
listEquip.SelectedItem = null;
listFruit.SelectedItem = null;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerPerso((Personnage)manager.SelectedItem);
await Navigation.PopAsync();
}
}

@ -8,13 +8,14 @@
<VerticalStackLayout Spacing="40">
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<Grid ColumnDefinitions="200,*,100,10,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Grid.Column="2"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="6">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>

@ -36,4 +36,8 @@ public partial class PagePersonnage : ContentPage
manager.SelectedItem = null;
listePerso.SelectedItem = null;
}
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
await Navigation.PushModalAsync(new ModalPersonnage());
}
}

@ -728,5 +728,44 @@
</VisualStateGroupList>
</Setter>
</Style>-->
<Style TargetType="Picker" x:Key="pickerOhara">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="TitleColor" Value="White"/>
</Style>
<Style TargetType="SearchBar" x:Key="searchBarOhara">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
</Style>
<Style TargetType="Button" x:Key="buttonBarre">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="0.8" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ResourceDictionary>

Loading…
Cancel
Save