Reglage bug de navigation
continuous-integration/drone/push Build is passing Details

pull/15/head
Yoan BRUGIÈRE 2 years ago
parent bdbc59a20f
commit f2afcef552

@ -61,6 +61,10 @@ namespace Model.Classes
public override bool Equals(object? obj) public override bool Equals(object? obj)
{ {
if (obj == null) return false; if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else else
{ {
Ile o = (Ile)obj; Ile o = (Ile)obj;

@ -64,7 +64,7 @@ namespace Model.Managers
public List<FruitDuDemon> FiltrerFDD(string type) public List<FruitDuDemon> FiltrerFDD(string type)
{ {
List<FruitDuDemon> fdd = GetFruits(); List<FruitDuDemon> fdd = new List<FruitDuDemon>(Fruits);
foreach (FruitDuDemon f in fdd.ToList()) foreach (FruitDuDemon f in fdd.ToList())
{ {
if (f.Type != type) if (f.Type != type)
@ -75,6 +75,12 @@ namespace Model.Managers
return fdd; return fdd;
} }
public List<ObjetOhara> FiltrerFavs(string type)
{
List<ObjetOhara> favs = GetFavoris();
return favs;
}
public List<FruitDuDemon> RechercheFDD(string text, List<FruitDuDemon> listeFDD) public List<FruitDuDemon> RechercheFDD(string text, List<FruitDuDemon> listeFDD)
{ {
if (text == "") if (text == "")
@ -154,6 +160,8 @@ namespace Model.Managers
return listeFavoris; return listeFavoris;
} }
public void ModifierFavoris(ObjetOhara obj,bool value) public void ModifierFavoris(ObjetOhara obj,bool value)
{ {
Type t = obj.GetType(); Type t = obj.GetType();

@ -11,23 +11,25 @@ namespace Model.Stub
{ {
public IEnumerable<Equipage> RecupererEquipage() public IEnumerable<Equipage> RecupererEquipage()
{ {
var paille = new Equipage("Équipage au chapeau de paille", "Mugiwara No Ichimi", "East Blue", 1, 1, true, "L'équipage du Chapeau de Paille ...", "mugiwara.jpg");
var roux = new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", 1, 4, true, "L'équipage du Roux ...", "roux.png");
var clown = new Equipage("Équipage du Clown", "Bagï Kalzokudan", "East Blue", 8, 4, true, "L'équipage du Clown ...", "clown.png");
var blanche = new Equipage("Équipage de Barbe Blanche", "Shirohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Blanche ...", "blanche.jpg");
var noire = new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...", "noire.png");
paille.Allie.Add(clown);
var stubperso = new StubPersonnage();
List<Personnage> persos = new List<Personnage>(stubperso.RecupererPersonnage());
var membrePaille = persos.Where(p => p.Nom=="Luffy" || p.Nom=="Nami" || p.Nom=="Usopp" || p.Nom=="Zoro");
paille.Membre.AddRange(membrePaille);
List<Equipage> Lequipage = new List<Equipage>() List<Equipage> Lequipage = new List<Equipage>()
{ {
new Equipage("Équipage au chapeau de paille", "Mugiwara No Ichimi", "East Blue", 1, 1, true, "L'équipage du Chapeau de Paille ...","mugiwara.jpg"), paille,
new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", 1, 4, true, "L'équipage du Roux ...","roux.png"), roux,
new Equipage("Équipage du Clown", "Bagï Kalzokudan", "East Blue", 8, 4, true, "L'équipage du Clown ...","clown.png"), clown,
new Equipage("Équipage de Barbe Blanche", "Shirohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Blanche ...","blanche.jpg"), blanche,
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
}; };
return Lequipage; return Lequipage;
} }

@ -23,18 +23,46 @@
</Shell.FlyoutHeader> </Shell.FlyoutHeader>
<ShellContent Title="Accueil" ContentTemplate="{DataTemplate local:MainPage}" /> <FlyoutItem Title="Accueil" >
<ShellContent Title="Favoris" ContentTemplate="{DataTemplate local:PageFavoris}" /> <ShellContent ContentTemplate="{DataTemplate local:MainPage}" />
<ShellContent Title="Carte" ContentTemplate="{DataTemplate local:PageCarte}" /> </FlyoutItem>
<ShellContent Title="Personnages" ContentTemplate="{DataTemplate local:PagePersonnage}" /> <FlyoutItem Title="Favoris">
<ShellContent Title="Bateaux" ContentTemplate="{DataTemplate local:PageBateau}" /> <ShellContent ContentTemplate="{DataTemplate local:PageFavoris}" />
<ShellContent Title="Îles" ContentTemplate="{DataTemplate local:PageIle}" /> </FlyoutItem>
<ShellContent Title="Fruits Du Démon" ContentTemplate="{DataTemplate local:PageFDD}" /> <FlyoutItem Title="Carte">
<ShellContent Title="Equipages" ContentTemplate="{DataTemplate local:PageEquipage}" /> <ShellContent ContentTemplate="{DataTemplate local:PageCarte}" />
<ShellContent Title="Bestiaire" ContentTemplate="{DataTemplate local:PageBestiaire}" /> </FlyoutItem>
<FlyoutItem Title="Personnages">
<ShellContent ContentTemplate="{DataTemplate local:PagePersonnage}" />
</FlyoutItem>
<FlyoutItem Title="Bateaux">
<ShellContent ContentTemplate="{DataTemplate local:PageBateau}" />
</FlyoutItem>
<FlyoutItem Title="Îles" >
<ShellContent ContentTemplate="{DataTemplate local:PageIle}" />
</FlyoutItem>
<FlyoutItem Title="Fruits Du Démon">
<ShellContent ContentTemplate="{DataTemplate local:PageFDD}" />
</FlyoutItem>
<FlyoutItem Title="Equipages">
<ShellContent ContentTemplate="{DataTemplate local:PageEquipage}" />
</FlyoutItem>
<FlyoutItem Title="Bestiaire">
<ShellContent ContentTemplate="{DataTemplate local:PageBestiaire}" />
</FlyoutItem>
<Shell.FlyoutFooter> <Shell.FlyoutFooter>
<Label Text="REY Guillaume et BRUGIÈRE Yoan" HorizontalOptions="Center" Margin="10"/> <StackLayout>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="4" Stroke="#72a3b3"/>
<Label Text="REY Guillaume et BRUGIÈRE Yoan" HorizontalOptions="Center" Margin="10" TextColor="#72a3b3"/>
</StackLayout>
</Shell.FlyoutFooter> </Shell.FlyoutFooter>
</Shell> </Shell>

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageBateau" x:Class="Ohara.PageBateau"
Title="PageBateau" Title="PageBateau"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">

@ -18,6 +18,7 @@ public partial class PageBateau : ContentPage
async void listeBateau_SelectionChanged(object sender, SelectionChangedEventArgs e) async void listeBateau_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Bateau)listeBateau.SelectedItem; manager.SelectedItem = (Bateau)listeBateau.SelectedItem;
await Navigation.PushAsync(new PageInfoBateau()); await Navigation.PushAsync(new PageInfoBateau());
} }
@ -26,4 +27,10 @@ public partial class PageBateau : ContentPage
{ {
} }
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeBateau.SelectedItem = null;
}
} }

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageBestiaire" x:Class="Ohara.PageBestiaire"
Title="PageBestiaire" Title="PageBestiaire"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">
<VerticalStackLayout Spacing="20"> <VerticalStackLayout Spacing="20">

@ -18,7 +18,19 @@ public partial class PageBestiaire : ContentPage
async void listeBest_SelectionChanged(object sender, SelectionChangedEventArgs e) async void listeBest_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Bestiaire)listeBest.SelectedItem; manager.SelectedItem = (Bestiaire)listeBest.SelectedItem;
await Navigation.PushAsync(new PageInfoBestiaire()); await Navigation.PushAsync(new PageInfoBestiaire());
} }
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeBest.SelectedItem = null;
}
private void ContentPage_Appearing_1(object sender, EventArgs e)
{
}
} }

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageEquipage" x:Class="Ohara.PageEquipage"
Title="PageEquipage" Title="PageEquipage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">

