RadiantQ Forum

Product => WPF Gantt Package => Topic started by: tim on December 08, 2020, 10:46:01 AM

Title: Binding errors from custom popups
Post by: tim on December 08, 2020, 10:46:01 AM
I get the following binding errors in my output window.

Code: [Select]
System.Windows.Data Error: 40 : BindingExpression path error: 'ProposedStartTime' property not found on 'object' ''GanttChart' (Name='GanttChart')'. BindingExpression:Path=ProposedStartTime; DataItem='GanttChart' (Name='GanttChart'); target element is 'TextBlock' (Name='CustomMovingInfoPopup_ProposedStartTime'); target property is 'Text' (type 'String')
System.Windows.Data Error: 40 : BindingExpression path error: 'ProposedEndTime' property not found on 'object' ''GanttChart' (Name='GanttChart')'. BindingExpression:Path=ProposedEndTime; DataItem='GanttChart' (Name='GanttChart'); target element is 'TextBlock' (Name='CustomMovingInfoPopup_ProposedEndTime'); target property is 'Text' (type 'String')
System.Windows.Data Error: 40 : BindingExpression path error: 'ProposedDuration' property not found on 'object' ''GanttChart' (Name='GanttChart')'. BindingExpression:Path=ProposedDuration; DataItem='GanttChart' (Name='GanttChart'); target element is 'TextBlock' (Name='CustomResizeInfoPopup_ProposedDuration'); target property is 'Text' (type 'String')
System.Windows.Data Error: 40 : BindingExpression path error: 'ProposedStart' property not found on 'object' ''GanttChart' (Name='GanttChart')'. BindingExpression:Path=ProposedStart; DataItem='GanttChart' (Name='GanttChart'); target element is 'TextBlock' (Name='CustomResizeInfoPopup_ProposedStart'); target property is 'Text' (type 'String')
System.Windows.Data Error: 40 : BindingExpression path error: 'ProposedEnd' property not found on 'object' ''GanttChart' (Name='GanttChart')'. BindingExpression:Path=ProposedEnd; DataItem='GanttChart' (Name='GanttChart'); target element is 'TextBlock' (Name='CustomResizeInfoPopup_ProposedEnd'); target property is 'Text' (type 'String')

Both controls are created in GanttChart_TemplateApplied:

Code: [Select]
private void GanttChart_TemplateApplied(object sender, EventArgs e)
{
    FlexyGanttMain.GanttChart.MovingInfoPopup = new CustomMovingInfoPopup();
    FlexyGanttMain.GanttChart.ResizeInfoPopup = new CustomResizeInfoPopup();
}

They look like this:

Code: [Select]
<Popup x:Class="[...]CustomMovingInfoPopup"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:p="clr-namespace:[...]"
             mc:Ignorable="d"
            Placement="Relative"
       >
[...]
    <ContentControl Style="{StaticResource ResourceKey=ToolTipStylePopup}" MinWidth="125" Height="Auto">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Name="CustomMovingInfoPopup_Start" Text="{p:Resources Name=Start}" HorizontalAlignment="Left" FontWeight="Bold" Margin="0,0,5,0"/>
            <TextBlock Name="CustomMovingInfoPopup_ProposedStartTime" Grid.Column="1" HorizontalAlignment="Right" Margin="0, 0, 0, 10" Text="{Binding ProposedStartTime, StringFormat=g}" />

            <TextBlock Name="CustomMovingInfoPopup_End" Grid.Row="1" Text="{p:Resources Name=End}" HorizontalAlignment="Left" FontWeight="Bold" Margin="0,0,5,0"/>
            <TextBlock Name="CustomMovingInfoPopup_ProposedEndTime" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Margin="0, 0, 0, 10" Text="{Binding ProposedEndTime, StringFormat=g}" />
        </Grid>
    </ContentControl>
</Popup>

However when moving a task in gantt the properties are evaluated correctly inside the popup. I guess that on startup the data context of the popup controls still might be set to GanttChart and only later is changed to FlexyTaskResizeTracker.

Could you please take a look into this, so we can avoid those binding errors?

Thanks!
Jan
Title: Re: Binding errors from custom popups
Post by: Rajagopal on December 09, 2020, 02:33:48 PM
Hi Jan, We are looking on this, will update you soon.
Title: Re: Binding errors from custom popups
Post by: tim on January 04, 2021, 12:44:32 PM
Any news on it?

Jan
Title: Re: Binding errors from custom popups
Post by: tim on January 25, 2021, 02:00:34 PM
Is there any update on this?

Jan
Title: Re: Binding errors from custom popups
Post by: Rajagopal on January 27, 2021, 11:14:56 AM
Jan,

We can't able to reproduce the issue. Kindly share the steps to reproduce.

Thanks,
Raja.