Ajoyt de nombreux UC est lien les uns les autres avec le navigator

Navigator
Vincent ASTOLFI 2 years ago
parent 00a1eebb31
commit 0877185fca

@ -12,16 +12,23 @@ namespace IHM
{ {
public class Navigator : INotifyPropertyChanged public class Navigator : INotifyPropertyChanged
{ {
public const string PART_COMPTE = "Compte";
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_PLANNIFICATION = "Plannification"; public const string PART_PLANNIFICATION = "Plannification";
public const string PART_MAIN = "Main"; public const string PART_MAIN = "Main";
public const string PART_CONNEXION = "Connexion"; public const string PART_CONNEXION = "Connexion";
public const string PART_INSCRIPTION = "Inscription"; public const string PART_INSCRIPTION = "Inscription";
public const string PART_MODIFSOLDE = "ModifSolde"; public const string PART_MODIFSOLDE = "ModifSolde";
public const string PART_COMPTE = "Compte";
public const string PART_AJOUTER_BANQUE = "Ajouter une banque";
public const string PART_SUPPRIMER_BANQUE = "Supprimer une banque";
public const string PART_AJOUTER_COMPTE = "Ajouter une compte";
public const string PART_SUPPRIMER_COMPTE = "Supprimer un compte";
public const string PART_ECHEANCIER = "Echéancier";
public const string PART_AJOUTER_ECHEANCE = "Enregistrer une échéance";
public const string PART_SUPPRIMER_ECHEANCE = "Supprimer une échéance";
public ReadOnlyDictionary<string, Func<UserControl>> WindowPart { get; private set; } public ReadOnlyDictionary<string, Func<UserControl>> WindowPart { get; private set; }
Dictionary<string, Func<UserControl>> windowPart { get; set; } = new Dictionary<string, Func<UserControl>> Dictionary<string, Func<UserControl>> windowPart { get; set; } = new Dictionary<string, Func<UserControl>>
@ -34,6 +41,12 @@ namespace IHM
[PART_PLANNIFICATION] = () => new UCPlannification(), [PART_PLANNIFICATION] = () => new UCPlannification(),
[PART_INSCRIPTION] = () => new UCInscription(), [PART_INSCRIPTION] = () => new UCInscription(),
[PART_MODIFSOLDE] = () => new UCModifSolde(), [PART_MODIFSOLDE] = () => new UCModifSolde(),
[PART_AJOUTER_BANQUE] = () => new UCAjouterBanque(),
[PART_SUPPRIMER_BANQUE] = () => new UCSupprimerBanque(),
[PART_AJOUTER_COMPTE] = () => new UCAjouterCompte(),
[PART_SUPPRIMER_COMPTE] = () => new UCSupprimerCompte(),
[PART_AJOUTER_ECHEANCE] = () => new UCAjouterEcheance(),
[PART_SUPPRIMER_ECHEANCE] = () => new UCSupprimerEcheance(),
}; };

@ -0,0 +1,16 @@
<UserControl x:Class="IHM.UCAjouterBanque"
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>
<TextBlock Text="A faire" FontSize="40"/>
<Button Click="Button_Click_Retour" Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</DockPanel>
</UserControl>

@ -0,0 +1,34 @@
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 UCAjouterBanque.xaml
/// </summary>
public partial class UCAjouterBanque : UserControl
{
public Navigator Nav => (App.Current as App).Navigator;
public UCAjouterBanque()
{
InitializeComponent();
}
private void Button_Click_Retour(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_COMPTE);
}
}
}

@ -0,0 +1,16 @@
<UserControl x:Class="IHM.UCAjouterCompte"
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>
<TextBlock Text="A FAIRE" FontSize="40"/>
<Button Click="Button_Click_Retour" Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</DockPanel>
</UserControl>

@ -0,0 +1,35 @@
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 UCAjouterCompte.xaml
/// </summary>
public partial class UCAjouterCompte : UserControl
{
public Navigator Nav => (App.Current as App).Navigator;
public UCAjouterCompte()
{
InitializeComponent();
}
private void Button_Click_Retour(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_COMPTE);
}
}
}

@ -0,0 +1,16 @@
<UserControl x:Class="IHM.UCAjouterEcheance"
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>
<TextBlock Text="A FAIRE" FontSize="40"/>
<Button Click="Button_Click_Retour" Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</DockPanel>
</UserControl>

@ -0,0 +1,35 @@
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 UCAjouterEcheance.xaml
/// </summary>
public partial class UCAjouterEcheance : UserControl
{
public Navigator Nav => (App.Current as App).Navigator;
public UCAjouterEcheance()
{
InitializeComponent();
}
private void Button_Click_Retour(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_ECHEANCIER);
}
}
}

@ -0,0 +1,16 @@
<UserControl x:Class="IHM.UCAjouterPlanification"
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>
<TextBlock Text="A FAIRE" FontSize="40"/>
<Button Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</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 UCAjouterPlanification.xaml
/// </summary>
public partial class UCAjouterPlanification : UserControl
{
public UCAjouterPlanification()
{
InitializeComponent();
}
}
}