@ -11,13 +11,24 @@ public partial class PageEquipage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
BindingContext = manager; BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeEquip.ItemsSource = manager.RechercheObjetOhara(searchBar.Text,new List<ObjetOhara>(manager.Equipages.ToList()));
}
searchBar.TextChanged += OnTextChanged;
} }
async void listeEquip_SelectionChanged(object sender, SelectionChangedEventArgs e) async void listeEquip_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Equipage)listeEquip.SelectedItem; manager.SelectedItem=(Equipage)listeEquip.SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage()); await Navigation.PushAsync(new PageInfoEquipage());
} }
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeEquip.SelectedItem = null;
}
} }

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageFDD" x:Class="Ohara.PageFDD"
Title="PageFDD" Title="PageFDD"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">
@ -14,11 +15,20 @@
<CollectionView.Header> <CollectionView.Header>
<Grid ColumnDefinitions="200,*,150,10,150" BackgroundColor="#72a3b3" Padding="10"> <Grid ColumnDefinitions="200,*,150,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/> <SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame x:Name="Logia" CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Picker Title="Trier" Grid.Column="4" BackgroundColor="#bfe5ef">
<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> <Picker.ItemsSource>
<x:Array Type="{x:Type x:String}"> <x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String> <x:String>Nom croissant</x:String>

