Ajout du converters permettant de transformer une Func en WindowPArt pour le Navigator. Ajout de la page Connexion afficher directement au lancement de l'application.
continuous-integration/drone/push Build is passing Details

Navigator
Vincent ASTOLFI 2 years ago
parent 96c2ba6510
commit fef26d39a1

@ -2,8 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:IHM" xmlns:local="clr-namespace:IHM"
xmlns:conv="clr-namespace:IHM.Converters"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">
<Application.Resources> <Application.Resources>
<conv:Func2WindowPartConverter x:Key="Func2WpConv"/>
<Style x:Key="BorderRessource" TargetType="Border"> <Style x:Key="BorderRessource" TargetType="Border">
<Setter Property="BorderBrush" Value="Black"/> <Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="2"/> <Setter Property="BorderThickness" Value="2"/>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
namespace IHM.Converters
{
public class Func2WindowPartConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Func<UserControl>? windowPartCreator = value as Func<UserControl>;
if (windowPartCreator == null)
{
return null;
}
return windowPartCreator();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

@ -24,5 +24,10 @@
</StackPanel> </StackPanel>
<ContentControl x:Name="contentControl"
DataContext="{Binding Nav}"
Content="{Binding SelectedUserControlCreator.Value,Converter={StaticResource Func2WpConv}}"
Grid.Column="1" Grid.Row="1"/>
</Grid> </Grid>
</Window> </Window>

@ -48,7 +48,7 @@ namespace IHM
public KeyValuePair<string, Func<UserControl>> SelectedUserControlCreator public KeyValuePair<string, Func<UserControl>> SelectedUserControlCreator
{ {
get => SelectedUserControlCreator; get => selectedUserControlCreator;
set set
{ {
if (selectedUserControlCreator.Equals(value)) return; if (selectedUserControlCreator.Equals(value)) return;

Loading…
Cancel
Save