diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj index 56bff87..94be685 100644 --- a/SunlightCentralizedControlManagement_SCCM_.csproj +++ b/SunlightCentralizedControlManagement_SCCM_.csproj @@ -407,6 +407,12 @@ false + + + {ccc54f28-5d20-4ab3-a1a8-c62cd2da3ae7} + nGantt + + diff --git a/View/ProductionPlanningView.xaml b/View/ProductionPlanningView.xaml index d2f8b53..76b8067 100644 --- a/View/ProductionPlanningView.xaml +++ b/View/ProductionPlanningView.xaml @@ -9,9 +9,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF" xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel" - xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" - - xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" + xmlns:Ngantt="clr-namespace:nGantt;assembly=nGantt" d:DataContext="{d:DesignInstance Type=viewmodel:ProductionPlanningModel}" mc:Ignorable="d" Loaded="UserControl_Loaded" d:DesignHeight="630" d:DesignWidth="1280"> @@ -24,9 +22,7 @@ - - - + diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index 64adfde..a65e6bc 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -33,6 +33,8 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement; using SunlightCentralizedControlManagement_SCCM_.ViewModel; using LiveChartsCore.SkiaSharpView.WPF; using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder; +using nGantt.GanttChart; +using nGantt; namespace SunlightCentralizedControlManagement_SCCM_.View @@ -57,10 +59,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.View List qw = MainWindowViewModel.Machines.AsEnumerable().Select(row => row.Field("name")).ToList();//转换列名为机台 int asd = qw.Count(); + var rowgroup1 = GanttChart.CreateGanttRowGroup("HeaderdGanttRowGroup"); + var row1 = GanttChart.CreateGanttRow(rowgroup1, "GanttRow 1"); + GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-02-01"), End = DateTime.Parse("2012-03-01"), Name = "GanttRow 1:GanttTask 1", TaskProgressVisibility = System.Windows.Visibility.Hidden }); + GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-03-05"), End = DateTime.Parse("2012-05-01"), Name = "GanttRow 1:GanttTask 2" }); + GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-06-01"), End = DateTime.Parse("2012-06-15"), Name = "GanttRow 1:GanttTask 3" }); + - } - + private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件 {