Persistance fonctionnelle et nouveaux bindings
continuous-integration/drone/push Build is failing Details

pull/15/head
Yoan BRUGIÈRE 2 years ago
parent 70f1b2fd33
commit f03cc7ae78

@ -14,5 +14,11 @@ namespace Model
IEnumerable<FruitDuDemon> GetFruits();
IEnumerable<Ile> GetIles();
IEnumerable<Personnage> GetPersonnages();
void SetBateau(List<Bateau> listeBateaux);
void SetBestiaire(List<Bestiaire> listeBest);
void SetEquipage(List<Equipage> listeEquip);
void SetFDD(List<FruitDuDemon> listeFDD);
void SetIle(List<Ile> listeIle);
void SetPersonnage(List<Personnage> listePerso);
}
}

@ -16,7 +16,6 @@ namespace Model
public class Manager
{
public IDataManager DataManager { get; set; }
public XML_Serializer XML_Serializer { get; set; }
public ObservableCollection<Bateau> Bateaux { get; set; }
public ObservableCollection<Personnage> Personnages { get; set; }
public ObservableCollection<FruitDuDemon> Fruits { get; set; }
@ -26,18 +25,10 @@ namespace Model
public ObjetOhara? SelectedItem { get; set; } = null;
public Manager() {
DataManager = new StubManager();
XML_Serializer = new XML_Serializer();
if (File.Exists(@"C:\Users\yobrugiere1\Documents\Ohara\Sources\Ohara\Resources\XML\bateau.xml"))
Bateaux = new ObservableCollection<Bateau>(XML_Serializer.GetBateaux());
else
Bateaux = new ObservableCollection<Bateau>(DataManager.GetBateaux());
if (File.Exists(@"C:\Users\yobrugiere1\Documents\Ohara\Sources\Ohara\Resources\XML\personnage.xml"))
Personnages = new ObservableCollection<Personnage>(XML_Serializer.GetPersonnages());
else
Personnages = new ObservableCollection<Personnage>(DataManager.GetPersonnages());
public Manager(IDataManager dataManager) {
DataManager = dataManager;
Bateaux = new ObservableCollection<Bateau>(DataManager.GetBateaux());
Personnages = new ObservableCollection<Personnage>(DataManager.GetPersonnages());
Fruits = new ObservableCollection<FruitDuDemon>(DataManager.GetFruits());
Iles = new ObservableCollection<Ile>(DataManager.GetIles());
Bestiaire = new ObservableCollection<Bestiaire>(DataManager.GetBestiaires());
@ -170,7 +161,7 @@ namespace Model
if (b.Equals(obj))
{
b.EstFavori = value;
XML_Serializer.SetBateau(Bateaux.ToList());
DataManager.SetBateau(Bateaux.ToList());
}
}
else if (t.Equals(typeof(Equipage)))
@ -179,7 +170,7 @@ namespace Model
if (b.Equals(obj))
{
b.EstFavori = value;
XML_Serializer.SetEquipage(Equipages.ToList());
DataManager.SetEquipage(Equipages.ToList());
}
}
@ -189,7 +180,7 @@ namespace Model
if (b.Equals(obj))
{
b.EstFavori = value;
XML_Serializer.SetPersonnage(Personnages.ToList());
DataManager.SetPersonnage(Personnages.ToList());
}
}
@ -199,7 +190,7 @@ namespace Model
if (b.Equals(obj))
{
b.EstFavori = value;
XML_Serializer.SetIle(Iles.ToList());
DataManager.SetIle(Iles.ToList());
}
}
@ -209,7 +200,7 @@ namespace Model
if (b.Equals(obj))
{
b.EstFavori = true;
XML_Serializer.SetFDD(Fruits.ToList());
DataManager.SetFDD(Fruits.ToList());
}
}
@ -219,7 +210,7 @@ namespace Model
if (b.Equals(obj))
{
b.EstFavori = value;
XML_Serializer.SetBestiaire(Bestiaire.ToList());
DataManager.SetBestiaire(Bestiaire.ToList());
}
}