@ -14,16 +14,16 @@
<TextBlock Style="{StaticResource TitreDePage}" >Compte</TextBlock> <TextBlock Style="{StaticResource TitreDePage}" >Compte</TextBlock>
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel DockPanel.Dock="Left" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20"> <Button Click="Button_Click_Ajouter_Banque" Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20">
<TextBlock Text="Ajouter une banque" Style="{StaticResource TextBlockRessource}"/> <TextBlock Text="Ajouter une banque" Style="{StaticResource TextBlockRessource}"/>
</Button> </Button>
<Button Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20"> <Button Click="Button_Click_Supprimer_Banque" Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20">
<TextBlock Text="Supprimer une banque" Style="{StaticResource TextBlockRessource}"/> <TextBlock Text="Supprimer une banque" Style="{StaticResource TextBlockRessource}"/>
</Button> </Button>
<Button Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20"> <Button Click="Button_Click_Ajouter_Compte" Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20">
<TextBlock Text="Ajouter un compte" Style="{StaticResource TextBlockRessource}"/> <TextBlock Text="Ajouter un compte" Style="{StaticResource TextBlockRessource}"/>
</Button> </Button>
<Button Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20"> <Button Click="Button_Click_Supprimer_Compte" Style="{StaticResource GreenButtonRessource}" Height="25" Width="150" Margin="20">
<TextBlock Text="Supprimer un compte" Style="{StaticResource TextBlockRessource}"/> <TextBlock Text="Supprimer un compte" Style="{StaticResource TextBlockRessource}"/>
</Button> </Button>
</StackPanel> </StackPanel>

@ -27,6 +27,26 @@ namespace IHM
{ {
Nav.NavigateTo(Navigator.PART_MODIFSOLDE); Nav.NavigateTo(Navigator.PART_MODIFSOLDE);
} }
private void Button_Click_Ajouter_Banque(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_AJOUTER_BANQUE);
}
private void Button_Click_Supprimer_Banque(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_SUPPRIMER_BANQUE);
}
private void Button_Click_Ajouter_Compte(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_AJOUTER_COMPTE);
}
private void Button_Click_Supprimer_Compte(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_SUPPRIMER_COMPTE);
}
} }
} }

@ -8,7 +8,7 @@
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
Style="{StaticResource ImageFondRessource}"> Style="{StaticResource ImageFondRessource}">
<DockPanel> <DockPanel>
<Button Style="{StaticResource GreenButtonRessource}" Content="Enregistrer une échéance" Margin="45,0,0,0"/> <Button Click="Button_Click_Ajouter_Echeance" 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"/> <Button Click="Button_Click_Supprimer_Echeance" Style="{StaticResource GreenButtonRessource}" Content="Supprimer une échéance" Margin="45,0,0,0"/>
</DockPanel> </DockPanel>
</UserControl> </UserControl>

@ -20,9 +20,21 @@ namespace IHM
/// </summary> /// </summary>
public partial class UCEcheancier : UserControl public partial class UCEcheancier : UserControl
{ {
public Navigator Nav => (App.Current as App).Navigator;
public UCEcheancier() public UCEcheancier()
{ {
InitializeComponent(); InitializeComponent();
} }
private void Button_Click_Ajouter_Echeance(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_AJOUTER_ECHEANCE);
}
private void Button_Click_Supprimer_Echeance(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_SUPPRIMER_ECHEANCE);
}
} }
} }

@ -0,0 +1,16 @@
<UserControl x:Class="IHM.UCSupprimerBanque"
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>
<TextBlock Text="A FAIRE" FontSize="40"/>
<Button Click="Button_Click_Retour" Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</DockPanel>
</UserControl>

@ -0,0 +1,34 @@
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 UCSupprimerBanque.xaml
/// </summary>
public partial class UCSupprimerBanque : UserControl
{
public Navigator Nav => (App.Current as App).Navigator;
public UCSupprimerBanque()
{
InitializeComponent();
}
private void Button_Click_Retour(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_COMPTE);
}
}
}

@ -0,0 +1,17 @@
<UserControl x:Class="IHM.UCSupprimerCompte"
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>
<TextBlock Text="A FAIRE" FontSize="40"/>
<Button Click="Button_Click_Retour" Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</DockPanel>
</UserControl>

@ -0,0 +1,35 @@
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 UCSupprimerCompte.xaml
/// </summary>
public partial class UCSupprimerCompte : UserControl
{
public Navigator Nav => (App.Current as App).Navigator;
public UCSupprimerCompte()
{
InitializeComponent();
}
private void Button_Click_Retour(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_COMPTE);
}
}
}

@ -0,0 +1,16 @@
<UserControl x:Class="IHM.UCSupprimerEcheance"
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>
<TextBlock Text="A FAIRE" FontSize="40"/>
<Button Click="Button_Click_Retour" Style="{StaticResource GreenButtonRessource}">
<TextBlock Text="Retour"/>
</Button>
</DockPanel>
</UserControl>

@ -0,0 +1,35 @@
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 UCSupprimerEcheance.xaml
/// </summary>
public partial class UCSupprimerEcheance : UserControl
{
public Navigator Nav => (App.Current as App).Navigator;
public UCSupprimerEcheance()
{
InitializeComponent();
}
private void Button_Click_Retour(object sender, RoutedEventArgs e)
{
Nav.NavigateTo(Navigator.PART_ECHEANCIER);
}
}
}
Loading…
Cancel
Save