Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DlhSoftTeam committed Jan 29, 2021
1 parent 7470402 commit da61168
Show file tree
Hide file tree
Showing 163 changed files with 293 additions and 160 deletions.
2 changes: 1 addition & 1 deletion GanttChartLightLibraryDemos/Demos/Demos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<TrustUrlParameters>true</TrustUrlParameters>
<ApplicationRevision>23</ApplicationRevision>
<ApplicationRevision>24</ApplicationRevision>
<ApplicationVersion>1.1.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down
4 changes: 2 additions & 2 deletions GanttChartLightLibraryDemos/Demos/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void LoadTreeView()
new SampleInfo { Tag = "DataBinding", Title = "Data binding", Description = "Shows how you can data bind the component to a custom task item collection" },
new SampleInfo { Tag = "GridColumns", Title = "Grid columns (built-in and custom)", Description = "Shows how to add built-in and custom grid columns including a column presenting task icon thumbs that offer vertical drag and drop support" },
new SampleInfo { Tag = "CustomAppearance", Title = "Custom appearance", Description = "Shows how you can set colors for all or for individual task items" },
new SampleInfo { Tag = "BarTemplating", Title = "Bar templating (including labels and interruptions)", Description = "Shows how you can define XAML templates for task bars displayed in the chart view (such as to display interruptions for task bars and more)" },
new SampleInfo { Tag = "BarTemplating", Title = "Bar templating (interruptions, summary background)", Description = "Shows how you can define XAML templates for task bars displayed in the chart view (such as to display labels and interruptions for task bars, and/or summary background colors, and more)" },
new SampleInfo { Tag = "DependencyLineTemplating", Title = "Dependency line colors and templating", Description = "Shows how you can define colors for dependency lines and/or an XAML template for displaying them in the chart view (such as to display dashed arrow lines and more)" },
new SampleInfo { Tag = "AssignmentsTemplate", Title = "Assignments template (resource icons)", Description = "Shows how you can customize assignments template and show resource icons in the chart area" },
new SampleInfo { Tag = "ZoomLevel", Title = "Zoom level (and disabling mouse wheel zooming)", Description = "Shows how you can set up zoom level settings for the chart area" },
Expand Down Expand Up @@ -301,7 +301,7 @@ private void LoadTreeView()
new SampleInfo { Tag = "DataBinding", Title = "Data binding", Description = "Shows how you can data bind the component to a custom task item collection" },
new SampleInfo { Tag = "GridColumns", Title = "Grid columns (built-in and custom)", Description = "Shows how to add built-in and custom grid columns including a column presenting task icon thumbs that offer vertical drag and drop support" },
new SampleInfo { Tag = "CustomAppearance", Title = "Custom appearance", Description = "Shows how you can set colors for all or for individual task items" },
new SampleInfo { Tag = "BarTemplating", Title = "Bar templating (including labels, interruptions, and summary background colors)", Description = "Shows how you can define XAML templates for task bars displayed in the chart view (such as to display interruptions for task bars, summary background colors, and more)" },
new SampleInfo { Tag = "BarTemplating", Title = "Bar templating (interruptions, summary background)", Description = "Shows how you can define XAML templates for task bars displayed in the chart view (such as to display labels and interruptions for task bars, and/or summary background colors, and more)" },
new SampleInfo { Tag = "DependencyLineTemplating", Title = "Dependency line colors and templating", Description = "Shows how you can define colors for dependency lines and/or an XAML template for displaying them in the chart view (such as to display dashed arrow lines and more)" },
new SampleInfo { Tag = "AssignmentsTemplate", Title = "Assignments template (resource icons)", Description = "Shows how you can customize assignments template and show resource icons in the chart area" },
new SampleInfo { Tag = "ZoomLevel", Title = "Zoom level (and disabling mouse wheel zooming)", Description = "Shows how you can set up zoom level settings for the chart area" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MainFeatures", "MainFeatures.csproj", "{3BA8A780-6367-4F9F-9953-17CD646B0C7A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MainFeatures", "MainFeatures.csproj", "{4DCB9703-985B-4BAE-850E-69819BB304A2}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MainFeatures", "MainFeatures.vbproj", "{579339C1-C10A-4BCE-8271-4CF6BCF49A56}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MainFeatures", "MainFeatures.vbproj", "{087690BA-6731-4941-99B0-726C4945B829}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssigningResources", "AssigningResources.csproj", "{10CEE7FD-AB3D-41D8-9B75-CFB3BAFB155F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssigningResources", "AssigningResources.csproj", "{5A35881B-637A-48F2-8A2C-52E854B83EA4}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssignmentsTemplate", "AssignmentsTemplate.csproj", "{172F3AE5-2F88-4673-A979-3851C9E776CE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssignmentsTemplate", "AssignmentsTemplate.csproj", "{9142F8C0-19EB-4331-911F-85C5571AE5BE}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssignmentsTree", "AssignmentsTree.csproj", "{1DFCC8F6-C6F2-44F7-AA38-650282DA5A79}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssignmentsTree", "AssignmentsTree.csproj", "{A05E0C86-5780-424C-A228-68E6CC0141D0}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomaticScheduling", "AutomaticScheduling.csproj", "{BABFCAAA-D9F8-4667-80DE-BFD4ED96D6B1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomaticScheduling", "AutomaticScheduling.csproj", "{56616F80-D109-4870-AE72-4EC8152EC090}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BarTemplating", "BarTemplating.csproj", "{DAEC4912-9C98-4C14-8462-DA0F343B7784}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BarTemplating", "BarTemplating.csproj", "{FF767E8C-93D4-4D89-8BCE-CA80FD6C5C7E}"
EndProject
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,26 @@ public class InterruptedBar
public double Width { get; set; }
}

// Optional background support for summary items.
private Brush background;
public Brush Background
{
get { return background; }
set
{
background = value;
OnPropertyChanged("Background");
}
}

public double VisibleItemCountHeight
{
get
{
return (1 + AllChildren.Where(i => i.IsVisible).Count()) * GanttChartView.ItemHeight;
}
}

protected override void OnPropertyChanged(string propertyName)
{
base.OnPropertyChanged(propertyName);
Expand Down Expand Up @@ -181,6 +201,17 @@ protected override void OnPropertyChanged(string propertyName)
});
break;
}
switch (propertyName)
{
case "IsExpanded":
Dispatcher.BeginInvoke((Action)delegate
{
OnPropertyChanged("VisibleItemCountHeight");
foreach (var parent in AllParents.Cast<CustomGanttChartItem>())
parent.OnPropertyChanged("VisibleItemCountHeight");
});
break;
}
}

// Alternatively (required, if you have mouse wheel zooming enabled), refresh the user interface from a central handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,38 @@
</Grid>
</DataTemplate>
</pdgcc:GanttChartDataGrid.StandardTaskTemplate>
<!-- Optionally, also define the custom bar template for summary tasks. -->
<pdgcc:GanttChartDataGrid.SummaryTaskTemplate>
<DataTemplate>
<Grid>
<Canvas Margin="-10,0">
<Rectangle Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Panel}}"
Height="{Binding VisibleItemCountHeight}"
Fill="{Binding Background}" Opacity="0.1"/>
</Canvas>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.3*"/>
</Grid.RowDefinitions>
<Rectangle Grid.Column="1" Grid.Row="1" Fill="{Binding Path=(pdgcc:GanttChartView.SummaryBarFill)}" Stroke="{Binding Path=(pdgcc:GanttChartView.SummaryBarStroke)}" StrokeThickness="{Binding GanttChartView.SummaryBarStrokeThickness}"/>
<Rectangle Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Width="{Binding ComputedSummaryCompletedBarWidth}" VerticalAlignment="Top" Height="{Binding GanttChartView.CompletedBarHeight}" MaxHeight="4" Fill="{Binding Path=(pdgcc:GanttChartView.SummaryCompletedBarFill)}" Margin="1" Visibility="{Binding GanttChartView.SummaryTaskCompletedEffortVisibility}" IsHitTestVisible="False"/>
<Line Grid.Column="1" Grid.Row="2" Stroke="{Binding Path=(pdgcc:GanttChartView.StandardBarStroke)}" StrokeThickness="1" StrokeDashArray="1,1" Y1="1" Y2="1" X1="0" X2="{Binding ComputedBarWidth}" Visibility="{Binding ExpansionVisibility}"/>
<Polygon Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Fill="{Binding Path=(pdgcc:GanttChartView.SummaryBarFill)}" Stroke="{Binding Path=(pdgcc:GanttChartView.SummaryBarStroke)}" StrokeThickness="{Binding GanttChartView.SummaryBarStrokeThickness}" Width="{Binding GanttChartView.BarHeight}" Stretch="Fill"
Points="0,0 0,0.5 0.5,0.8 1,0.5 1,0"/>
<Polygon Grid.Column="3" Grid.Row="1" Grid.RowSpan="2" Fill="{Binding Path=(pdgcc:GanttChartView.SummaryBarFill)}" Stroke="{Binding Path=(pdgcc:GanttChartView.SummaryBarStroke)}" StrokeThickness="{Binding GanttChartView.SummaryBarStrokeThickness}" Width="{Binding GanttChartView.BarHeight}" Stretch="Fill"
Points="1,0 1,0.5 0.5,0.8 0,0.5 0,0"/>
</Grid>
<pdgcc:TaskExpander/>
</Grid>
</DataTemplate>
</pdgcc:GanttChartDataGrid.SummaryTaskTemplate>
<pdgcc:GanttChartDataGrid.Items>
<!-- Use a custom item that inherits from GanttChartItem (see code behind). -->
<!-- Some item properties are set in code behind. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using DlhSoft.Windows.Controls;
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Demos.WPF.CSharp.GanttChartDataGrid.BarTemplating
Expand Down Expand Up @@ -48,8 +49,10 @@ public MainWindow()
item4.Markers.Add(new Marker { DateTime = DateTime.Today.AddDays(3).Add(TimeSpan.Parse("09:00:00")), Icon = new BitmapImage(new Uri(string.Format("pack://application:,,,/{0};component/Images/Warning.png", applicationName), UriKind.Absolute)), Note = "Validation required" });
item4.Markers.Add(new Marker { DateTime = DateTime.Today.AddDays(4).Add(TimeSpan.Parse("14:00:00")), Icon = new BitmapImage(new Uri(string.Format("pack://application:,,,/{0};component/Images/Error.png", applicationName), UriKind.Absolute)), Note = "Impossible to finish the task" });

