From 2935b453de9fb00bdf0f71ccba3dd00a2ed452e6 Mon Sep 17 00:00:00 2001 From: Vincent ASTOLFI Date: Tue, 11 Oct 2022 08:51:12 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'UCConnexion.=20Mise=20en=20place?= =?UTF-8?q?=20des=20focntionnalit=C3=A9s=20pour=20utiliser=20le=20navigato?= =?UTF-8?q?r=20dans=20la=20main=20Window.=20Ajout=20de=20style=20pour=20le?= =?UTF-8?q?=20xaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/IHM/App.xaml | 9 +++++++++ Code/IHM/App.xaml.cs | 1 + Code/IHM/MainWindow.xaml.cs | 2 ++ Code/IHM/Navigator.cs | 12 +++++++++++- Code/IHM/UCConnexion.xaml | 15 +++++++++++++++ Code/IHM/UCConnexion.xaml.cs | 28 ++++++++++++++++++++++++++++ 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 Code/IHM/UCConnexion.xaml create mode 100644 Code/IHM/UCConnexion.xaml.cs diff --git a/Code/IHM/App.xaml b/Code/IHM/App.xaml index 373f0ad..cc26ef2 100644 --- a/Code/IHM/App.xaml +++ b/Code/IHM/App.xaml @@ -4,6 +4,15 @@ xmlns:local="clr-namespace:IHM" StartupUri="MainWindow.xaml"> + + + diff --git a/Code/IHM/App.xaml.cs b/Code/IHM/App.xaml.cs index aff7815..16ddde8 100644 --- a/Code/IHM/App.xaml.cs +++ b/Code/IHM/App.xaml.cs @@ -13,5 +13,6 @@ namespace IHM /// public partial class App : Application { + public Navigator Navigator { get; private set; } = new Navigator(); } } diff --git a/Code/IHM/MainWindow.xaml.cs b/Code/IHM/MainWindow.xaml.cs index 9ea40a2..caea0bd 100644 --- a/Code/IHM/MainWindow.xaml.cs +++ b/Code/IHM/MainWindow.xaml.cs @@ -20,9 +20,11 @@ namespace IHM /// public partial class MainWindow : Window { + public Navigator Nav => (App.Current as App).Navigator; public MainWindow() { InitializeComponent(); + DataContext = this; } } } diff --git a/Code/IHM/Navigator.cs b/Code/IHM/Navigator.cs index fa741ef..7f11aeb 100644 --- a/Code/IHM/Navigator.cs +++ b/Code/IHM/Navigator.cs @@ -18,6 +18,8 @@ namespace IHM public const string PART_PLANNIFICATION = "Plannification"; public const string PART_STATISTIQUE = "Statistique"; + public const string PART_CONNEXION = "Connexion"; + public ReadOnlyDictionary> WindowPart { get; private set; } Dictionary> windowPart { get; set; } = new Dictionary> @@ -29,11 +31,19 @@ namespace IHM // [PART_STATISTIQUE] = () => new UCStatistique(), }; + public ReadOnlyDictionary> WindowMain { get; private set; } + + Dictionary> windowMain { get; set; } = new Dictionary> + { + [PART_CONNEXION] = () => new UCConnexion(), + }; + public Navigator() { WindowPart = new ReadOnlyDictionary>(windowPart); + WindowMain = new ReadOnlyDictionary>(windowMain); - SelectedUserControlCreator = windowPart.First(); + SelectedUserControlCreator = windowMain.First(); } public KeyValuePair> SelectedUserControlCreator diff --git a/Code/IHM/UCConnexion.xaml b/Code/IHM/UCConnexion.xaml new file mode 100644 index 0000000..ce01666 --- /dev/null +++ b/Code/IHM/UCConnexion.xaml @@ -0,0 +1,15 @@ + + + + White + + + + diff --git a/Code/IHM/UCConnexion.xaml.cs b/Code/IHM/UCConnexion.xaml.cs new file mode 100644 index 0000000..f671cc7 --- /dev/null +++ b/Code/IHM/UCConnexion.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace IHM +{ + /// + /// Logique d'interaction pour UCConnexion.xaml + /// + public partial class UCConnexion : UserControl + { + public UCConnexion() + { + InitializeComponent(); + } + } +}