View Issue Details

IDProjectCategoryView StatusLast Update
0001941NoesisGUIUnitypublic2021-09-02 19:53
Reportersfernandez Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionopen 
Product Version3.0.11 
Target Version3.1Fixed in Version3.1.0 
Summary0001941: Interactivity DataTrigger not behaving exactly as WPF
Description

WPF's DataTrigger does not evaluate bindings when it gets attached to the associated object, so if DataContext is set before attaching, it won't invoke its actions even if condition is fulfilled.
On the other hand Noesis DataTrigger, when trigger is attached, it evaluates the bindings again so it is able to invoke actions if condition is fulfilled, but this is incorrect compared to WPF.

Consider creating a new trigger that evaluates when attached, something like an ImmediateDataTrigger in case anyone needs that behavior.

PlatformAny

Activities

Faerdan

Faerdan

2021-08-31 11:05

reporter   ~0007394

I was the original reporter of this issue, however it isn't really an issue.

The reason WPF's DataTrigger seemed to be different was that Noesis.GUI.Extensions was referencing an unofficial Interactivity/Behaviours Nuget package, which was built against code from 2012.

The DataTrigger in Microsoft's official Microsoft.Xaml.Behaviors.Wpf Nuget package (https://github.com/microsoft/XamlBehaviorsWpf/blob/302a27da21749b330a8b5807bc69f62f4372ff94/src/Microsoft.Xaml.Behaviors/Core/DataTrigger.cs) does invoke the evaluation the bindings in the OnAttached method:

    protected override void OnAttached()
    {
        base.OnAttached();

        //fixes issue #11. We want to evaluate the binding's initial value when the element is first loaded
        if (AssociatedObject is FrameworkElement element)
        {
            element.Loaded += OnElementLoaded;
        }
    }
sfernandez

sfernandez

2021-09-02 19:53

manager   ~0007402

Last edited: 2021-09-02 19:53

With the latest version of our extensions (3.0.8) we moved to the official Microsoft.Behaviors.Wpf so both implementations should match.

Issue History

Date Modified Username Field Change
2021-03-15 18:37 sfernandez New Issue
2021-03-15 18:38 sfernandez Assigned To => sfernandez
2021-03-15 18:38 sfernandez Status new => assigned
2021-03-15 18:38 sfernandez Product Version 3.0.10 => 3.0.11
2021-03-15 18:38 sfernandez Target Version => 3.0.12
2021-05-04 02:41 jsantos Target Version 3.0.12 => 3.0.13
2021-08-31 11:05 Faerdan Note Added: 0007394
2021-09-02 19:53 sfernandez Status assigned => resolved
2021-09-02 19:53 sfernandez Fixed in Version => 3.1.0
2021-09-02 19:53 sfernandez Target Version 3.0.13 => 3.1
2021-09-02 19:53 sfernandez Note Added: 0007402
2021-09-02 19:53 sfernandez Note Edited: 0007402
2025-10-10 13:29 jsantos Category Unity3D => Unity