sc 10 months ago
parent
commit
649b595936
  1. 6
      SunlightCentralizedControlManagement_SCCM_.csproj
  2. 8
      View/ProductionPlanningView.xaml
  3. 11
      View/ProductionPlanningView.xaml.cs

6
SunlightCentralizedControlManagement_SCCM_.csproj

@ -407,6 +407,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\nGantt\nGantt.csproj">
<Project>{ccc54f28-5d20-4ab3-a1a8-c62cd2da3ae7}</Project>
<Name>nGantt</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterResolveReferences">
<ItemGroup>

8
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 @@
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<!-- <lvc:CartesianChart x:Name="ch" XAxes="{Binding XAxes}" YAxes="{Binding YAxes}" Series="{Binding Series}" />-->
<wfi:WindowsFormsHost >
</wfi:WindowsFormsHost>
<Ngantt:GanttControl x:Name="GanttChart"/>
</Grid>
<StackPanel x:Name="scr" Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal">
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">

11
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<string> qw = MainWindowViewModel.Machines.AsEnumerable().Select(row => row.Field<string>("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)//退出事件
{

Loading…
Cancel
Save