@ -22,10 +22,6 @@ public partial class PageFDD : ContentPage
listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.Fruits.ToList()); listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.Fruits.ToList());
} }
searchBar.TextChanged += OnTextChanged; searchBar.TextChanged += OnTextChanged;
FiltrerType = new Command((type) => listeFDD.ItemsSource = manager.FiltrerFDD(type.ToString()));
//Logia.Command = FiltrerType;
//Logia.CommandParameter = "Logia";
} }
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e) private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
@ -33,19 +29,34 @@ public partial class PageFDD : ContentPage
} }
private void MenuFlyoutItem_Clicked(object sender, EventArgs e)
{
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 Label_Focused(object sender, FocusEventArgs e) private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{ {
var picker=(Picker)sender;
int selectedIndex = picker.SelectedIndex;
if(selectedIndex == 0)
{
listeFDD.ItemsSource=manager.Fruits.ToList();
}
else
{
listeFDD.ItemsSource = manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList();
}
} }
async void listeFDD_SelectionChanged(object sender, SelectionChangedEventArgs e) private void ContentPage_Appearing(object sender, EventArgs e)
{ {
manager.SelectedItem=(FruitDuDemon)listeFDD.SelectedItem; manager.SelectedItem = null;
await Navigation.PushAsync(new PageInfoFdd()); listeFDD.SelectedItem = null;
} }
} }

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageFavoris" x:Class="Ohara.PageFavoris"
Title="PageFavoris" Title="PageFavoris"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">
<CollectionView x:Name="listeFavs" SelectionMode="Single" SelectionChanged="listeFavs_SelectionChanged" EmptyView="Aucun résultat trouvé."> <CollectionView x:Name="listeFavs" SelectionMode="Single" SelectionChanged="listeFavs_SelectionChanged" EmptyView="Aucun résultat trouvé.">
@ -13,9 +14,17 @@
<Grid ColumnDefinitions="200,*,100,100,10,100" BackgroundColor="#72a3b3" Padding="10"> <Grid ColumnDefinitions="200,*,100,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/> <SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Button Text="Actualiser" Clicked="Button_Clicked" Grid.Column="2" CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef"/> <Button Text="Actualiser" Clicked="Button_Clicked" Grid.Column="2" CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3"> <Picker Title="Filtrer" Grid.Column="3" BackgroundColor="white" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" TitleColor="White" FontSize="15" >
<Label Text="Filtrer" HorizontalTextAlignment="Center" /> <Picker.ItemsSource>
</Frame> <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>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="5"> <Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="5">
<Label Text="Trier" HorizontalTextAlignment="Center" /> <Label Text="Trier" HorizontalTextAlignment="Center" />

