Résolution conflit
continuous-integration/drone/push Build is failing
Details
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage x:Class="Views.Animaux"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
Title="Wikipet's"
|
||||
IconImageSource="{FontImage FontFamily=Raleway}">
|
||||
<ScrollView>
|
||||
<!-- To manage the position of elements on the page -->
|
||||
<toolkit:DockLayout>
|
||||
<!-- To add a pet -->
|
||||
<Button Text="+"
|
||||
toolkit:DockLayout.DockPosition="Bottom"
|
||||
VerticalOptions="End"
|
||||
HorizontalOptions="End"
|
||||
Clicked="Button_OnClick"
|
||||
FontSize="30"
|
||||
Padding="2"/>
|
||||
<VerticalStackLayout>
|
||||
<Grid RowDefinitions="Auto, *"
|
||||
RowSpacing="20">
|
||||
<!-- To display the list of pets -->
|
||||
<ListView ItemsSource="{Binding ListeAnimaux}"
|
||||
Grid.Row="1"
|
||||
ItemTapped="OnClick">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid Margin="0,10,0,10">
|
||||
<Border>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="3*"
|
||||
ColumnSpacing="15">
|
||||
<!-- To display the image -->
|
||||
<Frame Grid.RowSpan="3">
|
||||
<Image Source="{Binding Image}"/>
|
||||
</Frame>
|
||||
<VerticalStackLayout Grid.Column="1">
|
||||
<!-- To display the pet's name -->
|
||||
<Label Text="{Binding Nom}"
|
||||
FontSize="Large"/>
|
||||
|
||||
<!-- To display species -->
|
||||
<Label Text="{Binding Espece}"
|
||||
FontSize="12"
|
||||
FontFamily="Raleway"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</toolkit:DockLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,53 @@
|
||||
/*!
|
||||
* \file Animal.xaml.cs
|
||||
* \author Léana Besson
|
||||
*/
|
||||
using Model;
|
||||
|
||||
/*!
|
||||
* \namespace Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class Animaux
|
||||
* \brief Regroups functions for the proper operation of the Pets page
|
||||
*/
|
||||
public partial class Animaux : ContentPage
|
||||
{
|
||||
/*!
|
||||
* \fn Animaux()
|
||||
* \brief Animaux page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public Animaux()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = (App.Current as App).Theque;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn OnClick(object sender, ItemTappedEventArgs e)
|
||||
* \brief Saves the pet selected by the user and opens a new DetailAnimal page
|
||||
* \param sender object - Event emitter information, namely the Animaux.xaml page
|
||||
* \param e ItemTappedEventArgs - Information on selected pet
|
||||
*/
|
||||
public void OnClick(object sender, ItemTappedEventArgs e)
|
||||
{
|
||||
(App.Current as App).AnimalSelectionner = e.Item as Animal;
|
||||
Navigation.PushAsync(new DetailAnimal());
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn Button_OnClick(object sender, EventArgs e)
|
||||
* \brief Adds an pet to the theque and opens the pet's data entry page
|
||||
* \param sender object - Event emitter information, namely the Animals.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
public async void Button_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current as App).AnimalSelectionner = (App.Current as App).Theque.AjouterAnimal();
|
||||
(App.Current as App).PageDeSaisie?.InitBinding();
|
||||
await Shell.Current.GoToAsync("//New_DetailAnimal");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
<?xml version = "1.0" encoding = "UTF-8" ?>
|
||||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
x:Class="Views.App">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
|
||||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Shell
|
||||
x:Class="Views.AppShell"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
Shell.FlyoutBehavior="Disabled">
|
||||
|
||||
<!-- Page navigation bar -->
|
||||
<TabBar>
|
||||
<!-- Go to home page -->
|
||||
<ShellContent Title="Accueil"
|
||||
ContentTemplate="{DataTemplate local:MainPage}"
|
||||
Route="MainPage" />
|
||||
|
||||
<!-- To go to the species list -->
|
||||
<ShellContent Title="Les espèces"
|
||||
ContentTemplate="{DataTemplate local:Especes}"
|
||||
Route="Especes" />
|
||||
|
||||
<!-- To go to the user's pet list -->
|
||||
<ShellContent Title="Vos animaux"
|
||||
ContentTemplate="{DataTemplate local:Animaux}"
|
||||
Route="Animaux"/>
|
||||
</TabBar>
|
||||
|
||||
<!-- To go to the add a pet page without the page being in the navigation bar -->
|
||||
<ShellContent Title="Ajout d'un animal"
|
||||
ContentTemplate="{DataTemplate local:New_DetailAnimal}"
|
||||
Route="New_DetailAnimal"/>
|
||||
</Shell>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:controls="clr-namespace:Views"
|
||||
x:Class="Views.DetailAnimal"
|
||||
Title="{Binding Nom}">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<HorizontalStackLayout VerticalOptions="Start"
|
||||
HorizontalOptions="End">
|
||||
<!-- To delete the pet -->
|
||||
<Button Text="Supprimer"
|
||||
Clicked="Button_OnClick"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<controls:View_DetailAnimal/>
|
||||
|
||||
<VerticalStackLayout x:Name="PetAdvice"
|
||||
Margin="0,10,0,10">
|
||||
<Label Text="Conseils"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Conseil}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,64 @@
|
||||
/*!
|
||||
* \file Animal.xaml.cs
|
||||
* \author Léana Besson
|
||||
*/
|
||||
using Model;
|
||||
using Persistance;
|
||||
|
||||
/*!
|
||||
* \namespace Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class DetailAnimal
|
||||
* \brief Regroups functions for DetailAnimal page operation
|
||||
*/
|
||||
public partial class DetailAnimal : ContentPage
|
||||
{
|
||||
/*!
|
||||
* \fn AppShell()
|
||||
* \brief Animaux page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public DetailAnimal()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = (App.Current as App).AnimalSelectionner;
|
||||
if((App.Current as App).AnimalSelectionner.Espece != null)
|
||||
{
|
||||
if ((App.Current as App).AnimalSelectionner.Race != null)
|
||||
{
|
||||
PetAdvice.BindingContext = (App.Current as App).AnimalSelectionner.Race;
|
||||
}
|
||||
else PetAdvice.BindingContext = (App.Current as App).AnimalSelectionner.Espece;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn Button_OnClick(object sender, EventArgs e)
|
||||
* \brief Delete the animal from the theque, serialize the theque and go to the Animaux page
|
||||
* \param sender object - Event emitter information, namely the DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
public async void Button_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current as App).Theque.SupprimerAnimal((App.Current as App).AnimalSelectionner);
|
||||
DataSerializerBinary.Serializer((App.Current as App).SerializationPath, (App.Current as App).Theque);
|
||||
await Shell.Current.GoToAsync("//Animaux");
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn OnBackButtonPressed()
|
||||
* \brief If the Name is valid the theque is serialized
|
||||
* \return False if the button is pressed and True otherwise
|
||||
*/
|
||||
protected override bool OnBackButtonPressed()
|
||||
{
|
||||
if((App.Current as App).AnimalSelectionner.NomIsValid == true)
|
||||
{
|
||||
DataSerializerBinary.Serializer((App.Current as App).SerializationPath, (App.Current as App).Theque);
|
||||
return base.OnBackButtonPressed();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<!-- To diplay species name -->
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Views.DetailEspece"
|
||||
Title="{Binding Nom}"
|
||||
IconImageSource="{FontImage FontFamily=Raleway}">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<!-- To diplay species image -->
|
||||
<Image Source="{Binding Image}"
|
||||
MaximumWidthRequest="300"
|
||||
Margin="20"
|
||||
HorizontalOptions="Center"/>
|
||||
<Border VerticalOptions="Start"
|
||||
Grid.Column="1"
|
||||
Margin="0,10,0,10">
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *"
|
||||
RowSpacing="8">
|
||||
<!-- To diplay species scientific name -->
|
||||
<Label Text="Nom scientifique"/>
|
||||
<Label Grid.Column="1"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding NomScientifique}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
|
||||
<!-- To diplay species life expectancy -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Espérance de vie"/>
|
||||
<Label Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding EsperanceVie}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
|
||||
<!-- To diplay species average weight -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Poids moyen"/>
|
||||
<Label Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding PoidsMoyen}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
|
||||
<!-- To diplay species average height -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Taille moyenne"/>
|
||||
<Label Grid.Column="2"
|
||||
Grid.Row="3"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding TailleMoyenne}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- To diplay information on the species behavior -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Comportement"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Comportement}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the species health -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Santé"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Sante}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the species education -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Education"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Education}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the species maintenance -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Entretien"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Entretien}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the species cost -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Coût potentiel"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Cout}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay species advice -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Conseils"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Conseil}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To display the list of species breeds -->
|
||||
<Grid RowDefinitions="Auto, *"
|
||||
RowSpacing="20"
|
||||
Margin="0,10,0,0">
|
||||
<Label Text="Les Races"
|
||||
FontSize="Large"/>
|
||||
<ListView ItemsSource="{Binding ListeRaces}"
|
||||
Grid.Row="1"
|
||||
ItemTapped="OnClick">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid Margin="0,10,0,10">
|
||||
<Border>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="3*"
|
||||
ColumnSpacing="15">
|
||||
<!-- To display the image -->
|
||||
<Frame Grid.RowSpan="3">
|
||||
<Image Source="{Binding Image}"/>
|
||||
</Frame>
|
||||
<VerticalStackLayout Grid.Column="1">
|
||||
<!-- To display the breed name -->
|
||||
<Label Text="{Binding Nom}"
|
||||
FontSize="Large"/>
|
||||
<!-- To display the breed scientific name -->
|
||||
<Label Text="{Binding NomScientifique}"
|
||||
FontSize="12"
|
||||
FontFamily="Raleway"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,39 @@
|
||||
/*!
|
||||
* \file DetailEspece.xmal.cs
|
||||
* \author Léana Besson
|
||||
*/
|
||||
using Model;
|
||||
|
||||
/*!
|
||||
* \namespece Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class DetailEspece
|
||||
* \brief Regroups functions for DetailEspece page operation
|
||||
*/
|
||||
public partial class DetailEspece : ContentPage
|
||||
{
|
||||
/*!
|
||||
* \fn DetailEspece()
|
||||
* \brief DetailEspece page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public DetailEspece()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = (App.Current as App).EspeceSelectionner;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn OnClick(object sender, ItemTappedEventArgs e)
|
||||
* \brief Saves the breed selected by the user and opens a new DetailRace page
|
||||
* \param sender object - Event emitter information, namely the DetailEspece.xaml page
|
||||
* \param e ItemTappedEventArgs - Information on selected breed
|
||||
*/
|
||||
public async void OnClick(object sender, ItemTappedEventArgs e)
|
||||
{
|
||||
(App.Current as App).RaceSelectionner = e.Item as Race;
|
||||
await Navigation.PushAsync(new DetailRace());
|
||||
}
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<!-- To diplay breed name -->
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Views.DetailRace"
|
||||
Title="{Binding Nom}"
|
||||
IconImageSource="{FontImage FontFamily=Raleway}">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<!-- To diplay breed image -->
|
||||
<Image Source="{Binding Image}"
|
||||
MaximumWidthRequest="300"
|
||||
Margin="20"
|
||||
HorizontalOptions="Center"/>
|
||||
<Border VerticalOptions="Start"
|
||||
Grid.Column="1"
|
||||
Margin="0,10,0,10">
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *"
|
||||
RowSpacing="8">
|
||||
<!-- To diplay breed scientific name -->
|
||||
<Label Text="Nom scientifique"/>
|
||||
<Label Grid.Column="1"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding NomScientifique}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
|
||||
<!-- To diplay breed life expectancy -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Espérance de vie"/>
|
||||
<Label Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding EsperanceVie}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
|
||||
<!-- To diplay breed average weight -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Poids moyen"/>
|
||||
<Label Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding PoidsMoyen}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
|
||||
<!-- To diplay breed average height -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Taille moyenne"/>
|
||||
<Label Grid.Column="2"
|
||||
Grid.Row="3"
|
||||
HorizontalOptions="End"
|
||||
Text="{Binding TailleMoyenne}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- To diplay information on the breed behavior -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Comportement"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Comportement}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the breed health -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Santé"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Sante}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the breed education -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Education"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Education}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the breed maintenance -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Entretien"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Entretien}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay information on the breed cost -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Coût potentiel"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Cout}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- To diplay breed advice -->
|
||||
<VerticalStackLayout Margin="0,10,0,10">
|
||||
<Label Text="Conseils"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Label Text="{Binding Conseil}"
|
||||
FontAttributes="None"
|
||||
FontFamily="Raleway"/>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,23 @@
|
||||
/*!
|
||||
* \file DetailRace.xmal.cs
|
||||
* \author Léana Besson
|
||||
* \namespace Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class DetailRace
|
||||
* \brief Regroups functions for DetailRace page operation
|
||||
*/
|
||||
public partial class DetailRace : ContentPage
|
||||
{
|
||||
/*!
|
||||
* \fn DetailRace()
|
||||
* \brief DetailRace page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public DetailRace()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = (App.Current as App).RaceSelectionner;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?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="Views.Especes"
|
||||
Title="Wikipet's">
|
||||
<ScrollView>
|
||||
<Grid RowDefinitions="Auto, *"
|
||||
RowSpacing="20">
|
||||
<!-- To display the list of species -->
|
||||
<ListView ItemsSource="{Binding ListeEspeces}"
|
||||
Grid.Row="1"
|
||||
ItemTapped="OnClick">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid Margin="0,10,0,10">
|
||||
<Border>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="3*"
|
||||
ColumnSpacing="15">
|
||||
<!-- To display the image -->
|
||||
<Frame Grid.RowSpan="3">
|
||||
<Image Source="{Binding Image}"/>
|
||||
</Frame>
|
||||
<VerticalStackLayout Grid.Column="1">
|
||||
<!-- To display the species' name -->
|
||||
<Label Text="{Binding Nom}"
|
||||
FontSize="Large"/>
|
||||
<!-- To display the species' scientific name -->
|
||||
<Label Text="{Binding NomScientifique}"
|
||||
FontSize="12"
|
||||
FontFamily="Raleway"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,39 @@
|
||||
/*!
|
||||
* \file Especes.xmal.cs
|
||||
* \author Léana Besson
|
||||
*/
|
||||
using Model;
|
||||
|
||||
/*!
|
||||
* \namespace Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class Especes
|
||||
* \brief Regroups functions for Especes page operation
|
||||
*/
|
||||
public partial class Especes : ContentPage
|
||||
{
|
||||
/*!
|
||||
* \fn DetailRace()
|
||||
* \brief Especes page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public Especes()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = (App.Current as App).Theque;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn OnClick(object sender, ItemTappedEventArgs e)
|
||||
* \brief Saves the species selected by the user and opens a new DetailEspece page
|
||||
* \param sender object - Event emitter information, namely the Especes.xaml page
|
||||
* \param e ItemTappedEventArgs - Information on selected species
|
||||
*/
|
||||
public void OnClick(object sender, ItemTappedEventArgs e)
|
||||
{
|
||||
(App.Current as App).EspeceSelectionner = e.Item as Espece;
|
||||
Navigation.PushAsync(new DetailEspece());
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
x:Class="Views.MainPage"
|
||||
Title="Wikipet's"
|
||||
IconImageSource="{FontImage FontFamily=Raleway}">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<!-- To display the home image -->
|
||||
<Image Source="accueil.png"
|
||||
MaximumWidthRequest="200"/>
|
||||
|
||||
<!-- To display the welcome message -->
|
||||
<Label HorizontalOptions="Center"
|
||||
FontSize="Large"
|
||||
Text="Bienvenue sur Wikipet's"/>
|
||||
|
||||
<!-- To display a description of the application -->
|
||||
<Label MaximumWidthRequest="350"
|
||||
HorizontalOptions="Center"
|
||||
HorizontalTextAlignment="Center"
|
||||
FontFamily="Raleway"
|
||||
FontAttributes="None"
|
||||
Text="Notre application va vous permettre de découvrir l'animal de compagnie qui convient le mieux à vous et votre quotidien. Une fois l'animal adopté, vous pourrez sauvegardé tous les informations dont vous avez besoin."/>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:controls="clr-namespace:Views"
|
||||
x:Class="Views.New_DetailAnimal"
|
||||
x:Name="page_creation">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<HorizontalStackLayout VerticalOptions="Start"
|
||||
HorizontalOptions="End">
|
||||
<!-- To validate the addition of the pet -->
|
||||
<Button Text="Valider"
|
||||
Clicked="Validate_OnClick"/>
|
||||
|
||||
<!-- To delete the pet -->
|
||||
<Button Text="Supprimer"
|
||||
Clicked="Button_OnClick"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<controls:View_DetailAnimal/>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* \file New_DetailAnimal.xmal.cs
|
||||
* \author Léana Besson
|
||||
*/
|
||||
using Model;
|
||||
using Persistance;
|
||||
|
||||
/*!
|
||||
* \namespace Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class New_DetailAnimal
|
||||
* \brief Regroups functions for New_DetailAnimal page operation
|
||||
*/
|
||||
public partial class New_DetailAnimal : ContentPage
|
||||
{
|
||||
private Animal AnimalSelectione => (App.Current as App).AnimalSelectionner;
|
||||
|
||||
/*!
|
||||
* \fn MainPage()
|
||||
* \brief New_DetailAnimal page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public New_DetailAnimal()
|
||||
{
|
||||
InitializeComponent();
|
||||
(App.Current as App).PageDeSaisie = this;
|
||||
InitBinding();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn InitBinding()
|
||||
* \brief Initializes binding context
|
||||
*/
|
||||
public void InitBinding()
|
||||
{
|
||||
BindingContext = AnimalSelectione;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn Button_OnClick(object sender, EventArgs e)
|
||||
* \brief Remove an pet to the theque and opens the pet's data entry page
|
||||
* \param sender object - Event emitter information, namely the New_DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
public async void Button_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current as App).Theque.SupprimerAnimal((App.Current as App).AnimalSelectionner);
|
||||
DataSerializerBinary.Serializer((App.Current as App).SerializationPath, (App.Current as App).Theque);
|
||||
await Shell.Current.GoToAsync("//Animaux");
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn Button_OnClick(object sender, EventArgs e)
|
||||
* \brief If the animal name is valid, the function serializes the theque and goes to the Animal page
|
||||
* \param sender object - Event emitter information, namely the New_DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
public async void Validate_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
if ((App.Current as App).AnimalSelectionner.NomIsValid == true)
|
||||
{
|
||||
DataSerializerBinary.Serializer((App.Current as App).SerializationPath, (App.Current as App).Theque);
|
||||
await Shell.Current.GoToAsync("//Animaux");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#512BD4</color>
|
||||
<color name="colorPrimaryDark">#2B0B98</color>
|
||||
<color name="colorAccent">#2B0B98</color>
|
||||
</resources>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>This app needs access to the photo gallery for picking photos and videos.</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>This app needs access to photos gallery for picking photos and videos.</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
using Microsoft.Maui;
|
||||
using Microsoft.Maui.Hosting;
|
||||
using System;
|
||||
|
||||
namespace Views
|
||||
{
|
||||
internal class Program : MauiApplication
|
||||
{
|
||||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var app = new Program();
|
||||
app.Run(args);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<maui:MauiWinUIApplication
|
||||
x:Class="Views.WinUI.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:maui="using:Microsoft.Maui"
|
||||
xmlns:local="using:Views.WinUI">
|
||||
|
||||
</maui:MauiWinUIApplication>
|
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
IgnorableNamespaces="uap rescap">
|
||||
|
||||
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="3B45322D-321D-4222-BA65-C4107D8E4118" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>$placeholder$</DisplayName>
|
||||
<PublisherDisplayName>User Name</PublisherDisplayName>
|
||||
<Logo>$placeholder$.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="$placeholder$"
|
||||
Description="$placeholder$"
|
||||
Square150x150Logo="$placeholder$.png"
|
||||
Square44x44Logo="$placeholder$.png"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
|
||||
<uap:SplashScreen Image="$placeholder$.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
|
||||
</Package>
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="Views.WinUI.app"/>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<!-- The combination of below two tags have the following effect:
|
||||
1) Per-Monitor for >= Windows 10 Anniversary Update
|
||||
2) System < Windows 10 Anniversary Update
|
||||
-->
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>This app needs access to the photo gallery for picking photos and videos.</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>This app needs access to photos gallery for picking photos and videos.</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Windows Machine": {
|
||||
"commandName": "MsixPackage",
|
||||
"nativeDebugging": false
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 231 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 580 KiB |
After Width: | Height: | Size: 212 KiB |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,15 @@
|
||||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories). Deployment of the asset to your application
|
||||
is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
|
||||
|
||||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||
|
||||
These files will be deployed with you package and will be accessible using Essentials:
|
||||
|
||||
async Task LoadMauiAsset()
|
||||
{
|
||||
using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
|
||||
using var reader = new StreamReader(stream);
|
||||
|
||||
var contents = reader.ReadToEnd();
|
||||
}
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xaml-comp compile="true" ?>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
|
||||
|
||||
<Color x:Key="Primary">#ff9d5e</Color>
|
||||
<Color x:Key="Secondary">#402e32</Color>
|
||||
<Color x:Key="Error">#FF5349</Color>
|
||||
<Color x:Key="Tertiary">#2B0B98</Color>
|
||||
<Color x:Key="White">#faf5f0</Color>
|
||||
<Color x:Key="Black">Black</Color>
|
||||
<Color x:Key="Gray100">#E1E1E1</Color>
|
||||
<Color x:Key="Gray200">#C8C8C8</Color>
|
||||
<Color x:Key="Gray300">#ACACAC</Color>
|
||||
<Color x:Key="Gray400">#919191</Color>
|
||||
<Color x:Key="Gray500">#6E6E6E</Color>
|
||||
<Color x:Key="Gray600">#404040</Color>
|
||||
<Color x:Key="Gray900">#212121</Color>
|
||||
<Color x:Key="Gray950">#141414</Color>
|
||||
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/>
|
||||
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/>
|
||||
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/>
|
||||
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/>
|
||||
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/>
|
||||
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}"/>
|
||||
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}"/>
|
||||
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}"/>
|
||||
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}"/>
|
||||
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}"/>
|
||||
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}"/>
|
||||
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}"/>
|
||||
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}"/>
|
||||
|
||||
<Color x:Key="Yellow100Accent">#F7B548</Color>
|
||||
<Color x:Key="Yellow200Accent">#FFD590</Color>
|
||||
<Color x:Key="Yellow300Accent">#FFE5B9</Color>
|
||||
<Color x:Key="Cyan100Accent">#28C2D1</Color>
|
||||
<Color x:Key="Cyan200Accent">#7BDDEF</Color>
|
||||
<Color x:Key="Cyan300Accent">#C3F2F4</Color>
|
||||
<Color x:Key="Blue100Accent">#3E8EED</Color>
|
||||
<Color x:Key="Blue200Accent">#72ACF1</Color>
|
||||
<Color x:Key="Blue300Accent">#A7CBF6</Color>
|
||||
|
||||
</ResourceDictionary>
|
@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xaml-comp compile="true" ?>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
|
||||
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Stroke" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}" />
|
||||
<Setter Property="StrokeShape" Value="Rectangle"/>
|
||||
<Setter Property="StrokeThickness" Value="2"/>
|
||||
<Setter Property="Background" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Primary}}"/>
|
||||
<Setter Property="Padding" Value="15"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Primary}}" />
|
||||
<Setter Property="FontFamily" Value="Raleway"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="CornerRadius" Value="8"/>
|
||||
<Setter Property="Padding" Value="10"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="40"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="40"/>
|
||||
<Setter Property="Margin" Value="0,10,0,10"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="DatePicker">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="Raleway"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="40"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="40"/>
|
||||
<Setter Property="MinimumDate" Value="01/01/2000"/>
|
||||
<Setter Property="HorizontalOptions" Value="End"/>
|
||||
<Setter Property="Grid.Column" Value="1"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Entry">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="Raleway"/>
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="MinimumHeightRequest" Value="40"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="40"/>
|
||||
<Setter Property="HorizontalOptions" Value="End"/>
|
||||
<Setter Property="Grid.Column" Value="1"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Frame">
|
||||
<Setter Property="HasShadow" Value="False" />
|
||||
<Setter Property="BorderColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Primary}}" />
|
||||
<Setter Property="CornerRadius" Value="8" />
|
||||
<Setter Property="HeightRequest" Value="60"/>
|
||||
<Setter Property="WidthRequest" Value="60"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="DMSerifDisplay" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="FontAttributes" Value="Bold"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource White}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Picker">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="Raleway"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="40"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="40"/>
|
||||
<Setter Property="HorizontalOptions" Value="End"/>
|
||||
<Setter Property="Grid.Column" Value="1"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Page" ApplyToDerivedTypes="True">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Secondary}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ScrollView">
|
||||
<Setter Property="Margin" Value="40"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Shell" ApplyToDerivedTypes="True">
|
||||
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Primary}}" />
|
||||
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Secondary}}" />
|
||||
<Setter Property="Shell.TabBarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Secondary}}" />
|
||||
<Setter Property="Shell.TabBarForegroundColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,338 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Views.View_DetailAnimal">
|
||||
<VerticalStackLayout>
|
||||
<!-- Pet image -->
|
||||
<Image Source="{Binding Image}"
|
||||
MaximumWidthRequest="300"
|
||||
HorizontalOptions="Center"/>
|
||||
|
||||
<!-- To add or change the image -->
|
||||
<Button Text="Ajouter photo"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="End"
|
||||
Clicked="TakePhoto"/>
|
||||
|
||||
<!-- Display and change pet name -->
|
||||
<HorizontalStackLayout HorizontalOptions="Center">
|
||||
<Label Text="Nom"
|
||||
VerticalOptions="Center"/>
|
||||
<Entry Text="{Binding Nom}"
|
||||
Margin="20,0,0,0">
|
||||
|
||||
<!-- To change the background if there is a name -->
|
||||
<Entry.Triggers>
|
||||
<DataTrigger TargetType="Entry"
|
||||
Binding="{Binding NomIsValid}"
|
||||
Value="false">
|
||||
<Setter Property="BackgroundColor" Value="{StaticResource Error}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger TargetType="Entry"
|
||||
Binding="{Binding NomIsValid}"
|
||||
Value="true">
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
</DataTrigger>
|
||||
</Entry.Triggers>
|
||||
</Entry>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
|
||||
<Border VerticalOptions="Start"
|
||||
Grid.Column="1"
|
||||
Margin="0, 10, 0, 10">
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *"
|
||||
RowSpacing="8">
|
||||
<!-- Display and change date of birth -->
|
||||
<Label Text="Date de naissance"/>
|
||||
<DatePicker Date="{Binding DateNaissance}"/>
|
||||
|
||||
<!-- Display and change gender -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Sexe"/>
|
||||
<Picker Grid.Row="1"
|
||||
SelectedItem="{Binding Sexe}"
|
||||
SelectedIndexChanged="SexeClick">
|
||||
<Picker.Items>
|
||||
<x:String>Femelle</x:String>
|
||||
<x:String>Male</x:String>
|
||||
</Picker.Items>
|
||||
</Picker>
|
||||
|
||||
<!-- Display and change date of adoption -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Date d'adoption"/>
|
||||
<DatePicker Grid.Row="2"
|
||||
Date="{Binding DateAdoption}"/>
|
||||
|
||||
<!-- Display and change size -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Taille"/>
|
||||
<HorizontalStackLayout Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
HorizontalOptions="End">
|
||||
<Entry Text="{Binding Taille}"/>
|
||||
<Label Text=" cm"
|
||||
VerticalOptions="Center"
|
||||
FontFamily="Raleway"
|
||||
FontAttributes="None"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<!-- Display and change weight -->
|
||||
<Label Grid.Row="4"
|
||||
Text="Poids"/>
|
||||
<HorizontalStackLayout Grid.Column="2"
|
||||
Grid.Row="4"
|
||||
HorizontalOptions="End">
|
||||
<Entry Text="{Binding Poids}"/>
|
||||
<Label Text=" kg"
|
||||
VerticalOptions="Center"
|
||||
FontFamily="Raleway"
|
||||
FontAttributes="None"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<!-- Display and change power supply -->
|
||||
<Label Grid.Row="5"
|
||||
Text="Alimentation"/>
|
||||
<Entry Grid.Row="5"
|
||||
Text="{Binding Alimentation}"/>
|
||||
|
||||
<!-- Display and change species -->
|
||||
<Label Grid.Row="6"
|
||||
Text="Espèce"/>
|
||||
<Grid Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
ColumnDefinitions="*"
|
||||
RowDefinitions="Auto, Auto">
|
||||
<Label Text="{Binding Espece}"
|
||||
VerticalOptions="Start"
|
||||
HorizontalOptions="End"
|
||||
FontFamily="Raleway"
|
||||
FontAttributes="None"/>
|
||||
<Picker x:Name="Picker_especes"
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding ListeEspeces}"
|
||||
ItemDisplayBinding="{Binding Nom}"
|
||||
SelectedIndexChanged="EspeceClic">
|
||||
</Picker>
|
||||
</Grid>
|
||||
|
||||
<!-- Display and change breed -->
|
||||
<Label Grid.Row="7"
|
||||
Text="Race"/>
|
||||
<Grid Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
ColumnDefinitions="*"
|
||||
RowDefinitions="Auto, Auto">
|
||||
<Label Text="{Binding Race}"
|
||||
VerticalOptions="Start"
|
||||
HorizontalOptions="End"
|
||||
FontFamily="Raleway"
|
||||
FontAttributes="None"/>
|
||||
<Picker Grid.Row="1"
|
||||
ItemsSource="{Binding Espece.ListeRaces}"
|
||||
ItemDisplayBinding="{Binding Nom}"
|
||||
SelectedIndexChanged="RaceClic">
|
||||
</Picker>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
<!-- Display and change petsitter -->
|
||||
<VerticalStackLayout Margin="0, 10, 0, 10">
|
||||
<Label Text="Petsitter"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *">
|
||||
<!-- Display and change petsitter's name -->
|
||||
<Label Text="Nom"/>
|
||||
<Entry Text="{Binding Petsitter.Nom}"/>
|
||||
|
||||
<!-- Display and change petsitter's address -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Adresse"/>
|
||||
<Entry Grid.Row="1"
|
||||
Text="{Binding Petsitter.Adresse}"/>
|
||||
|
||||
<!-- Display and change petsitter's zip code -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Code postal"/>
|
||||
<Entry Grid.Row="2"
|
||||
Text="{Binding Petsitter.CodePostal}"/>
|
||||
|
||||
<!-- Display and change petsitter's city -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Ville"/>
|
||||
<Entry Grid.Row="3"
|
||||
Text="{Binding Petsitter.Ville}"/>
|
||||
|
||||
<!-- Display and change petsitter's phone number -->
|
||||
<Label Grid.Row="4"
|
||||
Text="Numéro de téléphone"/>
|
||||
<Entry Grid.Row="4"
|
||||
Text="{Binding Petsitter.NumTel}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Display and change kennel -->
|
||||
<VerticalStackLayout Margin="0, 10, 0, 10">
|
||||
<Label Text="Chenil"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *">
|
||||
<!-- Display and change kennel's name -->
|
||||
<Label Text="Nom"/>
|
||||
<Entry Text="{Binding Chenil.Nom}"/>
|
||||
|
||||
<!-- Display and change kennel's address -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Adresse"/>
|
||||
<Entry Grid.Row="1"
|
||||
Text="{Binding Chenil.Adresse}"/>
|
||||
|
||||
<!-- Display and change kennel's zip code -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Code postal"/>
|
||||
<Entry Grid.Row="2"
|
||||
Text="{Binding Chenil.CodePostal}"/>
|
||||
|
||||
<!-- Display and change kennel's city -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Ville"/>
|
||||
<Entry Grid.Row="3"
|
||||
Text="{Binding Chenil.Ville}"/>
|
||||
|
||||
<!-- Display and change kennel's phone number -->
|
||||
<Label Grid.Row="4"
|
||||
Text="Numéro de téléphone"/>
|
||||
<Entry Grid.Row="4"
|
||||
Text="{Binding Chenil.NumTel}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Display and change veterinarian -->
|
||||
<VerticalStackLayout Margin="0, 10, 0, 10">
|
||||
<Label Text="Vétérinaire"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *">
|
||||
<!-- Display and change vet's name -->
|
||||
<Label Text="Nom"/>
|
||||
<Entry Text="{Binding Veterinaire.Nom}"/>
|
||||
|
||||
<!-- Display and change vet's clinic -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Clinique"/>
|
||||
<Entry Grid.Row="1"
|
||||
Text="{Binding Veterinaire.Clinique}"/>
|
||||
|
||||
<!-- Display and change vet's address -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Adresse"/>
|
||||
<Entry Grid.Row="2"
|
||||
Text="{Binding Veterinaire.Adresse}"/>
|
||||
|
||||
<!-- Display and change vet's zip code -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Code postal"/>
|
||||
<Entry Grid.Row="3"
|
||||
Text="{Binding Veterinaire.CodePostal}"/>
|
||||
|
||||
<!-- Display and change vet's city -->
|
||||
<Label Grid.Row="4"
|
||||
Text="Ville"/>
|
||||
<Entry Grid.Row="4"
|
||||
Text="{Binding Veterinaire.Ville}"/>
|
||||
|
||||
<!-- Display and change vet's phone number -->
|
||||
<Label Grid.Row="5"
|
||||
Text="Numéro de téléphone"/>
|
||||
<Entry Grid.Row="5"
|
||||
Text="{Binding Veterinaire.NumTel}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Display and change food store -->
|
||||
<VerticalStackLayout Margin="0, 10, 0, 10">
|
||||
<Label Text="Magasin alimentaire"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *">
|
||||
<!-- Display and change food store name -->
|
||||
<Label Text="Nom"/>
|
||||
<Entry Text="{Binding MagasinAlimentaire.Nom}"/>
|
||||
|
||||
<!-- Display and change food store address -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Adresse"/>
|
||||
<Entry Text="{Binding MagasinAlimentaire.Adresse}"/>
|
||||
|
||||
<!-- Display and change food store zip code -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Code postal"/>
|
||||
<Entry Grid.Row="2"
|
||||
Text="{Binding MagasinAlimentaire.CodePostal}"/>
|
||||
|
||||
<!-- Display and change food store city -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Ville"/>
|
||||
<Entry Grid.Row="3"
|
||||
Text="{Binding MagasinAlimentaire.Ville}"/>
|
||||
|
||||
<!-- Display and change food store phone number -->
|
||||
<Label Grid.Row="4"
|
||||
Text="Numéro de téléphone"/>
|
||||
<Entry Grid.Row="4"
|
||||
Text="{Binding MagasinAlimentaire.NumTel}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Display and change provenance -->
|
||||
<VerticalStackLayout Margin="0, 10, 0, 10">
|
||||
<Label Text="Refuge, élevage, chenil de provenance"
|
||||
FontSize="Large"/>
|
||||
<Border>
|
||||
<Grid RowDefinitions="Auto, Auto, Auto, Auto, Auto"
|
||||
ColumnDefinitions="*, *">
|
||||
<!-- Display and change provenance's name -->
|
||||
<Label Text="Nom"/>
|
||||
<Entry Text="{Binding Provenance.Nom}"/>
|
||||
|
||||
<!-- Display and change provenance's address -->
|
||||
<Label Grid.Row="1"
|
||||
Text="Adresse"/>
|
||||
<Entry Grid.Row="1"
|
||||
Text="{Binding Provenance.Adresse}"/>
|
||||
|
||||
<!-- Display and change provenance's zip code -->
|
||||
<Label Grid.Row="2"
|
||||
Text="Code postal"/>
|
||||
<Entry Grid.Row="2"
|
||||
Text="{Binding Provenance.CodePostal}"/>
|
||||
|
||||
<!-- Display and change provenance's city -->
|
||||
<Label Grid.Row="3"
|
||||
Text="Ville"/>
|
||||
<Entry Grid.Row="3"
|
||||
Text="{Binding Provenance.Ville}"/>
|
||||
|
||||
<!-- Display and change provenance's phone number -->
|
||||
<Label Grid.Row="4"
|
||||
Text="Numéro de téléphone"/>
|
||||
<Entry Grid.Row="4"
|
||||
Text="{Binding Provenance.NumTel}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
</ContentView>
|
@ -0,0 +1,88 @@
|
||||
/*!
|
||||
* \file View_DetailAnimal.xmal.cs
|
||||
* \author Léana Besson
|
||||
*/
|
||||
using Model;
|
||||
|
||||
/*!
|
||||
* \namespace Views
|
||||
*/
|
||||
namespace Views;
|
||||
|
||||
/*!
|
||||
* \class View-DetailAnimal
|
||||
* \brief Regroups functions for View_DetailAnimal page operation
|
||||
*/
|
||||
public partial class View_DetailAnimal : ContentView
|
||||
{
|
||||
/*!
|
||||
* \fn View_DetailAnimal()
|
||||
* \brief View_DetailAnimal page constructor with component initialization and context binding assignment
|
||||
*/
|
||||
public View_DetailAnimal()
|
||||
{
|
||||
InitializeComponent();
|
||||
Picker_especes.BindingContext = (App.Current as App).Theque;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn EspeceClic(object sender, EventArgs e)
|
||||
* \brief Changes the species of the selected pet and makes the race null
|
||||
* \param sender object - Event emitter information, namely the View_DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
private void EspeceClic(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current as App).AnimalSelectionner.Espece = (sender as Picker).SelectedItem as Espece;
|
||||
(App.Current as App).AnimalSelectionner.Race = null;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn RaceClic(object sender, EventArgs e)
|
||||
* \brief Modifies the breed of the selected pet
|
||||
* \param sender object - Event emitter information, namely the View_DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
private void RaceClic(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current as App).AnimalSelectionner.Race = (sender as Picker).SelectedItem as Race;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn SexeClick(object sender, EventArgs e)
|
||||
* \brief Modifies the gender of the selected pet
|
||||
* \param sender object - Event emitter information, namely the View_DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
private void SexeClick(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current as App).AnimalSelectionner.Sexe = (sender as Picker).SelectedItem as string;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn TakePhoto(object sender, EventArgs e)
|
||||
* \brief Opens photo picker, loads photo into AppDataDirectory file and changes image of selected pet
|
||||
* \param sender object - Event emitter information, namely the View_DetailAnimal.xaml page
|
||||
* \param e EventArgs - Information related to the clicked button event
|
||||
*/
|
||||
public async void TakePhoto(object sender, EventArgs e)
|
||||
{
|
||||
if (MediaPicker.Default.IsCaptureSupported)
|
||||
{
|
||||
FileResult photo = await MediaPicker.Default.PickPhotoAsync();
|
||||
|
||||
if (photo != null)
|
||||
{
|
||||
string localFilePath = Path.Combine(FileSystem.AppDataDirectory, photo.FileName);
|
||||
|
||||
using Stream sourceStream = await photo.OpenReadAsync();
|
||||
using FileStream localFileStream = File.OpenWrite(localFilePath);
|
||||
|
||||
await sourceStream.CopyToAsync(localFileStream);
|
||||
|
||||
(App.Current as App).AnimalSelectionner.Image = Path.Combine(FileSystem.AppDataDirectory, photo.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|