This commit is contained in:
adri
2019-01-18 13:08:55 +01:00
parent 8f7992622c
commit 63ac321e2f
67 changed files with 3449 additions and 6 deletions

View File

@@ -0,0 +1,86 @@
<Window x:Class="ProjetTheAlone.View.DashBoard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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:control="clr-namespace:ProjetTheAlone.UserControlDIY"
xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
xmlns:classes="clr-namespace:ProjetTheAlone.Classes"
mc:Ignorable="d"
Title="DashBoard" Height="495.378" Width="1014.286" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
Name="wnd">
<Window.Resources>
<local:DebugDummyConverter x:Key="DebugDummyConverter" />
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5*" />
<RowDefinition Height="5*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<DockPanel>
<ItemsControl x:Name="RepasMatin">
<!-- Set the Template for each row to a TextBlock and another ItemsControl -->
<ItemsControl.ItemTemplate>
<DataTemplate DataType="classes:C_T_plat">
<control:Plat ></control:Plat>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- <ListView x:Name="RepasMatin" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ListView.ItemTemplate>
<DataTemplate DataType="classes:C_T_plat">
<control:Plat></control:Plat>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>-->
</DockPanel>
<!---->
<materialDesign:PackIcon Kind="Build" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand"/>
</Grid>
<Grid Grid.Row="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<control:EventPasse x:Name="EventPasse1" Classement="{Binding Classement}"></control:EventPasse>
<control:EventPasse x:Name="EventPasse2" Classement="{Binding Classement}" Grid.Column="1"></control:EventPasse>
<control:EventFutur Grid.Column="2"></control:EventFutur>
<control:EventFutur Grid.Column="3"></control:EventFutur>
</Grid>
<Grid Grid.Row="2" Visibility="Visible">
<Border>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="OrangeRed" Offset="0" />
<GradientStop Color="DarkOrange" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<TextBlock Grid.Column="1" Style="{StaticResource MaterialDesignTitleTextBlock}" VerticalAlignment="Center" Height="Auto" Text="Absentéisme ou alerte" />
</Grid>
</Grid>
</Window>

View File

@@ -0,0 +1,92 @@
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;
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;
FileStream fs = new System.IO.FileStream(@"C:\Users\adrie\Nextcloud\ecole\3IS\POO\ProjetTheAlone\ProjetTheAlone\img\desert.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] result = br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Console.WriteLine($"~~~~~~{Rm.ListPlat[0].P_nom}~~~~~~");
RepasMatin.ItemsSource = Rm.ListPlat;
}
}
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;
}
}
}