Ajout de l'UCConnexion. Mise en place des focntionnalités pour utiliser le navigator dans la main Window. Ajout de style pour le xaml
continuous-integration/drone/push Build is passing Details

Navigator
Vincent ASTOLFI 2 years ago
parent 9f0f85df25
commit 2935b453de

@ -4,6 +4,15 @@
xmlns:local="clr-namespace:IHM"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style x:Key="BorderRessource" TargetType="Border">
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style x:Key="TextBlockRessource" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property=""
</Style>
</Application.Resources>
</Application>

@ -13,5 +13,6 @@ namespace IHM
/// </summary>
public partial class App : Application
{
public Navigator Navigator { get; private set; } = new Navigator();
}
}

@ -20,9 +20,11 @@ namespace IHM
/// </summary>
public partial class MainWindow : Window
{
public Navigator Nav => (App.Current as App).Navigator;
public MainWindow()
{
InitializeComponent();
DataContext = this;
}
}
}

@ -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<string, Func<UserControl>> WindowPart { get; private set; }
Dictionary<string, Func<UserControl>> windowPart { get; set; } = new Dictionary<string, Func<UserControl>>
@ -29,11 +31,19 @@ namespace IHM
// [PART_STATISTIQUE] = () => new UCStatistique(),
};
public ReadOnlyDictionary<string, Func<UserControl>> WindowMain { get; private set; }
Dictionary<string, Func<UserControl>> windowMain { get; set; } = new Dictionary<string, Func<UserControl>>
{
[PART_CONNEXION] = () => new UCConnexion(),
};
public Navigator()
{
WindowPart = new ReadOnlyDictionary<string, Func<UserControl>>(windowPart);
WindowMain = new ReadOnlyDictionary<string, Func<UserControl>>(windowMain);
SelectedUserControlCreator = windowPart.First();
SelectedUserControlCreator = windowMain.First();
}
public KeyValuePair<string, Func<UserControl>> SelectedUserControlCreator

@ -0,0 +1,15 @@
<UserControl x:Class="IHM.UCConnexion"
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">
<DockPanel Background="#F2C98C">
<Border DockPanel.Dock="Top" Style="{StaticResource BorderRessource} ">
<Border.Background>White</Border.Background>
<TextBlock Text="Login"/>
</Border>
</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 UCConnexion.xaml
/// </summary>
public partial class UCConnexion : UserControl
{
public UCConnexion()
{
InitializeComponent();
}
}
}
Loading…
Cancel
Save