From 5f4051d56ff99c5ae8efa377665046fecc77217e Mon Sep 17 00:00:00 2001 From: Jade_VAN_BRABANDT Date: Wed, 31 May 2023 19:33:17 +0200 Subject: [PATCH] Feat : Contentview pas fini --- Sources/Stim/AddGamePage.xaml.cs | 1 + Sources/Stim/DetailledPage.xaml | 1 - Sources/Stim/MainPage.xaml | 3 --- Sources/Stim/ProfilPage.xaml | 19 +++++-------------- Sources/Stim/Stim.csproj | 6 ++++++ Sources/Stim/UserInfo.xaml | 18 ++++++++++++++++++ Sources/Stim/UserInfo.xaml.cs | 29 +++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 Sources/Stim/UserInfo.xaml create mode 100644 Sources/Stim/UserInfo.xaml.cs diff --git a/Sources/Stim/AddGamePage.xaml.cs b/Sources/Stim/AddGamePage.xaml.cs index 2c675ae..a072a06 100644 --- a/Sources/Stim/AddGamePage.xaml.cs +++ b/Sources/Stim/AddGamePage.xaml.cs @@ -1,6 +1,7 @@ using Model; using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; using Application = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Application; +using Windows.Gaming.Preview.GamesEnumeration; namespace Stim; diff --git a/Sources/Stim/DetailledPage.xaml b/Sources/Stim/DetailledPage.xaml index 4b6c05b..0e1ab2c 100644 --- a/Sources/Stim/DetailledPage.xaml +++ b/Sources/Stim/DetailledPage.xaml @@ -1,7 +1,6 @@ diff --git a/Sources/Stim/MainPage.xaml b/Sources/Stim/MainPage.xaml index e2d8316..c8a322e 100644 --- a/Sources/Stim/MainPage.xaml +++ b/Sources/Stim/MainPage.xaml @@ -5,9 +5,6 @@ Title="Accueil" Background="{StaticResource Secondary}"> - - - diff --git a/Sources/Stim/ProfilPage.xaml b/Sources/Stim/ProfilPage.xaml index 1b9076a..cfa26b8 100644 --- a/Sources/Stim/ProfilPage.xaml +++ b/Sources/Stim/ProfilPage.xaml @@ -1,6 +1,7 @@ @@ -30,17 +31,7 @@ - - - - - - - - - - + @@ -52,7 +43,6 @@ - @@ -63,7 +53,8 @@ - + + diff --git a/Sources/Stim/Stim.csproj b/Sources/Stim/Stim.csproj index 8be7f62..9115c82 100644 --- a/Sources/Stim/Stim.csproj +++ b/Sources/Stim/Stim.csproj @@ -64,6 +64,9 @@ %(Filename) + + UserInfo.xaml + @@ -76,6 +79,9 @@ MSBuild:Compile + + MSBuild:Compile + diff --git a/Sources/Stim/UserInfo.xaml b/Sources/Stim/UserInfo.xaml new file mode 100644 index 0000000..dca8861 --- /dev/null +++ b/Sources/Stim/UserInfo.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/Sources/Stim/UserInfo.xaml.cs b/Sources/Stim/UserInfo.xaml.cs new file mode 100644 index 0000000..128c7f8 --- /dev/null +++ b/Sources/Stim/UserInfo.xaml.cs @@ -0,0 +1,29 @@ +namespace Stim; +public partial class UserInfo : ContentView +{ + public static readonly BindableProperty BindProperty = + BindableProperty.Create(nameof(Bind), typeof(string), typeof(UserInfo), string.Empty, propertyChanged: OnBindChanged); + + public string Bind + { + get { return (string)GetValue(BindProperty); } + set { SetValue(BindProperty, value); } + } + + private static void OnBindChanged(BindableObject bindable, object oldValue, object newValue) + { + var contentView = (UserInfo)bindable; + contentView.OnBindChanged((string)oldValue, (string)newValue); + } + + public UserInfo() + { + InitializeComponent(); + BindingContext = ((App)App.Current).Manager; + } + + private void OnBindChanged(string oldValue, string newValue) + { + // Réagissez aux changements de la propriété de liaison ici + } +}