View Issue Details

IDProjectCategoryView StatusLast Update
0001476NoesisGUIC++ SDKpublic2021-11-15 10:45
ReportersfernandezAssigned Tosfernandez 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.2.2 
Target Version3.1.2Fixed in Version3.1.2 
Summary0001476: Freezable objects inside templates are not correctly registered in the NameScope
DescriptionWhen a Freezable object inside a template has a name and the template gets applied to a control, the object registered in the NameScope does not correspond to the one that is created for that control visual tree.

For example, in the following template, the DataTrigger is not able to find the correct "DropItem" behavior:

<DataTemplate>
    <Grid>
        <Border x:Name="DragBorder" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
            <i:Interaction.Behaviors>
                <LL:DropItemBehavior x:Name="DropItem"/>
            </i:Interaction.Behaviors>
        </Border>
    </Border>
    <DataTemplate.Triggers>
        <DataTrigger Binding="{Binding IsDragOver, ElementName=DropItem}" Value="True">
            <Setter Property="Background" Value="DodgerBlue" TargetName="DragBorder"/>
        </DataTrigger>
    </DataTemplate.Triggers>
</DataTemplate>
TagsNo tags attached.
PlatformAny

Relationships

related to 0002187 resolvedsfernandez Cannot animate RenderTransform: 'root element is frozen' 

Activities

sfernandez

sfernandez

2021-05-24 20:54

manager   ~0007256

The current workaround is by accesing the freezable object through its owner FrameworkElement. So the previous xaml should work like this:
<DataTemplate>
    <Grid>
        <Border x:Name="DragBorder" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
            <i:Interaction.Behaviors>
                <LL:DropItemBehavior x:Name="DropItem"/>
            </i:Interaction.Behaviors>
        </Border>
    </Border>
    <DataTemplate.Triggers>
        <DataTrigger Binding="{Binding (i:Interaction.Behaviors)[0].IsDragOver, ElementName=DragBorder}" Value="True">
            <Setter Property="Background" Value="DodgerBlue" TargetName="DragBorder"/>
        </DataTrigger>
    </DataTemplate.Triggers>
</DataTemplate>

Issue History

Date Modified Username Field Change
2019-05-24 18:52 sfernandez New Issue
2019-05-24 18:52 sfernandez Assigned To => sfernandez
2019-05-24 18:52 sfernandez Status new => assigned
2019-05-24 18:52 sfernandez Target Version => 2.2.3
2019-06-18 16:59 sfernandez Target Version 2.2.3 => 2.2.4
2019-08-07 16:36 sfernandez Target Version 2.2.4 => 2.3.0
2021-05-24 20:54 sfernandez Note Added: 0007256
2021-09-23 11:19 sfernandez Target Version => 3.1.2
2021-11-15 10:17 sfernandez Relationship added related to 0002187
2021-11-15 10:45 sfernandez Status assigned => resolved
2021-11-15 10:45 sfernandez Resolution open => fixed
2021-11-15 10:45 sfernandez Fixed in Version => 3.1.2