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-18 13:08:55 +01:00
|
|
|
|
|
|
|
|
|
namespace ProjetTheAlone.View
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for DashBoard.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
public partial class DashBoard : Window
|
|
|
|
|
{
|
|
|
|
|
ObservableCollection<string> cl = new ObservableCollection<string>();
|
|
|
|
|
RepaModel rm = new RepaModel();
|
|
|
|
|
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();
|
|
|
|
|
Epm = new ProjetTheAlone.Model.EventPasseModel(Cl);
|
|
|
|
|
EventPasse2.DataContext = EventPasse1.DataContext = Epm;
|
|
|
|
|
Epm.Classement = Cl;
|
|
|
|
|
|
2019-01-19 10:58:20 +01:00
|
|
|
|
FileStream fs = new System.IO.FileStream(@".\desert.jpg", FileMode.Open, FileAccess.Read);
|
2019-01-18 13:08:55 +01:00
|
|
|
|
BinaryReader br = new BinaryReader(fs);
|
|
|
|
|
byte[] result = br.ReadBytes((int)fs.Length);
|
|
|
|
|
br.Close();
|
|
|
|
|
fs.Close();
|
2019-01-18 19:04:54 +01:00
|
|
|
|
Rm.ListPlat.Add(new C_T_plat("Entrée", result, null));
|
|
|
|
|
Rm.ListPlat.Add(new C_T_plat("Plat", result, null));
|
2019-01-18 13:08:55 +01:00
|
|
|
|
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
|
2019-01-19 10:58:20 +01:00
|
|
|
|
Rm.Quand = "Matin";
|
2019-01-18 13:08:55 +01:00
|
|
|
|
Console.WriteLine($"~~~~~~{Rm.ListPlat[0].P_nom}~~~~~~");
|
|
|
|
|
|
2019-01-19 22:29:09 +01:00
|
|
|
|
RepasMatin.DataContext = RepasMidi.DataContext = RepasSoir.DataContext = Rm;
|
2019-01-18 13:08:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-19 10:58:20 +01:00
|
|
|
|
|
|
|
|
|
private void wnd_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Accueil.Openaffichage = false;
|
|
|
|
|
}
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|