@ -22,6 +22,7 @@ public partial class PageFavoris : ContentPage
} }
void listeFavs_SelectionChanged(object sender, SelectionChangedEventArgs e) void listeFavs_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (e.CurrentSelection.Count == 0) return;
Type t = listeFavs.SelectedItem.GetType(); Type t = listeFavs.SelectedItem.GetType();
Console.WriteLine(t); Console.WriteLine(t);
@ -66,9 +67,34 @@ public partial class PageFavoris : ContentPage
} }
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeFavs.SelectedItem = null;
}
private void Button_Clicked(object sender, EventArgs e) private void Button_Clicked(object sender, EventArgs e)
{ {
listeFavs.ItemsSource = manager.GetFavoris(); listeFavs.ItemsSource = manager.GetFavoris();
} }
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
listeFavs.ItemsSource = manager.GetFavoris();
}
else
{
// listeFavs.ItemsSource = manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList();
}
}
private void ContentPage_Appearing_1(object sender, EventArgs e)
{
}
} }

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageIle" x:Class="Ohara.PageIle"
Title="PageIle" Title="PageIle"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">

@ -18,7 +18,14 @@ public partial class PageIle : ContentPage
} }
async void listeIle_SelectionChanged(object sender, SelectionChangedEventArgs e) async void listeIle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Ile)listeIle.SelectedItem; manager.SelectedItem=(Ile)listeIle.SelectedItem;
await Navigation.PushAsync(new PageInfoIle()); await Navigation.PushAsync(new PageInfoIle());
} }
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeIle.SelectedItem = null;
}
} }