@ -1,4 +1,5 @@
using System;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
@ -10,16 +11,72 @@ namespace Model.Serializer
{
public class XML_Serializer : IDataManager
{
public string Chemin { get; set; }
public XML_Serializer()
{
StubManager stubManager = new StubManager();
Chemin = Directory.GetCurrentDirectory();
if (File.Exists(Path.Combine(Chemin, "./personnage.xml"))==false)
{
SetPersonnage(stubManager.GetPersonnages().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./bateau.xml")) == false)
{
SetBateau(stubManager.GetBateaux().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./fruitdudemon.xml")) == false)
{
SetFDD(stubManager.GetFruits().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./bestiaire.xml")) == false)
{
SetBestiaire(stubManager.GetBestiaires().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./equipage.xml")) == false)
{
SetEquipage(stubManager.GetEquipages().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./ile.xml")) == false)
{
SetIle(stubManager.GetIles().ToList());
}
}
public XML_Serializer(string path)
{
Chemin= path;
StubManager stubManager = new StubManager();
if (File.Exists(Path.Combine(Chemin, "./personnage.xml")) == false)
{
SetPersonnage(stubManager.GetPersonnages().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./bateau.xml")) == false)
{
SetBateau(stubManager.GetBateaux().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./fruitdudemon.xml")) == false)
{
SetFDD(stubManager.GetFruits().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./bestiaire.xml")) == false)
{
SetBestiaire(stubManager.GetBestiaires().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./equipage.xml")) == false)
{
SetEquipage(stubManager.GetEquipages().ToList());
}
if (File.Exists(Path.Combine(Chemin, "./ile.xml")) == false)
{
SetIle(stubManager.GetIles().ToList());
}
}
public void SetPersonnage(List<Personnage> listePerso)
{
var serializer = new DataContractSerializer(typeof(List<Personnage>));
string xmlFile = "personnage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -36,7 +93,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<FruitDuDemon>));
string xmlFile = "fruitdudemon.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -54,7 +111,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Bestiaire>));
string xmlFile = "bestiaire.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -72,7 +129,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Equipage>));
string xmlFile = "equipage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -90,7 +147,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Ile>));
string xmlFile = "ile.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -108,7 +165,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Bateau>));
string xmlFile = "bateau.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -127,7 +184,7 @@ namespace Model.Serializer
List<Bateau> listeBateau = new List<Bateau>();
var serializer = new DataContractSerializer(typeof(List<Bateau>));
string xmlFile = "bateau.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -141,7 +198,7 @@ namespace Model.Serializer
List<Bestiaire> listeBest = new List<Bestiaire>();
var serializer = new DataContractSerializer(typeof(List<Bestiaire>));
string xmlFile = "bestiaire.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -154,7 +211,7 @@ namespace Model.Serializer
List<Equipage> listeEquip = new List<Equipage>();
var serializer = new DataContractSerializer(typeof(List<Equipage>));
string xmlFile = "equipage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -167,7 +224,7 @@ namespace Model.Serializer
List<FruitDuDemon> listeFDD = new List<FruitDuDemon>();
var serializer = new DataContractSerializer(typeof(List<FruitDuDemon>));
string xmlFile = "fruitdudemon.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -180,7 +237,7 @@ namespace Model.Serializer
List<Ile> listeIle = new List<Ile>();
var serializer = new DataContractSerializer(typeof(List<Ile>));
string xmlFile = "ile.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -193,7 +250,7 @@ namespace Model.Serializer
List<Personnage> listePerso = new List<Personnage>();
var serializer = new DataContractSerializer(typeof(List<Personnage>));
string xmlFile = "personnage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "C:\\Users\\yobrugiere1\\Documents\\Ohara\\Sources\\Ohara\\Resources\\XML"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{

@ -1,4 +1,5 @@
using System;
using Model.Serializer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -18,6 +19,7 @@ namespace Model.Stub
public StubManager()
{
StubPersonnage = new StubPersonnage();
StubFruitDuDemon = new StubFruitDuDemon();
StubEquipage = new StubEquipage();
@ -52,5 +54,35 @@ namespace Model.Stub
{
return StubIle.RecupererIle();
}
public void SetBateau(List<Bateau> listeBateaux)
{
throw new NotImplementedException();
}
public void SetBestiaire(List<Bestiaire> listeBest)
{
throw new NotImplementedException();
}
public void SetEquipage(List<Equipage> listeEquip)
{
throw new NotImplementedException();
}
public void SetFDD(List<FruitDuDemon> listeFDD)
{
throw new NotImplementedException();
}
public void SetIle(List<Ile> listeIle)
{
throw new NotImplementedException();
}
public void SetPersonnage(List<Personnage> listePerso)
{
throw new NotImplementedException();
}
}
}

@ -1,14 +1,17 @@
using Model;
using Model.Serializer;
using Model.Stub;
using Plugin.Maui.Audio;
namespace Ohara;
public partial class App : Application
{
public Manager manager { get; set; } = new Manager();
public Manager manager { get; set; } = new Manager(new XML_Serializer(FileSystem.Current.AppDataDirectory));
public App()
{
InitializeComponent();
InitializeComponent();
MainPage = new AppShell();
}

@ -7,28 +7,19 @@
<VerticalStackLayout Spacing="40">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<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="3">
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeBateau" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBateau_SelectionChanged" ItemsSource="{Binding Bateaux}" >
<CollectionView x:Name="listeBateau" ItemsSource="{Binding Bateaux}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBateau_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>

@ -8,7 +8,7 @@
<VerticalStackLayout Spacing="20">
<CollectionView x:Name="listeBest" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBest_SelectionChanged">
<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"/>

@ -12,7 +12,7 @@ public partial class PageBestiaire : ContentPage
public PageBestiaire()
{
InitializeComponent();
listeBest.ItemsSource = manager.GetBestiaires();
BindingContext = manager;
}
async void listeBest_SelectionChanged(object sender, SelectionChangedEventArgs e)

@ -7,48 +7,26 @@
<CollectionView x:Name="listeEquip" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeEquip_SelectionChanged">
<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 BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0" x:Name="searchBar" />
<Frame Grid.Column="2" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" >
<Label Text="Filtrer" />
<FlyoutBase.ContextFlyout>
<MenuFlyout >
<MenuFlyoutItem x:Name="Logia" Text="Logia" />
</MenuFlyout>
</FlyoutBase.ContextFlyout>
<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="3">
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="5">
<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 frameEquip}" >
<StackLayout Orientation="Vertical" Padding="5">
<Image Source="{Binding Image}"
@ -66,7 +44,7 @@
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>

@ -9,7 +9,8 @@ public partial class PageEquipage : ContentPage
public PageEquipage()
{
InitializeComponent();
listeEquip.ItemsSource = manager.GetEquipages();
BindingContext = manager;
}
async void listeEquip_SelectionChanged(object sender, SelectionChangedEventArgs e)

@ -7,20 +7,25 @@
<CollectionView x:Name="listeFDD" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeFDD_SelectionChanged" >
<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,*,100,10,100" 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"/>
<Frame x:Name="Logia" 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>
<Picker Title="Trier" Grid.Column="4" BackgroundColor="#bfe5ef">
<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>

@ -14,11 +14,11 @@ public partial class PageFDD : ContentPage
{
InitializeComponent();
listeFDD.ItemsSource = manager.GetFruits();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.GetFruits());
listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.Fruits.ToList());
}
searchBar.TextChanged += OnTextChanged;
FiltrerType = new Command((type) => listeFDD.ItemsSource = manager.FiltrerFDD(type.ToString()));

@ -7,28 +7,22 @@
<VerticalStackLayout Spacing="40">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<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="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<VerticalStackLayout BackgroundColor="#bfe5ef" Grid.Column="4">
<Button Text="Trier"/>
<Button Text="Nom croissant" IsVisible="False"/>
<Button Text="Nom décroissant" IsVisible="False"/>
</VerticalStackLayout>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeIle" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeIle_SelectionChanged" >
<CollectionView x:Name="listeIle" ItemsSource="{Binding Iles}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeIle_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>

@ -7,10 +7,12 @@ namespace Ohara;
public partial class PageIle : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageIle()
{
InitializeComponent();
listeIle.ItemsSource = manager.GetIles();
BindingContext = manager;
}
async void listeIle_SelectionChanged(object sender, SelectionChangedEventArgs e)

@ -7,28 +7,20 @@
<VerticalStackLayout Spacing="40">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<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="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listePerso_SelectionChanged">
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsSource="{Binding Personnages}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listePerso_SelectionChanged">
<CollectionView.ItemTemplate>
<DataTemplate>

@ -13,7 +13,7 @@ public partial class PagePersonnage : ContentPage
InitializeComponent();
listePerso.ItemsSource = manager.GetPersonnages();
BindingContext = manager;
}
void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e)

Loading…
Cancel
Save