diff --git a/Code/IHM/App.xaml b/Code/IHM/App.xaml index 6630f0f..e47f02f 100644 --- a/Code/IHM/App.xaml +++ b/Code/IHM/App.xaml @@ -9,9 +9,26 @@ + + - diff --git a/Code/IHM/IHM.csproj b/Code/IHM/IHM.csproj index 0c30ef3..7e1d10d 100644 --- a/Code/IHM/IHM.csproj +++ b/Code/IHM/IHM.csproj @@ -8,10 +8,18 @@ + + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Code/IHM/Navigator.cs b/Code/IHM/Navigator.cs index cff6558..e2c0513 100644 --- a/Code/IHM/Navigator.cs +++ b/Code/IHM/Navigator.cs @@ -18,7 +18,9 @@ namespace IHM public const string PART_PLANNIFICATION = "Plannification"; public const string PART_STATISTIQUE = "Statistique"; + public const string PART_MAIN = "Main"; public const string PART_CONNEXION = "Connexion"; + public const string PART_INSCRIPTION = "Inscription"; public ReadOnlyDictionary> WindowPart { get; private set; } @@ -31,17 +33,26 @@ namespace IHM // [PART_STATISTIQUE] = () => new UCStatistique(), }; + public ReadOnlyDictionary> WindowPartMain { get; private set; } + + Dictionary> windowPartMain { get; set; } = new Dictionary> + { + [PART_CONNEXION] = () => new UCConnexion(), + [PART_INSCRIPTION] = () => new UCInscription(), + }; + public ReadOnlyDictionary> WindowMain { get; private set; } Dictionary> windowMain { get; set; } = new Dictionary> { - [PART_CONNEXION] = () => new UCConnexion(), + [PART_MAIN] = () => new UCBienvenue(), }; public Navigator() { WindowPart = new ReadOnlyDictionary>(windowPart); WindowMain = new ReadOnlyDictionary>(windowMain); + WindowPartMain = new ReadOnlyDictionary>(windowPartMain); SelectedUserControlCreator = windowMain.First(); } @@ -63,12 +74,26 @@ namespace IHM void OnPropertyChanged([CallerMemberName] string propertyName = "") => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - public void NavigateTo(string windowPartName) + public void NavigateTo(string windowPartName, string? windowPartNameScd=default) { if (WindowPart.ContainsKey(windowPartName)) { selectedUserControlCreator = WindowPart.Single(kvp => kvp.Key == windowPartName); } + if (windowPartNameScd == default) return; + else NavigateToEx(windowPartNameScd); + } + public void NavigateToEx(string windowPartName) + { + if (WindowPartMain.ContainsKey(windowPartName)) + { + SelectedUserControlCreator = WindowPartMain.Single(kvp => kvp.Key == windowPartName); + } + + if (WindowMain.ContainsKey(windowPartName)) + { + SelectedUserControlCreator = WindowMain.Single(kvp => kvp.Key == windowPartName); + } } } } diff --git a/Code/IHM/UCBienvenue.xaml b/Code/IHM/UCBienvenue.xaml new file mode 100644 index 0000000..f6348e9 --- /dev/null +++ b/Code/IHM/UCBienvenue.xaml @@ -0,0 +1,42 @@ + + + + + + + + La première application d'aide à la gestion de budget personnel ou en entreprise + + + + + + + + + + Vous pouvez créer un compte + + + + + + Ou vous connecter si vous en possédée déjà un + + + + + + diff --git a/Code/IHM/UCBienvenue.xaml.cs b/Code/IHM/UCBienvenue.xaml.cs new file mode 100644 index 0000000..35b5c54 --- /dev/null +++ b/Code/IHM/UCBienvenue.xaml.cs @@ -0,0 +1,40 @@ +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 UCBienvenue.xaml + /// + public partial class UCBienvenue : UserControl + { + public Navigator Nav => (App.Current as App).Navigator; + public UCBienvenue() + { + InitializeComponent(); + DataContext = this; + } + + private void Button_Click_Inscription(object sender, RoutedEventArgs e) + { + Nav.NavigateTo(Navigator.PART_MAIN, Navigator.PART_INSCRIPTION); + } + + private void Button_Click_Connexion(object sender, RoutedEventArgs e) + { + Nav.NavigateTo(Navigator.PART_MAIN, Navigator.PART_CONNEXION); + } + } +} diff --git a/Code/IHM/UCConnexion.xaml b/Code/IHM/UCConnexion.xaml index b62eb14..5406984 100644 --- a/Code/IHM/UCConnexion.xaml +++ b/Code/IHM/UCConnexion.xaml @@ -5,129 +5,113 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:IHM" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800"> - - - + d:DesignHeight="450" d:DesignWidth="800" + Style="{StaticResource ImageFondRessource}"> + + + White - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - #DF775C + + + + + - + + + + + + + + + + + + - + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + - - - - - - - + - + + - - - - + + diff --git a/Code/IHM/UCConnexion.xaml.cs b/Code/IHM/UCConnexion.xaml.cs index f671cc7..18126b1 100644 --- a/Code/IHM/UCConnexion.xaml.cs +++ b/Code/IHM/UCConnexion.xaml.cs @@ -20,9 +20,16 @@ namespace IHM /// public partial class UCConnexion : UserControl { + public Navigator Nav => (App.Current as App).Navigator; public UCConnexion() { InitializeComponent(); } + + private void Button_Click_Acceuil(object sender, RoutedEventArgs e) + { + Nav.NavigateTo(Navigator.PART_CONNEXION, Navigator.PART_MAIN); + } + } } diff --git a/Code/IHM/UCInscription.xaml b/Code/IHM/UCInscription.xaml new file mode 100644 index 0000000..128e46f --- /dev/null +++ b/Code/IHM/UCInscription.xaml @@ -0,0 +1,13 @@ + + + + + diff --git a/Code/IHM/UCInscription.xaml.cs b/Code/IHM/UCInscription.xaml.cs new file mode 100644 index 0000000..e70213e --- /dev/null +++ b/Code/IHM/UCInscription.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 UCInscription.xaml + /// + public partial class UCInscription : UserControl + { + public UCInscription() + { + InitializeComponent(); + } + } +} diff --git a/Code/IHM/images/fond.jpg b/Code/IHM/images/fond.jpg new file mode 100644 index 0000000..014a6d6 Binary files /dev/null and b/Code/IHM/images/fond.jpg differ diff --git a/Code/IHM/images/fond2.png b/Code/IHM/images/fond2.png new file mode 100644 index 0000000..51886cd Binary files /dev/null and b/Code/IHM/images/fond2.png differ