ajout de tout les UC correspondant au pages principales et navigation entre elles

Navigator
Vincent ASTOLFI 2 years ago
parent c2cc13b477
commit 36d1dc45b5

@ -81,6 +81,7 @@
</Setter> </Setter>
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Padding" Value="4"/>
</Style> </Style>

@ -21,10 +21,10 @@
<Image Source="images/logo.png" Margin="10" Grid.Column="0" Grid.Row="0" Width="75"/> <Image Source="images/logo.png" Margin="10" Grid.Column="0" Grid.Row="0" Width="75"/>
<Button Content="Tableau de bord" Style="{StaticResource BoutonMain}" IsDefault="True"/> <Button Content="Tableau de bord" Style="{StaticResource BoutonMain}" IsDefault="True"/>
<Button Content="Tableau de bord" Style="{StaticResource BoutonMain}"/> <Button Click="Button_Click_Compte" Content="Compte" Style="{StaticResource BoutonMain}"/>
<Button Content="Tableau de bord" Style="{StaticResource BoutonMain}"/> <Button Click="Button_Click_Operation" Content="Opérations" Style="{StaticResource BoutonMain}"/>
<Button Content="Tableau de bord" Style="{StaticResource BoutonMain}"/> <Button Click="Button_Click_Echeancier" Content="Echéancier" Style="{StaticResource BoutonMain}"/>
<Button Content="Tableau de bord" Style="{StaticResource BoutonMain}"/> <Button Click="Button_Click_Plannification" Content="Plannification" Style="{StaticResource BoutonMain}"/>
</StackPanel> </StackPanel>

@ -26,5 +26,25 @@ namespace IHM
InitializeComponent(); InitializeComponent();
DataContext = this; DataContext = this;
} }
private void Button_Click_Compte(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_COMPTE);
}
private void Button_Click_Operation(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_OPERATION);
}
private void Button_Click_Echeancier(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_ECHEANCIER);
}
private void Button_Click_Plannification(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_PLANNIFICATION);
}
} }
} }

@ -16,7 +16,6 @@ namespace IHM
public const string PART_OPERATION = "Opération"; public const string PART_OPERATION = "Opération";
public const string PART_ECHEANCIER = "Echéancier"; public const string PART_ECHEANCIER = "Echéancier";
public const string PART_PLANNIFICATION = "Plannification"; public const string PART_PLANNIFICATION = "Plannification";
public const string PART_STATISTIQUE = "Statistique";
public const string PART_MAIN = "Main"; public const string PART_MAIN = "Main";
public const string PART_CONNEXION = "Connexion"; public const string PART_CONNEXION = "Connexion";
@ -27,10 +26,9 @@ namespace IHM
Dictionary<string, Func<UserControl>> windowPart { get; set; } = new Dictionary<string, Func<UserControl>> Dictionary<string, Func<UserControl>> windowPart { get; set; } = new Dictionary<string, Func<UserControl>>
{ {
[PART_COMPTE] = () => new UCCompte(), [PART_COMPTE] = () => new UCCompte(),
// [PART_OPERATION] = () => new UCOperation(), [PART_OPERATION] = () => new UCOperation(),
// [PART_ECHEANCIER] = () => new UCEcheancier(), [PART_ECHEANCIER] = () => new UCEcheancier(),
// [PART_PLANNIFICATION] = () => new UCPlannification(), [PART_PLANNIFICATION] = () => new UCPlannification(),
// [PART_STATISTIQUE] = () => new UCStatistique(),
}; };
public ReadOnlyDictionary<string, Func<UserControl>> WindowPartMain { get; private set; } public ReadOnlyDictionary<string, Func<UserControl>> WindowPartMain { get; private set; }
@ -74,17 +72,13 @@ namespace IHM
void OnPropertyChanged([CallerMemberName] string propertyName = "") void OnPropertyChanged([CallerMemberName] string propertyName = "")
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public void NavigateTo(string windowPartName, string? windowPartNameScd=default) public void NavigateTo(string windowPartName)
{ {
if (WindowPart.ContainsKey(windowPartName)) if (WindowPart.ContainsKey(windowPartName))
{ {
selectedUserControlCreator = WindowPart.Single(kvp => kvp.Key == windowPartName); SelectedUserControlCreator = WindowPart.Single(kvp => kvp.Key == windowPartName);
} }
if (windowPartNameScd == default) return;
else NavigateToEx(windowPartNameScd);
}
public void NavigateToEx(string windowPartName)
{
if (WindowPartMain.ContainsKey(windowPartName)) if (WindowPartMain.ContainsKey(windowPartName))
{ {
SelectedUserControlCreator = WindowPartMain.Single(kvp => kvp.Key == windowPartName); SelectedUserControlCreator = WindowPartMain.Single(kvp => kvp.Key == windowPartName);

@ -29,12 +29,12 @@ namespace IHM
private void Button_Click_Inscription(object sender, RoutedEventArgs e) private void Button_Click_Inscription(object sender, RoutedEventArgs e)
{ {
Nav.NavigateTo(Navigator.PART_MAIN, Navigator.PART_INSCRIPTION); Nav.NavigateTo(Navigator.PART_INSCRIPTION);
} }
private void Button_Click_Connexion(object sender, RoutedEventArgs e) private void Button_Click_Connexion(object sender, RoutedEventArgs e)
{ {
Nav.NavigateTo(Navigator.PART_MAIN, Navigator.PART_CONNEXION); Nav.NavigateTo(Navigator.PART_CONNEXION);
} }
} }
} }