CustomGanttChartItem item5 = GanttChartDataGrid.Items[5] as CustomGanttChartItem;

CustomGanttChartItem item6 = GanttChartDataGrid.Items[6] as CustomGanttChartItem;
item6.Start = DateTime.Today.Add(TimeSpan.Parse("08:00:00"));
item6.Start = DateTime.Today.AddDays(3).Add(TimeSpan.Parse("08:00:00"));
item6.Finish = DateTime.Today.AddDays(8).Add(TimeSpan.Parse("12:00:00"));
item6.EstimatedStart = DateTime.Today.AddDays(+1).Add(TimeSpan.Parse("08:00:00"));
item6.EstimatedFinish = DateTime.Today.AddDays(8 - 1).Add(TimeSpan.Parse("12:00:00"));
Expand All @@ -73,6 +76,13 @@ public MainWindow()
CompletedFinish = DateTime.Today.AddDays(i <= 8 ? (i - 4) * 3 : i - 8).AddDays(i % 6 == 1 ? 3 : 0)
});
}

// Optionally, set up summary background brushes as well.
item0.Background = Brushes.Blue;
item3.Background = Brushes.Yellow;
item5.Background = Brushes.Green;
for (var i = 8; i <= 30; i += 3)
(GanttChartDataGrid.Items[i] as CustomGanttChartItem).Background = i % 2 == 0 ? Brushes.Orange : Brushes.Brown;
}

