fixed merge
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
commit
907eb84ba0
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@ -1,205 +1,184 @@
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// A user is an entity with a _name, a surname, mail, profilePict and a list of priority.
|
||||
/// This user can login with an Id and a password
|
||||
/// </summary>
|
||||
[DataContract(Name = "user")]
|
||||
public class User : IEquatable<User> , INotifyPropertyChanged
|
||||
{
|
||||
#region Private Attributes
|
||||
|
||||
[DataMember] private string name="";
|
||||
[DataMember] private string surname="";
|
||||
[DataMember] private string mail = "";
|
||||
[DataMember] private string picture = "";
|
||||
[DataMember] private string password = "";
|
||||
[DataMember] private List<Priority> priorities;
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Property to get Name of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Name is null</exception>
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
set
|
||||
{
|
||||
|
||||
name = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property to get Surname of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Surname is null</exception>
|
||||
public string Surname
|
||||
{
|
||||
get { return surname; }
|
||||
set
|
||||
{
|
||||
|
||||
surname = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property to get mail of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >User's mail will serve to log the user. So there's no setter, just an init. User will enter one time his email at his
|
||||
/// account creation.</exception>
|
||||
public string Mail
|
||||
{
|
||||
get { return mail; }
|
||||
private init
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
throw new ArgumentException("Impossible d'avoir un champ Email vide!");
|
||||
}
|
||||
mail = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get => password;
|
||||
set => password = value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For now, we define the ProfilPict as a string which is "PhotoParDefaut"
|
||||
/// when the value is null.
|
||||
/// </summary>
|
||||
public string ProfilPict
|
||||
{
|
||||
get => picture;
|
||||
set => picture = value;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is the list of priorities specific tu the user. This list is initiate
|
||||
/// by default. User could change it at will.
|
||||
/// </summary>
|
||||
|
||||
public List<Priority> Priorities
|
||||
{
|
||||
get => priorities;
|
||||
set=> priorities = value;
|
||||
}
|
||||
|
||||
public override bool Equals(object? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
if (other == this) return true;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
public bool Equals(User? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
return Name.Equals(other.Name) && Surname.Equals(other.Surname) && Mail.Equals(other.Mail);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
protected void OnPropertyChanged ([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Name} {Surname}";
|
||||
}
|
||||
|
||||
[DataMember(Name = "passmgr")]
|
||||
public IPasswordManager psswMgr { get; private set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Construtors of user.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the user</param>
|
||||
/// <param name="surname">The surname of the user</param>
|
||||
/// <param name="mail">The user needs an email to login.</param>
|
||||
/// <param name="password">The password of the new user.</param>
|
||||
/// <param name="passwordManager">The password manager to manage the user password.</param>
|
||||
public User(string name, string surname, string mail, string password, IPasswordManager passwordManager)
|
||||
{
|
||||
Name = name;
|
||||
Surname = surname;
|
||||
Mail = mail;
|
||||
psswMgr = passwordManager;
|
||||
Password = psswMgr.HashPassword(password);
|
||||
priorities = new List<Priority> {
|
||||
Priority.Gourmet,
|
||||
Priority.Economic,
|
||||
Priority.Fast,
|
||||
Priority.Light,
|
||||
Priority.Easy};
|
||||
ProfilPict = picture;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// </summary>
|
||||
public User(string name, string surname, string mail, string password)
|
||||
: this(name, surname,mail, password, new PasswordSHA256())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// </summary>
|
||||
public User()
|
||||
: this("John", "Doe", "truc@gmail.com", "mdp")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// </summary>
|
||||
public User (User user)
|
||||
{
|
||||
Name = user.Name;
|
||||
Surname = user.Surname;
|
||||
Mail = user.Mail;
|
||||
psswMgr = user.psswMgr;
|
||||
Password = user.Password;
|
||||
priorities = user.Priorities;
|
||||
ProfilPict = user.ProfilPict;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// A user is an entity with a name, a surname, mail, profilePict and a list of priority.
|
||||
/// This user can login with an Id and a password
|
||||
/// </summary>
|
||||
[DataContract(Name = "user")]
|
||||
public class User : IEquatable<User> , INotifyPropertyChanged
|
||||
{
|
||||
#region Private Attributes
|
||||
[DataMember] private string _name = "";
|
||||
[DataMember] private string _surname = "";
|
||||
[DataMember] private string _mail = "";
|
||||
|
||||
[DataMember(Name = "priorities")]
|
||||
public ObservableCollection<Priority> _priorities { get; private set; } = new ObservableCollection<Priority>
|
||||
{
|
||||
Priority.Gourmet,
|
||||
Priority.Economic,
|
||||
Priority.Fast,
|
||||
Priority.Light,
|
||||
Priority.Easy
|
||||
};
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Property to get Name of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Name is null</exception>
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set
|
||||
{
|
||||
|
||||
_name = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property to get Surname of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Surname is null</exception>
|
||||
public string Surname
|
||||
{
|
||||
get { return _surname; }
|
||||
set
|
||||
{
|
||||
|
||||
_surname = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property to get mail of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >User's mail will serve to log the user. So there's no setter, just an init. User will enter one time his email at his
|
||||
/// account creation.</exception>
|
||||
public string Mail
|
||||
{
|
||||
get { return _mail; }
|
||||
private init
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
throw new ArgumentException("Impossible d'avoir un champ Email vide!");
|
||||
}
|
||||
_mail = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The user's hashed password. The hashed method is defined with the PasswordManager.
|
||||
/// <br/>See: <see cref="IPasswordManager"/>.
|
||||
/// </summary>
|
||||
[DataMember(Name = "hashedpass")]
|
||||
public string Password { get; private set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// For now, we define the ProfilePict as a string which is "PhotoParDefaut"
|
||||
/// when the value is null.
|
||||
/// </summary>
|
||||
[DataMember(Name = "profilepic")]
|
||||
public string ProfilePict { get; private set; } = "default_picture.png";
|
||||
|
||||
/// <summary>
|
||||
/// This is the list of priorities specific tu the user. This list is initiate
|
||||
/// by default. User could change it at will.
|
||||
/// </summary>
|
||||
public ReadOnlyObservableCollection<Priority> Priorities { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public override bool Equals(object? other)
|
||||
{
|
||||
if (ReferenceEquals(other, null)) return false;
|
||||
if (ReferenceEquals(other, this)) return true;
|
||||
if (GetType() != other.GetType()) return false;
|
||||
|
||||
return Equals(other as User);
|
||||
}
|
||||
|
||||
public bool Equals(User? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
if (other == this) return true;
|
||||
|
||||
return Name.Equals(other.Name) && Surname.Equals(other.Surname) && Mail.Equals(other.Mail);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Name} {Surname}";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Construtors of user.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the user</param>
|
||||
/// <param name="surname">The surname of the user</param>
|
||||
/// <param name="mail">The user needs an email to login.</param>
|
||||
/// <param name="hashedPassword">The password of the new user.</param>
|
||||
public User(string name, string surname, string mail, string hashedPassword)
|
||||
{
|
||||
Name = name;
|
||||
Surname = surname;
|
||||
Mail = mail;
|
||||
Password = hashedPassword;
|
||||
Priorities = new ReadOnlyObservableCollection<Priority>(_priorities);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// <param name="profilePict">Profile picture of the new user.</param>
|
||||
public User(string name, string surname, string mail, string hashedPassword, string profilePict)
|
||||
: this(name, surname, mail, hashedPassword)
|
||||
{
|
||||
ProfilePict = profilePict;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
public User()
|
||||
: this("John", "Doe", "truc@gmail.com", "mdp")
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// <param name="user">The user to copy.</param>
|
||||
public User(User user)
|
||||
{
|
||||
Name = user.Name;
|
||||
Surname = user.Surname;
|
||||
Mail = user.Mail;
|
||||
Password = user.Password;
|
||||
_priorities = user._priorities;
|
||||
Priorities = new ReadOnlyObservableCollection<Priority>(_priorities);
|
||||
ProfilePict = user.ProfilePict;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Managers\Managers.csproj" />
|
||||
<ProjectReference Include="..\..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,55 +1,77 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33516.290
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{666C2211-8EBB-4FC8-9484-CB93BC854153}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{42FF86BD-92F9-4A32-A938-68515905378F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Views", "Views\Views.csproj", "{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model_UnitTests", "Tests\Model_UnitTests\Model_UnitTests.csproj", "{45AB746A-194B-4E43-81EB-83B06F35AA33}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{08B80CE8-A01D-4D86-8989-AF225D5DA48C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataPersistence", "DataPersistence\DataPersistence.csproj", "{432F9D12-B1F7-4A79-8720-4971BB10B831}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33} = {08B80CE8-A01D-4D86-8989-AF225D5DA48C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {ADEA5603-1EF6-4D43-9493-7D6D9DE7FA3F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33516.290
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{666C2211-8EBB-4FC8-9484-CB93BC854153}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{42FF86BD-92F9-4A32-A938-68515905378F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Views", "Views\Views.csproj", "{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model_UnitTests", "Tests\Model_UnitTests\Model_UnitTests.csproj", "{45AB746A-194B-4E43-81EB-83B06F35AA33}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{08B80CE8-A01D-4D86-8989-AF225D5DA48C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataPersistence", "Persistance\DataPersistence\DataPersistence.csproj", "{432F9D12-B1F7-4A79-8720-4971BB10B831}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Managers", "Managers\Managers.csproj", "{A3703A19-687C-4F63-A5DE-18E6D8995C77}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppException", "AppException\AppException.csproj", "{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakePersistance", "Persistance\FakePersistance\FakePersistance.csproj", "{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Persistance", "Persistance", "{F6413DA3-CE67-4097-8FF7-8D221AF2A5E8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33} = {08B80CE8-A01D-4D86-8989-AF225D5DA48C}
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831} = {F6413DA3-CE67-4097-8FF7-8D221AF2A5E8}
|
||||
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F} = {F6413DA3-CE67-4097-8FF7-8D221AF2A5E8}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {ADEA5603-1EF6-4D43-9493-7D6D9DE7FA3F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -1,89 +1,89 @@
|
||||
<?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"
|
||||
xmlns:model="clr-namespace:Model;assembly=Model"
|
||||
x:Class="Views.Home"
|
||||
x:Name="homepage">
|
||||
|
||||
<local:ContainerBase
|
||||
IsNotConnected="{Binding IsNotConnected, Source={x:Reference homepage}}"
|
||||
NeedReturn="{Binding NeedReturn, Source={x:Reference homepage}}">
|
||||
|
||||
<!-- Flyout -->
|
||||
<local:ContainerBase.MyFlyoutContent>
|
||||
<VerticalStackLayout Grid.Row="1">
|
||||
<!-- Research -->
|
||||
<Label
|
||||
Text="Recherche de recettes :" FontSize="14"
|
||||
Margin="20, 10, 15, 0"/>
|
||||
<SearchBar
|
||||
Placeholder="Mots-clés (ex.: rapide, fromage)"
|
||||
FontAttributes="Italic" TextColor="Black"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray300}}"
|
||||
Margin="15, 10, 15, 40"
|
||||
SearchButtonPressed="SearchBar_SearchButtonPressed"/>
|
||||
|
||||
<!-- Direct research -->
|
||||
<Button
|
||||
Text="Toutes les recettes"
|
||||
ImageSource="home_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="AllRecipes_Clicked"/>
|
||||
<Button
|
||||
Text="Entrées"
|
||||
ImageSource="flatware_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="Entrees_Clicked"/>
|
||||
<Button
|
||||
Text="Plats"
|
||||
ImageSource="room_service_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="Plats_Clicked"/>
|
||||
<Button
|
||||
Text="Desserts"
|
||||
ImageSource="coffee_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="Desserts_Clicked"/>
|
||||
</VerticalStackLayout>
|
||||
</local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<!-- Master -->
|
||||
<local:ContainerBase.MyContent>
|
||||
<ScrollView>
|
||||
<StackLayout BindingContext="{Binding RecipesDisplayed}" MinimumWidthRequest="400">
|
||||
<!--Modification du prof apportée sur le stacklayout pour empecher l'affichage d'une seule case recipe-->
|
||||
<Label
|
||||
Text="{Binding Description}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontSize="24"
|
||||
Padding="15"/>
|
||||
|
||||
<FlexLayout
|
||||
Margin="0, 15"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Center"
|
||||
AlignContent="SpaceEvenly"
|
||||
HorizontalOptions="Center"
|
||||
BindableLayout.ItemsSource="{Binding}">
|
||||
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="model:Recipe">
|
||||
|
||||
<local:RecipeCase
|
||||
CaseImageSource="{Binding Image}"
|
||||
RecipeTitle="{Binding Title}"/>
|
||||
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
|
||||
</FlexLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</local:ContainerBase.MyContent>
|
||||
|
||||
</local:ContainerBase>
|
||||
|
||||
</ContentPage>
|
||||
<?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"
|
||||
xmlns:model="clr-namespace:Model;assembly=Model"
|
||||
x:Class="Views.Home"
|
||||
x:Name="homepage">
|
||||
|
||||
<local:ContainerBase x:Name="container_base"
|
||||
NeedReturn="False">
|
||||
|
||||
<!-- Flyout -->
|
||||
<local:ContainerBase.MyFlyoutContent>
|
||||
<VerticalStackLayout Grid.Row="1">
|
||||
<!-- Research -->
|
||||
<Label
|
||||
Text="Recherche de recettes :" FontSize="14"
|
||||
Margin="20, 10, 15, 0"/>
|
||||
<SearchBar
|
||||
Placeholder="Mots-clés (ex.: rapide, fromage)"
|
||||
TextColor="Black"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray300}}"
|
||||
Margin="15, 10, 15, 40"
|
||||
SearchButtonPressed="SearchBar_SearchButtonPressed"/>
|
||||
|
||||
<!-- Direct research -->
|
||||
<Button
|
||||
Text="Toutes les recettes"
|
||||
ImageSource="home_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="AllRecipes_Clicked"/>
|
||||
<Button
|
||||
Text="Entrées"
|
||||
ImageSource="flatware_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="Entrees_Clicked"/>
|
||||
<Button
|
||||
Text="Plats"
|
||||
ImageSource="room_service_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="Plats_Clicked"/>
|
||||
<Button
|
||||
Text="Desserts"
|
||||
ImageSource="coffee_icon.png"
|
||||
Style="{StaticResource button1}"
|
||||
Clicked="Desserts_Clicked"/>
|
||||
</VerticalStackLayout>
|
||||
</local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<!-- Master -->
|
||||
<local:ContainerBase.MyContent>
|
||||
<ScrollView>
|
||||
<StackLayout BindingContext="{Binding ., Source={x:Reference homepage}}"
|
||||
MinimumWidthRequest="400">
|
||||
<!--Modification du prof apportée sur le stacklayout pour empecher l'affichage d'une seule case recipe-->
|
||||
<Label
|
||||
Text="{Binding RecipesDisplayed.Description}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontSize="24"
|
||||
Padding="15"/>
|
||||
|
||||
<FlexLayout
|
||||
Margin="0, 15"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Center"
|
||||
AlignContent="SpaceEvenly"
|
||||
HorizontalOptions="Center"
|
||||
BindableLayout.ItemsSource="{Binding RecipesDisplayed}">
|
||||
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="model:Recipe">
|
||||
|
||||
<local:RecipeCase
|
||||
CaseImageSource="{Binding Image}"
|
||||
RecipeTitle="{Binding Title}"/>
|
||||
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
|
||||
</FlexLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</local:ContainerBase.MyContent>
|
||||
|
||||
</local:ContainerBase>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,16 @@
|
||||
using Model;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class MyProfil : ContentPage
|
||||
{
|
||||
public MasterManager Master => (Application.Current as App).Master;
|
||||
public User user => Master.User.CurrentConnected;
|
||||
|
||||
public MyProfil()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = this;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
using Model;
|
||||
|
||||
namespace Views;
|
||||
/// <summary>
|
||||
/// Classe de la page contenant le detail de la recette
|
||||
///
|
||||
/// </summary>
|
||||
public partial class ViewRecette : ContentPage
|
||||
{
|
||||
public MasterManager Master => (Application.Current as App).Master;
|
||||
public User user => Master.User.CurrentConnected;
|
||||
public Recipe Recipe => Master.Recipe.CurrentSelected;
|
||||
public RecipeCollection AllRecipes => Master.Recipe.GetAllRecipes();
|
||||
public ViewRecette()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = this;
|
||||
}
|
||||
}
|
@ -1,61 +1,60 @@
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
using Model.Managers;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class ContainerFlyout : ContentView
|
||||
{
|
||||
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||
public User user => (App.Current as App).CurrentUser;
|
||||
|
||||
public ContainerFlyout()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = this;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region Bindable XAML Properties
|
||||
// Bind MyFlyoutContent
|
||||
public static readonly BindableProperty MyFlyoutContentProperty =
|
||||
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid());
|
||||
|
||||
public View MyFlyoutContent
|
||||
{
|
||||
get => (View)GetValue(MyFlyoutContentProperty);
|
||||
set => SetValue(MyFlyoutContentProperty, value);
|
||||
}
|
||||
|
||||
// Bind IsNotConnected
|
||||
public static readonly BindableProperty IsNotConnectedProperty =
|
||||
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
|
||||
|
||||
public bool IsNotConnected
|
||||
{
|
||||
get => (bool)GetValue(IsNotConnectedProperty);
|
||||
set => SetValue(IsNotConnectedProperty, value);
|
||||
}
|
||||
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public async void ProfileButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new MyProfil());
|
||||
}
|
||||
|
||||
public async void ConnectionButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new Login());
|
||||
}
|
||||
}
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class ContainerFlyout : ContentView
|
||||
{
|
||||
public MasterManager Master => (Application.Current as App).Master;
|
||||
public User ConnectedUser => Master.User.CurrentConnected;
|
||||
|
||||
public ContainerFlyout()
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
BindingContext = this;
|
||||
|
||||
}
|
||||
|
||||
#region Bindable XAML Properties
|
||||
// Bind MyFlyoutContent
|
||||
public static readonly BindableProperty MyFlyoutContentProperty =
|
||||
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid());
|
||||
|
||||
public View MyFlyoutContent
|
||||
{
|
||||
get => (View)GetValue(MyFlyoutContentProperty);
|
||||
set => SetValue(MyFlyoutContentProperty, value);
|
||||
}
|
||||
|
||||
// Bind IsNotConnected
|
||||
public static readonly BindableProperty IsConnectedProperty =
|
||||
BindableProperty.Create("IsConnected", typeof(bool), typeof(Button), true);
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get => (bool)GetValue(IsConnectedProperty);
|
||||
set => SetValue(IsConnectedProperty, value);
|
||||
}
|
||||
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public async void ProfileButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new MyProfil());
|
||||
}
|
||||
|
||||
public async void ConnectionButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new Login());
|
||||
}
|
||||
}
|
@ -1,27 +1,27 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class MiniHeader : ContentView
|
||||
{
|
||||
public MiniHeader()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly BindableProperty TitleMiniProperty =
|
||||
BindableProperty.Create(nameof(TitleMini), typeof(string), typeof(Label), "Erreur de titre");
|
||||
|
||||
public string TitleMini
|
||||
{
|
||||
get => (string)GetValue(TitleMiniProperty);
|
||||
set => SetValue(TitleMiniProperty, value);
|
||||
}
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
namespace Views;
|
||||
|
||||
public partial class MiniHeader : ContentView
|
||||
{
|
||||
public MiniHeader()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly BindableProperty TitleMiniProperty =
|
||||
BindableProperty.Create(nameof(TitleMini), typeof(string), typeof(Label), "Erreur de titre");
|
||||
|
||||
public string TitleMini
|
||||
{
|
||||
get => (string)GetValue(TitleMiniProperty);
|
||||
set => SetValue(TitleMiniProperty, value);
|
||||
}
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
}
|
@ -1,32 +1,32 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class RecipeCase : ContentView
|
||||
{
|
||||
public RecipeCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly BindableProperty CaseImageSourceProperty =
|
||||
BindableProperty.Create("CaseImageSource", typeof(ImageSource), typeof(Image));
|
||||
|
||||
public ImageSource CaseImageSource
|
||||
{
|
||||
get => (ImageSource)GetValue(CaseImageSourceProperty);
|
||||
set => SetValue(CaseImageSourceProperty, value);
|
||||
}
|
||||
|
||||
public static readonly BindableProperty RecipeTitleProperty =
|
||||
BindableProperty.Create("RecipeTitle", typeof(string), typeof(Label));
|
||||
|
||||
public string RecipeTitle
|
||||
{
|
||||
get => (string)GetValue(RecipeTitleProperty);
|
||||
set => SetValue(RecipeTitleProperty, value);
|
||||
}
|
||||
|
||||
private async void ImageButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new ViewRecette());
|
||||
}
|
||||
}
|
||||
namespace Views;
|
||||
|
||||
public partial class RecipeCase : ContentView
|
||||
{
|
||||
public RecipeCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly BindableProperty CaseImageSourceProperty =
|
||||
BindableProperty.Create("CaseImageSource", typeof(ImageSource), typeof(Image));
|
||||
|
||||
public ImageSource CaseImageSource
|
||||
{
|
||||
get => (ImageSource)GetValue(CaseImageSourceProperty);
|
||||
set => SetValue(CaseImageSourceProperty, value);
|
||||
}
|
||||
|
||||
public static readonly BindableProperty RecipeTitleProperty =
|
||||
BindableProperty.Create("RecipeTitle", typeof(string), typeof(Label));
|
||||
|
||||
public string RecipeTitle
|
||||
{
|
||||
get => (string)GetValue(RecipeTitleProperty);
|
||||
set => SetValue(RecipeTitleProperty, value);
|
||||
}
|
||||
|
||||
private async void ImageButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new ViewRecette());
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
using CommunityToolkit.Maui.Behaviors;
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
using Model.Managers;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class MyProfil : ContentPage
|
||||
{
|
||||
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||
public User CurrentUser => (App.Current as App).CurrentUser;
|
||||
|
||||
|
||||
|
||||
public MyProfil()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = this;
|
||||
}
|
||||
public ObservableCollection<Priority> PriorityList { get; private set; } = new ObservableCollection<Priority>()
|
||||
{ Priority.Economic, Priority.Fast, Priority.Easy, Priority.Light, Priority.Gourmet };
|
||||
void DragGestureRecognizer_DragStarting2(System.Object sender, Microsoft.Maui.Controls.DragStartingEventArgs e)
|
||||
{
|
||||
e.Data.Properties["value"] = (sender as Element).Parent.BindingContext;
|
||||
}
|
||||
|
||||
void DropGestureRecognizer_Drop2(System.Object sender, Microsoft.Maui.Controls.DropEventArgs e)
|
||||
{
|
||||
var receivingElement = (Priority)((sender as Element).Parent.BindingContext);
|
||||
|
||||
var draggedElement = (Priority)e.Data.Properties["value"];
|
||||
int draggedIndex = PriorityList.IndexOf(draggedElement);
|
||||
PriorityList.RemoveAt(draggedIndex);
|
||||
|
||||
int receivingIndex = PriorityList.IndexOf(receivingElement);
|
||||
PriorityList.Insert(receivingIndex + 1, draggedElement);
|
||||
}
|
||||
|
||||
private void OnMyRecipeClicked(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushModalAsync(new MyPosts());
|
||||
}
|
||||
|
||||
private void OnAddRecipeClicked(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushModalAsync(new AddRecipe());
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using Model.Managers;
|
||||
using Model;
|
||||
|
||||
namespace Views;
|
||||
/// <summary>
|
||||
/// Classe de la page contenant le detail de la recette
|
||||
///
|
||||
/// </summary>
|
||||
public partial class ViewRecette : ContentPage
|
||||
{
|
||||
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||
public User user => (App.Current as App).CurrentUser;
|
||||
public Recipe Recipe => (App.Current as App).CurrentRecipe;
|
||||
public RecipeCollection AllRecipes => (App.Current as App).AllRecipes;
|
||||
public ViewRecette()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = this;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue