From 5abc2e945a6e13b8e5793d4cad1659f63aecf4fe Mon Sep 17 00:00:00 2001 From: Jade_VAN_BRABANDT Date: Tue, 6 Jun 2023 16:30:45 +0200 Subject: [PATCH] Feat : BindingProperty popup =>Marche pas sur contentview ? --- Sources/Stim.Model/User.cs | 9 ++--- Sources/Stim/EntryPopup.xaml | 1 + Sources/Stim/EntryPopup.xaml.cs | 5 +-- Sources/Stim/ProfilPage.xaml | 26 +++++---------- Sources/Stim/UserInfo.xaml | 7 ++-- Sources/Stim/UserInfo.xaml.cs | 59 +++++++++++++++++++++++++++------ 6 files changed, 70 insertions(+), 37 deletions(-) diff --git a/Sources/Stim.Model/User.cs b/Sources/Stim.Model/User.cs index 9988a45..553e3f8 100644 --- a/Sources/Stim.Model/User.cs +++ b/Sources/Stim.Model/User.cs @@ -11,7 +11,7 @@ namespace Model public sealed class User : INotifyPropertyChanged , IEquatable { [DataMember] - public string? Username + public string Username { get => username; set @@ -29,7 +29,7 @@ namespace Model public string Biographie { get => biographie ?? "Pas de biographie"; - private set + set { if (string.IsNullOrWhiteSpace(value)) biographie = "Pas de biographie"; else @@ -44,7 +44,7 @@ namespace Model public string Email { get => email; - private set + set { Regex rg_email = new Regex("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$"); if (!(string.IsNullOrWhiteSpace(value)) && rg_email.IsMatch(value)) @@ -60,7 +60,7 @@ namespace Model public string Password { get => password; - private set + set { Regex rg = new Regex("^(?=.*[A-Za-z])(?=.*[0-9@$!%*#?&])[A-Za-z-0-9@$!%*#?&]{8,}$"); if (string.IsNullOrWhiteSpace(value) || !rg.IsMatch(value)) throw new ArgumentNullException(value); @@ -167,5 +167,6 @@ namespace Model foreach (Game game in Followed_Games) builder.Append($"{game.Name}\n"); return builder.ToString(); } + } } diff --git a/Sources/Stim/EntryPopup.xaml b/Sources/Stim/EntryPopup.xaml index b8b9542..bc09522 100644 --- a/Sources/Stim/EntryPopup.xaml +++ b/Sources/Stim/EntryPopup.xaml @@ -10,6 +10,7 @@ - - - - - - - - - - - + + diff --git a/Sources/Stim/UserInfo.xaml b/Sources/Stim/UserInfo.xaml index dca8861..047b2f0 100644 --- a/Sources/Stim/UserInfo.xaml +++ b/Sources/Stim/UserInfo.xaml @@ -10,9 +10,12 @@ - - +