I’m trying to set up some binding. And FYI I’m using the MVVM pattern.
I have this control in my xaml code
<Grid.Resources>
<src:ActivityViewToToolTipContentConverter x:Key="tooltipConverter"></src:ActivityViewToToolTipContentConverter>
<SolidColorBrush x:Key="CustomNonWorkingBrush" Color="#DFE9F2" Opacity="0.75"/>
</Grid.Resources>
<gantt:GanttControl Name="GanttChart"
IDBinding="{Binding TaskID}"
NameBinding="{Binding TaskName}"
IndentLevelBinding="{Binding IndentLevel}"
StartTimeBinding="{Binding StartDate}"
PredecessorIndicesBinding="{Binding PredecessorIndices}"
DescriptionBinding="{Binding TaskResponsible}"
SortOrderBinding="{Binding SortOrder}"
ToolTipContentBinding="{Binding ActualTaskResponsibleDepartment, Converter={StaticResource tooltipConverter}}" //It is this line I am talking about
TemplateApplied="GanttChart_TemplateApplied"
CanUserReorderRows="True"
NonWorkingTimeBackground="{StaticResource CustomNonWorkingBrush}"
SyncRowBackgrounds="True"
AdjustDurationOnAssignment="False"
DependencyLineAdded="GanttChart_DependencyLineChanged"
DependencyLineRemoved="GanttChart_DependencyLineChanged"
Loaded="GanttChart_Loaded"
/>
I have my converter in a different file called “ActivityViewToToolTipContentConverter.cs”
When I run the code I get this exception:
System.Windows.Data Error: 40 : BindingExpression path error:
‘ActualTaskResponsibleDepartment’ property not found on ‘object’
”GanttActivityView’ (Name=”)’.
BindingExpression:Path=ActualTaskResponsibleDepartment;
DataItem=’GanttActivityView’ (Name=”); target element is ‘ToolTip’
(Name=’TaskTooltip’); target property is ‘Content’ (type ‘Object’)
Has your DataContext (bound to GanttActivityView) a property ActualTaskResponsibleDepartment?