@ -12,7 +12,7 @@ public partial class PageInfoBateau : ContentPage
public PageInfoBateau() public PageInfoBateau()
{ {
InitializeComponent(); InitializeComponent();
if(manager.SelectedItem.EstFavori==true) if(manager.SelectedItem?.EstFavori==true)
{ {
bouttonFav.IsEnabled = false; bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris"; bouttonFav.Text = "Ajouté au favoris";

@ -9,7 +9,7 @@ public partial class PageInfoBestiaire : ContentPage
public PageInfoBestiaire() public PageInfoBestiaire()
{ {
InitializeComponent(); InitializeComponent();
if (manager.SelectedItem.EstFavori == true) if (manager.SelectedItem?.EstFavori == true)
{ {
bouttonFav.IsEnabled = false; bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris"; bouttonFav.Text = "Ajouté au favoris";

@ -72,10 +72,58 @@
<Label Text="{Binding Description}" TextColor="#72a3b3" /> <Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Membre(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/> <Label Text="Membre(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" /> <Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Membre}" TextColor="#72a3b3" /> <CollectionView ItemsLayout="HorizontalList" ItemsSource="{Binding Membre}" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Text="Allié(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/> <Label Text="Allié(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" /> <Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Allie}" TextColor="#72a3b3" /> <CollectionView ItemsLayout="HorizontalList" ItemsSource="{Binding Allie}" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" >
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>

@ -9,7 +9,7 @@ public partial class PageInfoEquipage : ContentPage
public PageInfoEquipage() public PageInfoEquipage()
{ {
InitializeComponent(); InitializeComponent();
if (manager.SelectedItem.EstFavori == true) if (manager.SelectedItem?.EstFavori == true)
{ {
bouttonFav.IsEnabled = false; bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris"; bouttonFav.Text = "Ajouté au favoris";

@ -72,25 +72,18 @@
<Label Text="Description :" Style="{StaticResource titreInfo}"/> <Label Text="Description :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/> <Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="{Binding Description}" Style="{StaticResource paragrapheInfo}"/> <Label Text="{Binding Description}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Utilisateurs :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="Force / Faiblesses :" Style="{StaticResource titreInfo}"/> <Label Text="Force / Faiblesses :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/> <Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Grid ColumnSpacing="20" Padding="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Grid.Row="0">
<Label Text="Forces :" Style="{StaticResource titreInfo}" /> <Label Text="Forces :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Forces}" Style="{StaticResource paragrapheInfo}"/> <Label Text="{Binding Forces}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Grid.Row="0">
<Label Text="Faiblesses :" Style="{StaticResource titreInfo}" /> <Label Text="Faiblesses :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Faiblesses}" Style="{StaticResource paragrapheInfo}"/> <Label Text="{Binding Faiblesses}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
</Grid>
<Label Text="Utilisateurs :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>

@ -9,7 +9,7 @@ public partial class PageInfoFdd : ContentPage
public PageInfoFdd() public PageInfoFdd()
{ {
InitializeComponent(); InitializeComponent();
if (manager.SelectedItem.EstFavori == true) if (manager.SelectedItem?.EstFavori == true)
{ {
bouttonFav.IsEnabled = false; bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris"; bouttonFav.Text = "Ajouté au favoris";

@ -2,7 +2,8 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageInfoIle" x:Class="Ohara.PageInfoIle"
Title="PageInfoIle"> Title="PageInfoIle"
BackgroundColor="#e2edf1">
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always"> <ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">

@ -9,7 +9,7 @@ public partial class PageInfoIle : ContentPage
public PageInfoIle() public PageInfoIle()
{ {
InitializeComponent(); InitializeComponent();
if (manager.SelectedItem.EstFavori == true) if (manager.SelectedItem?.EstFavori == true)
{ {
bouttonFav.IsEnabled = false; bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris"; bouttonFav.Text = "Ajouté au favoris";

@ -10,7 +10,7 @@ public partial class PageInfoPersonnage : ContentPage
public PageInfoPersonnage() public PageInfoPersonnage()
{ {
InitializeComponent(); InitializeComponent();
if (manager.SelectedItem.EstFavori == true) if (manager.SelectedItem?.EstFavori == true)
{ {
bouttonFav.IsEnabled = false; bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris"; bouttonFav.Text = "Ajouté au favoris";

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PagePersonnage" x:Class="Ohara.PagePersonnage"
Title="PagePersonnage" Title="PagePersonnage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">

@ -19,10 +19,16 @@ public partial class PagePersonnage : ContentPage
} }
void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e) void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Personnage)listePerso.SelectedItem; manager.SelectedItem = (Personnage)listePerso.SelectedItem;
Navigation.PushAsync(new PageInfoPersonnage()); Navigation.PushAsync(new PageInfoPersonnage());
} }
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listePerso.SelectedItem = null;
}
} }

@ -514,44 +514,7 @@
</Setter> </Setter>
</Style> </Style>
<!--<Style x:Key="GIL"
TargetType="CollectionView.ItemsLayout">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Petit">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Collecto
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Moyen">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="480" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Span"
Value="2" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Grand">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Span"
Value="4" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>-->
<Style x:Key="frameObjet" TargetType="Frame"> <Style x:Key="frameObjet" TargetType="Frame">
<Setter Property="VisualStateManager.VisualStateGroups"> <Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList> <VisualStateGroupList>
@ -715,18 +678,55 @@
</Style> </Style>
<!--<Style TargetType="Label" <!--<Style TargetType="Label"
Class="FlyoutItemLabelStyle"> Class="FlyoutItemLabelStyle">
<Setter Property="TextColor" <Setter Property="VisualStateManager.VisualStateGroups">
Value="White" /> <VisualStateGroupList>
<Setter Property="WidthRequest" Value="250"/> <VisualStateGroup>
<Setter Property="HorizontalOptions" Value="Center"/> <VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style> </Style>
<Style TargetType="Layout" <Style TargetType="Layout"
Class="FlyoutItemLayoutStyle" Class="FlyoutItemLayoutStyle"
ApplyToDerivedTypes="True"> ApplyToDerivedTypes="True">
<Setter Property="BackgroundColor" <Setter Property="VisualStateManager.VisualStateGroups">
Value="Teal" /> <VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>--> </Style>-->
</ResourceDictionary> </ResourceDictionary>

Loading…
Cancel
Save