2019-01-18 13:08:55 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
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.Shapes;
|
|
|
|
|
using ProjetTheAlone.Model;
|
|
|
|
|
using ProjetTheAlone.Classes;
|
2019-01-19 10:58:20 +01:00
|
|
|
|
using ProjetTheAlone.ViewModel;
|
2019-01-27 18:50:01 +01:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Timers;
|
2019-01-18 13:08:55 +01:00
|
|
|
|
|
|
|
|
|
namespace ProjetTheAlone.View
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for DashBoard.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
public partial class DashBoard : Window
|
|
|
|
|
{
|
2019-01-27 18:50:01 +01:00
|
|
|
|
public System.Timers.Timer aTimer;
|
2019-01-18 13:08:55 +01:00
|
|
|
|
ObservableCollection<string> cl = new ObservableCollection<string>();
|
|
|
|
|
RepaModel rm = new RepaModel();
|
2019-01-27 11:52:08 +01:00
|
|
|
|
View.FicDetailEvent W_detailEvent = null;
|
2019-01-18 13:08:55 +01:00
|
|
|
|
public ObservableCollection<string> Cl
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (cl.Count <= 0)
|
|
|
|
|
{
|
|
|
|
|
cl.Add("1) Minou");
|
|
|
|
|
cl.Add("2) Minette");
|
|
|
|
|
cl.Add("3) Miaw");
|
|
|
|
|
cl.Add("4) Chat");
|
|
|
|
|
}
|
|
|
|
|
return cl;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
cl = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EventPasseModel Epm { get => epm; set => epm = value; }
|
|
|
|
|
internal RepaModel Rm { get => rm; set => rm = value; }
|
|
|
|
|
|
|
|
|
|
ProjetTheAlone.Model.EventPasseModel epm;
|
|
|
|
|
public DashBoard()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-01-24 22:24:05 +01:00
|
|
|
|
//EventPasse2.DataContext = EventPasse1.DataContext = Epm;
|
2019-01-18 13:08:55 +01:00
|
|
|
|
|
2019-01-27 18:50:01 +01:00
|
|
|
|
setAllDataContext();
|
|
|
|
|
SetTimer(5000);
|
|
|
|
|
aTimer.Enabled = true;
|
|
|
|
|
}
|
|
|
|
|
private void SetTimer(int timeMs)
|
|
|
|
|
{
|
|
|
|
|
// Create a timer with a two second interval.
|
|
|
|
|
aTimer = new System.Timers.Timer(timeMs);
|
|
|
|
|
// Hook up the Elapsed event for the timer.
|
|
|
|
|
aTimer.Elapsed += OnTimedEvent;
|
|
|
|
|
aTimer.AutoReset = true;
|
2019-01-18 13:08:55 +01:00
|
|
|
|
}
|
2019-01-19 10:58:20 +01:00
|
|
|
|
|
2019-01-27 18:50:01 +01:00
|
|
|
|
private void OnTimedEvent(Object source, ElapsedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
wnd.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
setAllDataContext();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-19 10:58:20 +01:00
|
|
|
|
private void wnd_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Accueil.Openaffichage = false;
|
|
|
|
|
}
|
2019-01-24 22:24:05 +01:00
|
|
|
|
|
|
|
|
|
private void RepasMatin_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-25 16:23:52 +01:00
|
|
|
|
|
|
|
|
|
private void wnd_MouseDown(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.ChangedButton == MouseButton.Left)
|
|
|
|
|
this.DragMove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PackIcon_MouseDown(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2019-01-25 18:23:38 +01:00
|
|
|
|
|
|
|
|
|
private void wnd_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2019-01-27 10:22:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.Alert.DataContext = new ViewModel.VM_DashBoard(this.Alert, "", 200);
|
2019-01-25 18:23:38 +01:00
|
|
|
|
}
|
2019-01-27 11:52:08 +01:00
|
|
|
|
|
|
|
|
|
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);
|
2019-01-27 18:50:01 +01:00
|
|
|
|
if (W_detailEvent == null || W_detailEvent != null && W_detailEvent.IsClosed)
|
2019-01-27 11:52:08 +01:00
|
|
|
|
{
|
|
|
|
|
W_detailEvent = new FicDetailEvent(_eventSelected);
|
2019-01-27 18:50:01 +01:00
|
|
|
|
|
2019-01-27 11:52:08 +01:00
|
|
|
|
}
|
2019-01-27 18:50:01 +01:00
|
|
|
|
else
|
|
|
|
|
W_detailEvent.setDataContext(_eventSelected);
|
2019-01-27 11:52:08 +01:00
|
|
|
|
if(!W_detailEvent.IsVisible)
|
|
|
|
|
{
|
|
|
|
|
W_detailEvent.Show();
|
|
|
|
|
}
|
|
|
|
|
W_detailEvent.Activate();
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
2019-01-27 18:50:01 +01:00
|
|
|
|
private void setAllDataContext()
|
|
|
|
|
{
|
|
|
|
|
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));
|
|
|
|
|
dgEventFuture0.DataContext = new EventDGV_VM(DateTime.Now.AddDays(0));
|
|
|
|
|
dgEventFuture1.DataContext = new EventDGV_VM(DateTime.Now.AddDays(1));
|
|
|
|
|
dgEventFuture2.DataContext = new EventDGV_VM(DateTime.Now.AddDays(2));
|
|
|
|
|
}
|
2019-01-18 13:08:55 +01:00
|
|
|
|
}
|
|
|
|
|
public class DebugDummyConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
Debugger.Break();
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
Debugger.Break();
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|