merge
continuous-integration/drone/push Build was killed
Details
@ -0,0 +1,59 @@
|
|||||||
|
<?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.ModalBateau"
|
||||||
|
Title="ModalBateau"
|
||||||
|
BackgroundColor="#e2edf1"
|
||||||
|
Shell.PresentationMode="ModalAnimated">
|
||||||
|
<ScrollView>
|
||||||
|
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
|
||||||
|
<VerticalStackLayout Spacing="4" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Grid>
|
||||||
|
<Frame Padding="0" IsClippedToBounds="True">
|
||||||
|
|
||||||
|
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
|
||||||
|
</Grid>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierChap}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Episode :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierEp}" />
|
||||||
|
</HorizontalStackLayout >
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
|
||||||
|
</VerticalStackLayout >
|
||||||
|
<VerticalStackLayout Spacing="5" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
|
||||||
|
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Description :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</FlexLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</ContentPage>
|
@ -0,0 +1,58 @@
|
|||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class ModalBateau : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
public Bateau nouveauBateau;
|
||||||
|
public string ancienNom;
|
||||||
|
public ModalBateau()
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
nouveauBateau = manager.SelectedItem as Bateau;
|
||||||
|
ancienNom = nouveauBateau.Nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nouveauBateau = new Bateau("Bateau", " ",0,0," ", " ");
|
||||||
|
}
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = nouveauBateau;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.ModifierBateau(nouveauBateau, ancienNom);
|
||||||
|
nouveauBateau = manager.SelectedItem as Bateau;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manager.AjouterBateau(nouveauBateau);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var result = await FilePicker.PickAsync(new PickOptions
|
||||||
|
{
|
||||||
|
PickerTitle = "Choisissez une image ...",
|
||||||
|
FileTypes = FilePickerFileType.Images,
|
||||||
|
});
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var stream = result.FullPath;
|
||||||
|
nouveauBateau.Image = stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
<?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"
|
||||||
|
Shell.PresentationMode="ModalAnimated">
|
||||||
|
|
||||||
|
<ScrollView>
|
||||||
|
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
|
||||||
|
<VerticalStackLayout Spacing="4" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Grid>
|
||||||
|
<Frame Padding="0" IsClippedToBounds="True">
|
||||||
|
|
||||||
|
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
|
||||||
|
</Grid>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Origine :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Origine}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
|
||||||
|
</VerticalStackLayout >
|
||||||
|
<VerticalStackLayout Spacing="5" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
|
||||||
|
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Description :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</FlexLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</ContentPage>
|
@ -0,0 +1,58 @@
|
|||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class ModalBestiaire : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
public Bestiaire nouveauBest;
|
||||||
|
public string ancienNom;
|
||||||
|
public ModalBestiaire()
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
nouveauBest = manager.SelectedItem as Bestiaire;
|
||||||
|
ancienNom = nouveauBest.Nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nouveauBest = new Bestiaire("Bestiaire", " ", " ", " ");
|
||||||
|
}
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = nouveauBest;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.ModifierBest(nouveauBest, ancienNom);
|
||||||
|
nouveauBest = manager.SelectedItem as Bestiaire;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manager.AjouterBest(nouveauBest);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var result = await FilePicker.PickAsync(new PickOptions
|
||||||
|
{
|
||||||
|
PickerTitle = "Choisissez une image ...",
|
||||||
|
FileTypes = FilePickerFileType.Images,
|
||||||
|
});
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var stream = result.FullPath;
|
||||||
|
nouveauBest.Image = stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
<?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.ModalEquipage"
|
||||||
|
Title="ModalEquipage"
|
||||||
|
BackgroundColor="#e2edf1"
|
||||||
|
Shell.PresentationMode="ModalAnimated">
|
||||||
|
<ScrollView>
|
||||||
|
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
|
||||||
|
<VerticalStackLayout Spacing="4" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Grid>
|
||||||
|
<Frame Padding="0" IsClippedToBounds="True">
|
||||||
|
|
||||||
|
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
|
||||||
|
</Grid>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding NomRomanise}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Région :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Region}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierChap}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Episode :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierEp}" />
|
||||||
|
</HorizontalStackLayout >
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
|
||||||
|
</VerticalStackLayout >
|
||||||
|
<VerticalStackLayout Spacing="5" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}" HeightRequest="175">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="CenterAndExpand">
|
||||||
|
<CollectionView x:Name="listeCapitaine" SelectionChanged="AjoutCapitaine" SelectionMode="Single" HorizontalOptions="CenterAndExpand">
|
||||||
|
<CollectionView.Header>
|
||||||
|
<Label Text="Capitaine :"/>
|
||||||
|
</CollectionView.Header>
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="{Binding Nom}"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Frame x:Name="framePicker" Style="{StaticResource frameModif}" HeightRequest="250">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<ScrollView Orientation="Vertical">
|
||||||
|
<CollectionView x:Name="listeAllie" ItemsSource="{Binding Equipages}" SelectionChanged="AjoutAllie" SelectionMode="Multiple">
|
||||||
|
<CollectionView.Header>
|
||||||
|
<Label Text="Allié(s) :"/>
|
||||||
|
</CollectionView.Header>
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="{Binding Nom}"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
</ScrollView>
|
||||||
|
<ScrollView Orientation="Vertical">
|
||||||
|
<CollectionView x:Name="listeMembre" ItemsSource="{Binding Personnages}" SelectionChanged="AjoutMembre" SelectionMode="Multiple">
|
||||||
|
<CollectionView.Header>
|
||||||
|
<Label Text="Membre(s) :"/>
|
||||||
|
</CollectionView.Header>
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="{Binding Nom}"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
</ScrollView>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Statut :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Statut}" />
|
||||||
|
</HorizontalStackLayout >
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Description :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</FlexLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,82 @@
|
|||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class ModalEquipage : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
public Equipage nouvelEquipage;
|
||||||
|
public string ancienNom;
|
||||||
|
public ModalEquipage()
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
nouvelEquipage = manager.SelectedItem as Equipage;
|
||||||
|
ancienNom = nouvelEquipage.Nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nouvelEquipage = new Equipage("Equipage", " ", " ", 0,0,true," ");
|
||||||
|
}
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = nouvelEquipage;
|
||||||
|
framePicker.BindingContext = manager;
|
||||||
|
listeCapitaine.ItemsSource = manager.Personnages;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.ModifierEquipage(nouvelEquipage, ancienNom);
|
||||||
|
nouvelEquipage = manager.SelectedItem as Equipage;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manager.AjouterEquip(nouvelEquipage);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var result = await FilePicker.PickAsync(new PickOptions
|
||||||
|
{
|
||||||
|
PickerTitle = "Choisissez une image ...",
|
||||||
|
FileTypes = FilePickerFileType.Images,
|
||||||
|
});
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var stream = result.FullPath;
|
||||||
|
nouvelEquipage.Image = stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void AjoutAllie(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (nouvelEquipage.Allie != null)
|
||||||
|
nouvelEquipage.ViderAllie();
|
||||||
|
foreach (var equipage in listeAllie.SelectedItems)
|
||||||
|
{
|
||||||
|
nouvelEquipage.AjouterAllie(equipage as Equipage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void AjoutMembre(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (nouvelEquipage.Membre != null)
|
||||||
|
nouvelEquipage.ViderMembre();
|
||||||
|
foreach (var perso in listeMembre.SelectedItems)
|
||||||
|
{
|
||||||
|
nouvelEquipage.AjouterMembre(perso as Personnage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void AjoutCapitaine(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
nouvelEquipage.Capitaine = listeCapitaine.SelectedItem as Personnage;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
<?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"
|
||||||
|
Shell.PresentationMode="ModalAnimated">
|
||||||
|
<ScrollView>
|
||||||
|
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
|
||||||
|
<VerticalStackLayout Spacing="4" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Grid>
|
||||||
|
<Frame Padding="0" IsClippedToBounds="True">
|
||||||
|
|
||||||
|
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
|
||||||
|
</Grid>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding NomRomanise}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Type :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Type}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierChap}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Episode :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierEp}" />
|
||||||
|
</HorizontalStackLayout >
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
|
||||||
|
</VerticalStackLayout >
|
||||||
|
<VerticalStackLayout Spacing="5" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Description :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Forces :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Forces}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Faiblesses :" FontAttributes="Bold" />
|
||||||
|
<Editor Text="{Binding Faiblesses}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</FlexLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,57 @@
|
|||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class ModalFDD : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
public FruitDuDemon nouveauFdd;
|
||||||
|
public string ancienNom;
|
||||||
|
public ModalFDD()
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
nouveauFdd = manager.SelectedItem as FruitDuDemon;
|
||||||
|
ancienNom = nouveauFdd.Nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nouveauFdd = new FruitDuDemon("Fruit", " ", " ",0,0, " "," ","");
|
||||||
|
}
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = nouveauFdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.ModifierFDD(nouveauFdd, ancienNom);
|
||||||
|
nouveauFdd = manager.SelectedItem as FruitDuDemon;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manager.AjouterFDD(nouveauFdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var result = await FilePicker.PickAsync(new PickOptions
|
||||||
|
{
|
||||||
|
PickerTitle = "Choisissez une image ...",
|
||||||
|
FileTypes = FilePickerFileType.Images,
|
||||||
|
});
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var stream = result.FullPath;
|
||||||
|
nouveauFdd.Image = stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +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.ModalIle"
|
||||||
|
Title="ModalIle"
|
||||||
|
BackgroundColor="#e2edf1"
|
||||||
|
Shell.PresentationMode="ModalAnimated">
|
||||||
|
<ScrollView>
|
||||||
|
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
|
||||||
|
<VerticalStackLayout Spacing="4" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Grid>
|
||||||
|
<Frame Padding="0" IsClippedToBounds="True">
|
||||||
|
|
||||||
|
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
|
||||||
|
</Grid>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding NomRomanise}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Region :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Region}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierChap}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Premier Episode :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding PremierEp}" />
|
||||||
|
</HorizontalStackLayout >
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
|
||||||
|
</VerticalStackLayout >
|
||||||
|
<VerticalStackLayout Spacing="5" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Description :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Geographie :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Geographie}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</FlexLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,59 @@
|
|||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class ModalIle : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
public Ile nouvelIle;
|
||||||
|
public string ancienNom;
|
||||||
|
public ModalIle()
|
||||||
|
{
|
||||||
|
if(manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
nouvelIle=(Ile)manager.SelectedItem;
|
||||||
|
ancienNom = manager.SelectedItem.Nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.nouvelIle = new Ile("Ile", "", "", 0, 0, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = nouvelIle;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.ModifierIle(nouvelIle,ancienNom);
|
||||||
|
manager.SelectedItem=nouvelIle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manager.AjouterIle(nouvelIle);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var result = await FilePicker.PickAsync(new PickOptions
|
||||||
|
{
|
||||||
|
PickerTitle = "Choisissez une image ...",
|
||||||
|
FileTypes = FilePickerFileType.Images,
|
||||||
|
});
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var stream = result.FullPath;
|
||||||
|
nouvelIle.Image = stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
<?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"
|
||||||
|
Shell.PresentationMode="ModalAnimated">
|
||||||
|
<ScrollView>
|
||||||
|
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
|
||||||
|
<VerticalStackLayout Spacing="4" Margin="2">
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Nom :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Grid>
|
||||||
|
<Frame Padding="0" IsClippedToBounds="True">
|
||||||
|
|
||||||
|
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Prime :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Prime}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Epithete :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Epithete}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Taille :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Taille}" />
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Origine :" FontAttributes="Bold"/>
|
||||||
|
<Entry Text="{Binding Origine}" />
|
||||||
|
</HorizontalStackLayout >
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
|
||||||
|
</VerticalStackLayout >
|
||||||
|
<VerticalStackLayout Spacing="5" Margin="2">
|
||||||
|
<Frame x:Name="framePicker" Style="{StaticResource frameModif}" HeightRequest="300">
|
||||||
|
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<ScrollView Orientation="Vertical">
|
||||||
|
<CollectionView x:Name="listeEquipages" ItemsSource="{Binding Equipages}" SelectionChanged="AjoutEquipage" SelectionMode="Single">
|
||||||
|
<CollectionView.Header>
|
||||||
|
<Label Text="Equipage :"/>
|
||||||
|
</CollectionView.Header>
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="{Binding Nom}"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
</ScrollView>
|
||||||
|
<ScrollView Orientation="Vertical">
|
||||||
|
<CollectionView x:Name="listeFruits" ItemsSource="{Binding Fruits}" SelectionChanged="AjoutFruit" SelectionMode="Multiple">
|
||||||
|
<CollectionView.Header>
|
||||||
|
<Label Text="Fruit(s) du démon :"/>
|
||||||
|
</CollectionView.Header>
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="{Binding Nom}"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
</CollectionView>
|
||||||
|
</ScrollView>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Biographie :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Biographie}" WidthRequest="300" HeightRequest="200"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Frame Style="{StaticResource frameModif}">
|
||||||
|
<HorizontalStackLayout HorizontalOptions="Center">
|
||||||
|
<Label Text="Citation :" FontAttributes="Bold"/>
|
||||||
|
<Editor Text="{Binding Citation}" WidthRequest="300" HeightRequest="150"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Frame>
|
||||||
|
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</FlexLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,74 @@
|
|||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class ModalPersonnage : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
public Personnage nouveauPerso;
|
||||||
|
public string ancienNom;
|
||||||
|
public ModalPersonnage()
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
nouveauPerso = manager.SelectedItem as Personnage;
|
||||||
|
ancienNom = nouveauPerso.Nom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nouveauPerso = new Personnage("Personnage",0, " ", 0, 0, " ", " ", "");
|
||||||
|
}
|
||||||
|
InitializeComponent();
|
||||||
|
BindingContext = nouveauPerso;
|
||||||
|
framePicker.BindingContext = manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (manager.SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.ModifierPerso(nouveauPerso, ancienNom);
|
||||||
|
nouveauPerso = manager.SelectedItem as Personnage;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manager.AjouterPerso(nouveauPerso);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PopModalAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var result = await FilePicker.PickAsync(new PickOptions
|
||||||
|
{
|
||||||
|
PickerTitle = "Choisissez une image ...",
|
||||||
|
FileTypes = FilePickerFileType.Images,
|
||||||
|
});
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var stream = result.FullPath;
|
||||||
|
nouveauPerso.Image = stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AjoutEquipage(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
nouveauPerso.Equipage = listeEquipages.SelectedItem as Equipage;
|
||||||
|
}
|
||||||
|
private void AjoutFruit(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (nouveauPerso.Fruit != null)
|
||||||
|
nouveauPerso.ViderFruit();
|
||||||
|
foreach(var fruit in listeFruits.SelectedItems)
|
||||||
|
{
|
||||||
|
nouveauPerso.AjouterFruit(fruit as FruitDuDemon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,52 @@
|
|||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Model;
|
|
||||||
using Plugin.Maui.Audio;
|
using Plugin.Maui.Audio;
|
||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
public partial class PageBateau : ContentPage
|
public partial class PageBateau : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
|
||||||
public PageBateau()
|
public PageBateau()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var manager = new Manager();
|
BindingContext = manager;
|
||||||
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
|
listeBateau.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bateaux.ToList()));
|
||||||
|
}
|
||||||
|
searchBar.TextChanged += OnTextChanged;
|
||||||
|
|
||||||
listeBateau.ItemsSource = manager.GetBateaux();
|
}
|
||||||
|
|
||||||
|
async void listeBateau_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.CurrentSelection.Count == 0) return;
|
||||||
|
manager.SelectedItem = (Bateau)listeBateau.SelectedItem;
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoBateau));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void Button_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalBateau));
|
||||||
|
}
|
||||||
|
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var picker = (Picker)sender;
|
||||||
|
int selectedIndex = picker.SelectedIndex;
|
||||||
|
if (selectedIndex != -1)
|
||||||
|
{
|
||||||
|
listeBateau.ItemsSource = manager.FiltrerBateau(((Equipage)picker.ItemsSource[selectedIndex]).Nom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
listeBateau.SelectedItem = null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,20 +1,45 @@
|
|||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Model;
|
|
||||||
using Plugin.Maui.Audio;
|
using Plugin.Maui.Audio;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
public partial class PageBestiaire : ContentPage
|
public partial class PageBestiaire : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
|
||||||
public PageBestiaire()
|
public PageBestiaire()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
BindingContext = manager;
|
||||||
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
|
BindableLayout.SetItemsSource(listeBest, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bestiaire.ToList())));
|
||||||
|
}
|
||||||
|
searchBar.TextChanged += OnTextChanged;
|
||||||
|
}
|
||||||
|
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
BindableLayout.SetItemsSource(listeBest, manager.Bestiaire);
|
||||||
|
}
|
||||||
|
|
||||||
var manager = new Manager();
|
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
listeBest.ItemsSource = manager.GetBestiaires();
|
await Navigation.PushModalAsync(new ModalBestiaire());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,72 +1,42 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-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"
|
||||||
xmlns:local="clr-namespace:Ohara"
|
|
||||||
x:Class="Ohara.PageEquipage"
|
x:Class="Ohara.PageEquipage"
|
||||||
Title="PageEquipage"
|
Title="PageEquipage"
|
||||||
|
Appearing="ContentPage_Appearing"
|
||||||
BackgroundColor="#e2edf1">
|
BackgroundColor="#e2edf1">
|
||||||
<Grid>
|
<ScrollView>
|
||||||
<Grid.RowDefinitions>
|
<VerticalStackLayout>
|
||||||
<RowDefinition Height="2*" />
|
<Grid ColumnDefinitions="200,*,150" BackgroundColor="#72a3b3" Padding="10">
|
||||||
</Grid.RowDefinitions>
|
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
|
||||||
<Grid.ColumnDefinitions>
|
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
|
||||||
<ColumnDefinition Width="300" />
|
|
||||||
<ColumnDefinition Width="90*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
|
|
||||||
|
|
||||||
<ScrollView Grid.Row="0" Grid.Column="1" >
|
|
||||||
<VerticalStackLayout Spacing="10">
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
|
|
||||||
<Label Text="Trier" HorizontalTextAlignment="Center" />
|
|
||||||
</Frame>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<FlexLayout x:Name="listEquip" AlignItems="Center" Wrap="Wrap"
|
||||||
<CollectionView x:Name="listeEquip" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
|
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
|
||||||
<CollectionView.ItemTemplate>
|
<BindableLayout.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20">
|
<Frame Style="{StaticResource frameEquip}" Margin="0,10,0,0" >
|
||||||
<Grid.ColumnDefinitions>
|
<Frame.GestureRecognizers>
|
||||||
<ColumnDefinition Width="25*"/>
|
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Frame.GestureRecognizers>
|
||||||
<Frame Style="{StaticResource frameEquip}" >
|
|
||||||
<StackLayout Orientation="Vertical" Padding="5">
|
<StackLayout Orientation="Vertical" Padding="5">
|
||||||
<Image Source="{Binding Image}"
|
<Image
|
||||||
HeightRequest="290"
|
Source="{Binding Image}"
|
||||||
WidthRequest="290"/>
|
HeightRequest="280"
|
||||||
|
WidthRequest="280" />
|
||||||
<Label
|
<Label
|
||||||
HorizontalOptions="Center"
|
HorizontalOptions="Center"
|
||||||
VerticalOptions="Start"
|
VerticalOptions="Start"
|
||||||
HorizontalTextAlignment="Center"
|
HorizontalTextAlignment="Center"
|
||||||
Text="{Binding Nom}"
|
Text="{Binding Nom}"
|
||||||
|
|
||||||
FontSize="19"
|
FontSize="19"
|
||||||
TextColor="White"
|
TextColor="White"
|
||||||
FontAttributes="Bold" />
|
FontAttributes="Bold" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</CollectionView.ItemTemplate>
|
</BindableLayout.ItemTemplate>
|
||||||
</CollectionView>
|
</FlexLayout>
|
||||||
</VerticalStackLayout>
|
</VerticalStackLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
</ContentPage>
|
@ -1,21 +1,42 @@
|
|||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
using Model;
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Plugin.Maui.Audio;
|
using Plugin.Maui.Audio;
|
||||||
|
|
||||||
public partial class PageEquipage : ContentPage
|
public partial class PageEquipage : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
public PageEquipage()
|
public PageEquipage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var manager = new Manager();
|
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
|
||||||
listeEquip.ItemsSource = manager.GetEquipages();
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
|
BindableLayout.SetItemsSource(listEquip,manager.RechercheObjetOhara(searchBar.Text,new List<ObjetOhara>(manager.Equipages.ToList())));
|
||||||
}
|
}
|
||||||
|
searchBar.TextChanged += OnTextChanged;
|
||||||
|
|
||||||
private void listeEquip_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
|
}
|
||||||
|
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Equipage SelectedItem = manager.Equipages.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
|
||||||
|
if (SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = SelectedItem;
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoEquipage));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalEquipage));
|
||||||
|
}
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,103 +1,62 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-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"
|
||||||
xmlns:local="clr-namespace:Ohara"
|
|
||||||
x:Class="Ohara.PageFDD"
|
x:Class="Ohara.PageFDD"
|
||||||
Title="PageFDD"
|
Title="PageFDD"
|
||||||
|
Appearing="ContentPage_Appearing"
|
||||||
BackgroundColor="#e2edf1">
|
BackgroundColor="#e2edf1">
|
||||||
|
<ScrollView>
|
||||||
|
<VerticalStackLayout>
|
||||||
<Grid>
|
<Grid ColumnDefinitions="200,*,100,10,150" BackgroundColor="#72a3b3" Padding="10">
|
||||||
|
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="2*" />
|
<Picker Title="Filtrer" Grid.Column="2" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
|
||||||
</Grid.RowDefinitions>
|
<Picker.ItemsSource>
|
||||||
<Grid.ColumnDefinitions>
|
<x:Array Type="{x:Type x:String}">
|
||||||
<ColumnDefinition Width="300" />
|
<x:String>Aucun</x:String>
|
||||||
<ColumnDefinition Width="90*" />
|
<x:String>Logia</x:String>
|
||||||
</Grid.ColumnDefinitions>
|
<x:String>Paramecia</x:String>
|
||||||
|
<x:String>Zoan Carnivore</x:String>
|
||||||
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
|
<x:String>Zoan Mythique</x:String>
|
||||||
|
</x:Array>
|
||||||
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="10">
|
</Picker.ItemsSource>
|
||||||
|
</Picker>
|
||||||
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
|
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="4"/>
|
||||||
<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>
|
|
||||||
|
|
||||||
</Frame>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
|
|
||||||
<Label Text="Trier" HorizontalTextAlignment="Center" />
|
|
||||||
</Frame>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<FlexLayout x:Name="listeFDD" AlignItems="Center" Wrap="Wrap"
|
||||||
<CollectionView x:Name="listeFDD" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
|
HorizontalOptions="Center"
|
||||||
<CollectionView.ItemTemplate>
|
BindableLayout.ItemsSource="{Binding Fruits}" JustifyContent="SpaceEvenly">
|
||||||
|
<BindableLayout.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Padding="20" >
|
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
|
||||||
<Grid.ColumnDefinitions>
|
<Frame.GestureRecognizers>
|
||||||
<ColumnDefinition Width="33*"/>
|
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
|
||||||
|
</Frame.GestureRecognizers>
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
|
|
||||||
<Frame Style="{StaticResource frameObjet}"
|
|
||||||
|
|
||||||
>
|
|
||||||
<StackLayout Orientation="Vertical" Padding="5">
|
<StackLayout Orientation="Vertical" Padding="5">
|
||||||
<Image
|
<Image
|
||||||
Source="{Binding Image}"
|
Source="{Binding Image}"
|
||||||
HeightRequest="290"
|
HeightRequest="280"
|
||||||
WidthRequest="290" />
|
WidthRequest="280" />
|
||||||
|
|
||||||
<Label
|
<Label
|
||||||
HorizontalOptions="Center"
|
HorizontalOptions="Center"
|
||||||
VerticalOptions="Start"
|
VerticalOptions="Start"
|
||||||
HorizontalTextAlignment="Center"
|
HorizontalTextAlignment="Center"
|
||||||
Text="{Binding Nom}"
|
Text="{Binding Nom}"
|
||||||
|
|
||||||
FontSize="19"
|
FontSize="19"
|
||||||
TextColor="#72a3b3"
|
TextColor="#72a3b3"
|
||||||
FontAttributes="Bold" />
|
FontAttributes="Bold" />
|
||||||
|
|
||||||
<Label
|
<Label
|
||||||
VerticalOptions="Center"
|
VerticalOptions="Center"
|
||||||
HorizontalOptions="Center"
|
HorizontalOptions="Center"
|
||||||
Text="{Binding Type}"
|
Text="{Binding Type}"
|
||||||
FontAttributes="Italic"
|
FontAttributes="Italic"
|
||||||
TextColor="#72a3b3"/>
|
TextColor="#72a3b3"/>
|
||||||
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</CollectionView.ItemTemplate>
|
</BindableLayout.ItemTemplate>
|
||||||
</CollectionView>
|
</FlexLayout>
|
||||||
|
|
||||||
</VerticalStackLayout>
|
</VerticalStackLayout>
|
||||||
</Grid>
|
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
</ContentPage>
|
</ContentPage>
|
@ -1,52 +1,67 @@
|
|||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
|
|
||||||
using Model;
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Plugin.Maui.Audio;
|
using Plugin.Maui.Audio;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
public partial class PageFDD : ContentPage
|
public partial class PageFDD : ContentPage
|
||||||
{
|
{
|
||||||
public ICommand FiltrerType { get; private set; }
|
public ICommand FiltrerType { get; private set; }
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
|
||||||
public PageFDD()
|
public PageFDD()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var manager = new Manager();
|
BindingContext = manager;
|
||||||
|
|
||||||
|
|
||||||
listeFDD.ItemsSource = manager.GetFruits();
|
|
||||||
void OnTextChanged(object sender, EventArgs e)
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SearchBar searchBar = (SearchBar)sender;
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.GetFruits());
|
BindableLayout.SetItemsSource(listeFDD, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(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 async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
|
||||||
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
FruitDuDemon SelectedItem = manager.Fruits.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
|
||||||
|
if (SelectedItem != null)
|
||||||
|
{
|
||||||
|
//do something you want
|
||||||
|
manager.SelectedItem = SelectedItem;
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoFdd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Button_Clicked(object sender, EventArgs e)
|
||||||
private void MenuFlyoutItem_Clicked(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalFDD));
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
{
|
||||||
|
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
BindableLayout.SetItemsSource(listeFDD, manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
<?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.PageFavoris"
|
||||||
|
Title="PageFavoris"
|
||||||
|
Appearing="ContentPage_Appearing"
|
||||||
|
BackgroundColor="#e2edf1">
|
||||||
|
|
||||||
|
<ScrollView>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Grid ColumnDefinitions="*" BackgroundColor="#72a3b3" Padding="10">
|
||||||
|
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" HorizontalOptions="Center" WidthRequest="300"/>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
<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>
|
@ -0,0 +1,81 @@
|
|||||||
|
|
||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
|
namespace Ohara;
|
||||||
|
|
||||||
|
public partial class PageFavoris : ContentPage
|
||||||
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
|
||||||
|
public PageFavoris()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
|
||||||
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
|
BindableLayout.SetItemsSource(listeFav, manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris()));
|
||||||
|
}
|
||||||
|
searchBar.TextChanged += OnTextChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
ObjetOhara SelectedItem = manager.GetFavoris().FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
|
||||||
|
if (SelectedItem != null)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = SelectedItem;
|
||||||
|
Type t = manager.SelectedItem.GetType();
|
||||||
|
if (t.Equals(typeof(Bateau)))
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoBateau));
|
||||||
|
}
|
||||||
|
else if (t.Equals(typeof(Equipage)))
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoEquipage));
|
||||||
|
}
|
||||||
|
else if (t.Equals(typeof(Personnage)))
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
|
||||||
|
}
|
||||||
|
else if (t.Equals(typeof(Ile)))
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoIle));
|
||||||
|
}
|
||||||
|
else if (t.Equals(typeof(FruitDuDemon)))
|
||||||
|
{
|
||||||
|
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoFdd));
|
||||||
|
}
|
||||||
|
else if (t.Equals(typeof(Bestiaire)))
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoBestiaire));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var picker = (Picker)sender;
|
||||||
|
int selectedIndex = picker.SelectedIndex;
|
||||||
|
if (selectedIndex == 0)
|
||||||
|
{
|
||||||
|
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// listeFavs.ItemsSource = manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,23 +1,55 @@
|
|||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Model;
|
|
||||||
using Plugin.Maui.Audio;
|
using Plugin.Maui.Audio;
|
||||||
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
|
|
||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
public partial class PageIle : ContentPage
|
public partial class PageIle : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
|
||||||
public PageIle()
|
public PageIle()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var manager = new Manager();
|
BindingContext = manager;
|
||||||
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
listeIle.ItemsSource = manager.GetIles();
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
|
listeIle.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Iles.ToList()));
|
||||||
}
|
}
|
||||||
|
searchBar.TextChanged += OnTextChanged;
|
||||||
|
|
||||||
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
|
}
|
||||||
|
async void listeIle_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (e.CurrentSelection.Count == 0) return;
|
||||||
|
manager.SelectedItem=(Ile)listeIle.SelectedItem;
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoIle));
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Button_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalIle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var picker = (Picker)sender;
|
||||||
|
int selectedIndex = picker.SelectedIndex;
|
||||||
|
if (selectedIndex == 0)
|
||||||
|
{
|
||||||
|
listeIle.ItemsSource =manager.Iles.ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
listeIle.ItemsSource = manager.FiltrerIle((string)picker.ItemsSource[selectedIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
listeIle.SelectedItem = null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,16 +1,52 @@
|
|||||||
using Model;
|
using Model.Classes;
|
||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
|
using Model.Managers;
|
||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
public partial class PageInfoFdd : ContentPage
|
public partial class PageInfoFdd : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
public PageInfoFdd()
|
public PageInfoFdd()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var manager = new Manager();
|
if (manager.SelectedItem?.EstFavori == true)
|
||||||
listObj.ItemsSource = manager.GetFruits();
|
{
|
||||||
|
bouttonFav.IsEnabled = false;
|
||||||
|
bouttonFav.Text = "Ajouté au favoris";
|
||||||
|
retirerFav.IsVisible = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
BindingContext = manager.SelectedItem;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
private void AjouterFav_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, true);
|
||||||
|
bouttonFav.IsEnabled = false;
|
||||||
|
bouttonFav.Text = "Ajouté au favoris";
|
||||||
|
retirerFav.IsVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RetirerFav_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Modifier_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalFDD), true);
|
||||||
|
}
|
||||||
|
>>>>>>> master
|
||||||
}
|
}
|
@ -1,18 +1,53 @@
|
|||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Model;
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
public partial class PageInfoIle : ContentPage
|
public partial class PageInfoIle : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
public PageInfoIle()
|
public PageInfoIle()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Manager manager = new Manager();
|
if (manager.SelectedItem?.EstFavori == true)
|
||||||
|
{
|
||||||
|
bouttonFav.IsEnabled = false;
|
||||||
|
bouttonFav.Text = "Ajouté au favoris";
|
||||||
|
retirerFav.IsVisible = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
BindingContext = manager.SelectedItem;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
private void AjouterFav_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.ModifierFavIle((Ile)manager.SelectedItem, true);
|
||||||
|
bouttonFav.IsEnabled = false;
|
||||||
|
bouttonFav.Text = "Ajouté au favoris";
|
||||||
|
retirerFav.IsVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
listeIle.ItemsSource = manager.GetIles();
|
private void RetirerFav_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Modifier_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalIle), true);
|
||||||
|
}
|
||||||
|
>>>>>>> master
|
||||||
}
|
}
|
@ -1,18 +1,79 @@
|
|||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
using Model;
|
using Model.Managers;
|
||||||
using Plugin.Maui.Audio;
|
using Model.Classes;
|
||||||
|
|
||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
public partial class PageInfoPersonnage : ContentPage
|
public partial class PageInfoPersonnage : ContentPage
|
||||||
{
|
{
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
public PageInfoPersonnage()
|
public PageInfoPersonnage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Manager manager = new Manager();
|
if (manager.SelectedItem?.EstFavori == true)
|
||||||
|
{
|
||||||
|
bouttonFav.IsEnabled = false;
|
||||||
|
bouttonFav.Text = "Ajouté au favoris";
|
||||||
|
retirerFav.IsVisible = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (((Personnage)manager.SelectedItem).Equipage == null)
|
||||||
|
bouttonAffiliation.IsVisible = false;
|
||||||
|
BindingContext = manager.SelectedItem;
|
||||||
|
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
listePerso.ItemsSource = manager.GetPersonnages();
|
listePerso.ItemsSource = manager.GetPersonnages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AjouterFav_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.ModifierFavPerso((Personnage)manager.SelectedItem, true);
|
||||||
|
bouttonFav.IsEnabled = false;
|
||||||
|
bouttonFav.Text = "Ajouté au favoris";
|
||||||
|
retirerFav.IsVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RetirerFav_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.ModifierFavPerso((Personnage)manager.SelectedItem, false);
|
||||||
|
bouttonFav.IsEnabled = true;
|
||||||
|
bouttonFav.Text = "Ajouter au favoris";
|
||||||
|
retirerFav.IsVisible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void listFruit_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (e.CurrentSelection.Count == 0) return;
|
||||||
|
manager.SelectedItem = (FruitDuDemon)listFruit.SelectedItem;
|
||||||
|
await Navigation.PushAsync(new PageInfoFdd());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
listFruit.SelectedItem = null;
|
||||||
|
}
|
||||||
|
private async void Supprimer_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SupprimerPerso((Personnage)manager.SelectedItem);
|
||||||
|
await Navigation.PopAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Modifier_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(nameof(ModalPersonnage), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonAffiliation_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
manager.SelectedItem = (manager.SelectedItem as Personnage).Equipage;
|
||||||
|
await Navigation.PushAsync(new PageInfoEquipage());
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> master
|
||||||
}
|
}
|
@ -1,19 +1,51 @@
|
|||||||
namespace Ohara;
|
namespace Ohara;
|
||||||
|
|
||||||
using Model;
|
using Model.Classes;
|
||||||
|
using Model.Managers;
|
||||||
using Model.Stub;
|
using Model.Stub;
|
||||||
|
|
||||||
|
|
||||||
using Plugin.Maui.Audio;
|
using Plugin.Maui.Audio;
|
||||||
public partial class PagePersonnage : ContentPage
|
public partial class PagePersonnage : ContentPage
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
public Manager manager => (App.Current as App).manager;
|
||||||
|
>>>>>>> master
|
||||||
public PagePersonnage()
|
public PagePersonnage()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var manager = new Manager();
|
BindingContext = manager;
|
||||||
|
void OnTextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchBar searchBar = (SearchBar)sender;
|
||||||
|
listePerso.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Personnages.ToList()));
|
||||||
|
}
|
||||||
|
searchBar.TextChanged += OnTextChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
async void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.CurrentSelection.Count == 0) return;
|
||||||
|
manager.SelectedItem = (Personnage)listePerso.SelectedItem;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
listePerso.ItemsSource = manager.GetPersonnages();
|
listePerso.ItemsSource = manager.GetPersonnages();
|
||||||
|
=======
|
||||||
|
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
listePerso.SelectedItem = null;
|
||||||
|
}
|
||||||
|
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
manager.SelectedItem = null;
|
||||||
|
await Navigation.PushModalAsync(new ModalPersonnage());
|
||||||
|
>>>>>>> master
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
After Width: | Height: | Size: 788 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 35 KiB |