private string theme = "Generic-bright";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baseline", "Baseline.csproj", "{5956A495-67C4-400A-9D67-DFC42034528A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baseline", "Baseline.csproj", "{BB5EB0E6-3EF0-4E0F-820B-2D1945ECF3C7}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicUsage", "BasicUsage.csproj", "{6242CF71-78D4-4651-850A-9D1CCE83E08F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicUsage", "BasicUsage.csproj", "{2EA142AC-C6A5-45E1-86A6-535588543FD1}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuiltInScales", "BuiltInScales.csproj", "{F92F146C-8ABB-42D5-B1D1-FAF416BBD3A7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuiltInScales", "BuiltInScales.csproj", "{80AB4896-6915-4307-BDCF-E78FBAEF38BA}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeNotifications", "ChangeNotifications.csproj", "{F1C16DF5-1E4A-4D1D-9BA2-4D3A4EC1F4D3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeNotifications", "ChangeNotifications.csproj", "{10D9BC85-29A6-415A-AFA1-A86D831A137F}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContinuousSchedule", "ContinuousSchedule.csproj", "{F8D08DB5-98F3-4E4A-B36D-6CF7328E072C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContinuousSchedule", "ContinuousSchedule.csproj", "{8CD3CB9E-5946-471E-B98D-1AE0FD0EC59A}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CriticalPath", "CriticalPath.csproj", "{E73A779B-8AFF-41D9-B408-3A8CC36B8848}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CriticalPath", "CriticalPath.csproj", "{AFD1FBCA-93DF-41F0-AE79-FB970C1B3853}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomAppearance", "CustomAppearance.csproj", "{5772CB5A-07FD-4989-8479-67E2B0439D6A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomAppearance", "CustomAppearance.csproj", "{6C130C66-E921-413F-A6C2-5A4AFF930065}"
EndProject
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<SolidColorBrush x:Key="StandardCompletedBarStroke" Color="#6b8fb0"/>
<SolidColorBrush x:Key="MilestoneBarFill" Color="Green"/>
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="LightGray"/>
<SolidColorBrush x:Key="AlternatingItemBackground" Color="#999999"/>
<SolidColorBrush x:Key="AlternatingItemBackground" Color="#cccccc"/>
</ResourceDictionary>
</Window.Resources>
<DockPanel>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomDatesAndDragging", "CustomDatesAndDragging.csproj", "{F9D90E2C-C4E5-4420-AC9E-931579568AFE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomDatesAndDragging", "CustomDatesAndDragging.csproj", "{63367711-696F-4880-8BB0-540407879F99}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomScaleHeaders", "CustomScaleHeaders.csproj", "{706C67E5-9EE7-4347-A2E4-FD8913F000D5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomScaleHeaders", "CustomScaleHeaders.csproj", "{7433F795-389C-4A9B-9DCA-9C66A34FC22C}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomSchedule", "CustomSchedule.csproj", "{CECFA97A-DE60-45C0-BAE2-9E263195AA87}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomSchedule", "CustomSchedule.csproj", "{C603536C-0ACD-4904-B0FD-9CDC281CECAD}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBinding", "DataBinding.csproj", "{FB8EFF0A-625E-4445-8457-2B6C14E3BE00}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBinding", "DataBinding.csproj", "{24201350-8AB8-4BDE-89E9-045DDEB1D335}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GanttChartDataGridDatabaseSample", "GanttChartDataGridDatabaseSample.csproj", "{E45E6D8D-A5B1-4224-B8B5-6F8381CAE67E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GanttChartDataGridDatabaseSample", "GanttChartDataGridDatabaseSample.csproj", "{8D6729E9-A220-4705-AB1E-9AD70F1B41FF}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DateAndTimeFormats", "DateAndTimeFormats.csproj", "{3958EABF-8AA5-464E-B122-B2016FF50F28}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DateAndTimeFormats", "DateAndTimeFormats.csproj", "{83A9AB8A-01D8-4DD5-B249-9B338D4E6359}"
EndProject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyLineTemplating", "DependencyLineTemplating.csproj", "{DF5E1C87-9C03-4A06-81C6-5F2C96BD6438}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyLineTemplating", "DependencyLineTemplating.csproj", "{BE6AEF1B-9537-4BC2-BF40-ED377F80FF57}"
EndProject
Loading

0 comments on commit da61168

Please sign in to comment.