From 17331c389e98897895d01997028451651ced8040 Mon Sep 17 00:00:00 2001 From: Adrien VAN DAMME Date: Sun, 27 Jan 2019 11:52:08 +0100 Subject: [PATCH] DashBoard dgv double click ok --- ProjetTheAlone/ProjetTheAlone.csproj | 9 +++ ProjetTheAlone/View/DashBoard.xaml | 12 ++-- ProjetTheAlone/View/DashBoard.xaml.cs | 20 ++++++ ProjetTheAlone/View/FicDetailEvent.xaml | 27 ++++---- ProjetTheAlone/View/FicDetailEvent.xaml.cs | 33 +++++++++- ProjetTheAlone/View/FicEvenementEncode.xaml | 62 ++++--------------- .../View/FicEvenementEncode.xaml.cs | 11 +++- ProjetTheAlone/ViewModel/EncodeEquipe.cs | 5 +- ProjetTheAlone/ViewModel/EncodeEvent.cs | 27 +++++--- 9 files changed, 124 insertions(+), 82 deletions(-) diff --git a/ProjetTheAlone/ProjetTheAlone.csproj b/ProjetTheAlone/ProjetTheAlone.csproj index a384de3..99a33c3 100644 --- a/ProjetTheAlone/ProjetTheAlone.csproj +++ b/ProjetTheAlone/ProjetTheAlone.csproj @@ -90,6 +90,8 @@ + + @@ -100,6 +102,9 @@ + + FicClassement.xaml + FicDetailEvent.xaml @@ -192,6 +197,10 @@ FicRepasEncode.xaml + + Designer + XamlIntelliSenseFileGenerator + Designer MSBuild:Compile diff --git a/ProjetTheAlone/View/DashBoard.xaml b/ProjetTheAlone/View/DashBoard.xaml index e4b0210..d0632f6 100644 --- a/ProjetTheAlone/View/DashBoard.xaml +++ b/ProjetTheAlone/View/DashBoard.xaml @@ -39,7 +39,7 @@ + IsReadOnly="True" AutoGenerateColumns="False" Height="auto" MouseDoubleClick="DgEvent_MouseDoubleClick"> @@ -47,14 +47,14 @@ + IsReadOnly="True" AutoGenerateColumns="False" Grid.Row="1" Height="auto" MouseDoubleClick="DgEvent_MouseDoubleClick"> + IsReadOnly="True" AutoGenerateColumns="False" Grid.Row="1" Height="auto" MouseDoubleClick="DgEvent_MouseDoubleClick"> @@ -88,21 +88,21 @@ + IsReadOnly="True" AutoGenerateColumns="False" Height="auto" MouseDoubleClick="DgEvent_MouseDoubleClick"> + IsReadOnly="True" AutoGenerateColumns="False" Height="auto" MouseDoubleClick="DgEvent_MouseDoubleClick"> + IsReadOnly="True" AutoGenerateColumns="False" Height="auto" MouseDoubleClick="DgEvent_MouseDoubleClick"> diff --git a/ProjetTheAlone/View/DashBoard.xaml.cs b/ProjetTheAlone/View/DashBoard.xaml.cs index b47df25..29a3328 100644 --- a/ProjetTheAlone/View/DashBoard.xaml.cs +++ b/ProjetTheAlone/View/DashBoard.xaml.cs @@ -29,6 +29,7 @@ namespace ProjetTheAlone.View { ObservableCollection cl = new ObservableCollection(); RepaModel rm = new RepaModel(); + View.FicDetailEvent W_detailEvent = null; public ObservableCollection Cl { get @@ -61,6 +62,7 @@ namespace ProjetTheAlone.View testQuand.DataContext = RepasAjd.DataContext = new RepaModel(DateTime.Now); RepasDemain.DataContext = new RepaModel(DateTime.Now.AddDays(1)); RepasApresDemain.DataContext = new RepaModel(DateTime.Now.AddDays(2)); + dgEventPasse2.DataContext = new EventDGV_VM(DateTime.Now.AddDays(-3)); dgEventPasse1.DataContext = new EventDGV_VM(DateTime.Now.AddDays(-2)); dgEventPasse0.DataContext = new EventDGV_VM(DateTime.Now.AddDays(-1)); @@ -97,6 +99,24 @@ namespace ProjetTheAlone.View this.Alert.DataContext = new ViewModel.VM_DashBoard(this.Alert, "", 200); } + + private void DgEvent_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + if (((DataGrid)sender).SelectedItems.Count == 0) + return; + C_T_event _eventSelected = ((C_T_event)((DataGrid)sender).SelectedItem); + if(W_detailEvent == null || W_detailEvent != null && W_detailEvent.IsClosed) + { + W_detailEvent = new FicDetailEvent(_eventSelected); + + } + if(!W_detailEvent.IsVisible) + { + W_detailEvent.Show(); + } + W_detailEvent.Activate(); + e.Handled = true; + } } public class DebugDummyConverter : IValueConverter { diff --git a/ProjetTheAlone/View/FicDetailEvent.xaml b/ProjetTheAlone/View/FicDetailEvent.xaml index 05ab9b1..899b7ab 100644 --- a/ProjetTheAlone/View/FicDetailEvent.xaml +++ b/ProjetTheAlone/View/FicDetailEvent.xaml @@ -4,6 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ProjetTheAlone.View" + xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" mc:Ignorable="d" Title="FicDetailEvent" Height="517.897" Width="638.259" WindowStartupLocation="CenterScreen" WindowStyle="None"> @@ -13,29 +14,33 @@ Content="Quitter" Click="btnQuitter_Click" Height="41" Margin="485,442,37,25" RenderTransformOrigin="1.189,1.927"/> - + Command="{Binding cConfirmer}"/> + Content="Nouveau type d'événement" RenderTransformOrigin="0.017,0.519" Height="Auto" Click="btnNewTypeEvent_Click"/> + Content="Quitter" RenderTransformOrigin="0.017,0.519" Click="btnQuitter_Click" Height="Auto"/> + Command="{Binding cAnnuler}"/>