@ -28,7 +28,7 @@ namespace IHM
private void Button_Click_Acceuil(object sender, RoutedEventArgs e) private void Button_Click_Acceuil(object sender, RoutedEventArgs e)
{ {
Nav.NavigateTo(Navigator.PART_CONNEXION, Navigator.PART_MAIN); Nav.NavigateTo(Navigator.PART_MAIN);
} }
private void Button_Click_Connection(object sender, RoutedEventArgs e) private void Button_Click_Connection(object sender, RoutedEventArgs e)

@ -0,0 +1,14 @@
<UserControl x:Class="IHM.UCEcheancier"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:IHM"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Style="{StaticResource ImageFondRessource}">
<DockPanel>
<Button Style="{StaticResource GreenButtonRessource}" Content="Enregistrer une échéance" Margin="45,0,0,0"/>
<Button Style="{StaticResource GreenButtonRessource}" Content="Supprimer une échéance" Margin="45,0,0,0"/>
</DockPanel>
</UserControl>

@ -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
{
/// <summary>
/// Logique d'interaction pour UCEcheancier.xaml
/// </summary>
public partial class UCEcheancier : UserControl
{
public UCEcheancier()
{
InitializeComponent();
}
}
}

@ -28,7 +28,7 @@ namespace IHM
} }
private void Button_Click_Acceuil(object sender, RoutedEventArgs e) private void Button_Click_Acceuil(object sender, RoutedEventArgs e)
{ {
Nav.NavigateTo(Navigator.PART_CONNEXION, Navigator.PART_MAIN); Nav.NavigateTo(Navigator.PART_MAIN);
} }
private void Button_Click_Validation(object sender, RoutedEventArgs e) private void Button_Click_Validation(object sender, RoutedEventArgs e)

@ -8,6 +8,15 @@
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
Style="{StaticResource ImageFondRessource}"> Style="{StaticResource ImageFondRessource}">
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Top" Text="Opérations" Style="{StaticResource TitreDePage}"/>
<WrapPanel DockPanel.Dock="Top">
<Button Style="{StaticResource GreenButtonRessource}" Content="Effectuer un crédit" Margin="45,0,0,0"/>
<Button Style="{StaticResource GreenButtonRessource}" Content="Effectuer un débit" Margin="70,0,10,0"/>
<Button Style="{StaticResource GreenButtonRessource}" Content="Retirer une opération" Margin="70,0,0,0"/>
<Button Style="{StaticResource GreenButtonRessource}" Content="Supprimer une opération" Margin="70,0,0,0"/>
</WrapPanel>
</DockPanel> </DockPanel>
</UserControl> </UserControl>

@ -0,0 +1,14 @@
<UserControl x:Class="IHM.UCPlannification"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:IHM"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Style="{StaticResource ImageFondRessource}">
<DockPanel>
<Button Style="{StaticResource GreenButtonRessource}" Content="Enregistrer une plannification"/>
<Button Style="{StaticResource GreenButtonRessource}" Content="supprimer une plannification"/>
</DockPanel>
</UserControl>

@ -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
{
/// <summary>
/// Logique d'interaction pour UCPlannification.xaml
/// </summary>
public partial class UCPlannification : UserControl
{
public UCPlannification()
{
InitializeComponent();
}
}
}
Loading…
Cancel
Save