View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001910 | NoesisGUI | Unity3D | public | 2021-01-27 01:55 | 2021-02-08 11:04 |
Reporter | samc | Assigned To | sfernandez | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.0.9 | ||||
Target Version | 3.0.10 | Fixed in Version | 3.0.10 | ||
Summary | 0001910: PropertyChangedTrigger bug? | ||||
Description | I was trying to use PropertyChangedTrigger, but it appears to be triggering immediately on initialization, even though the value in my data model hasn't changed. My setup looks something like this: <ei:PropertyChangedTrigger Binding="{Binding LowHealthEvent}"> // actions... </ei:PropertyChangedTrigger> Is that expected? Is there a way around this? I don't want the trigger to fire until I've actually changed the value. It seems to work fine in all cases except startup. I set a breakpoint to ensure I'm not accidently notifying that it changed and it seems ok. Suggestions? sam | ||||
Tags | No tags attached. | ||||
Platform | Any | ||||
The behavior is expected because PropertyChangedTrigger.Binding default value is null, so when the Binding gets resolved for the first time it sets a value there different than null and the trigger is invoked. But looking at the name of the bound property, "LowHealthEvent", it seems to me that you should use here an event trigger instead: <noesis:DataEventTrigger Source="{Binding}" EventName="LowHealth"> // actions... </noesis:DataEventTrigger> Just define an event in your data model as explained in the trigger doc and raise it whenever you want: https://www.noesisengine.com/docs/App.Interactivity._DataEventTrigger.html |
|
Ah, that makes sense. Thank you for explaining! There are some other reasons why I want to keep it as an integer rather than an event (can go into those; it is related to some tools that our designers are using so they could hook things up like this without engineer intervention..) thanks! sam |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-27 01:55 | samc | New Issue | |
2021-01-27 11:59 | jsantos | Target Version | => 3.0.10 |
2021-01-27 11:59 | jsantos | Description Updated | View Revisions |
2021-01-27 11:59 | jsantos | Assigned To | => sfernandez |
2021-01-27 11:59 | jsantos | Status | new => assigned |
2021-01-27 12:31 | sfernandez | Status | assigned => feedback |
2021-01-27 12:31 | sfernandez | Note Added: 0007001 | |
2021-01-27 12:32 | sfernandez | Note Edited: 0007001 | View Revisions |
2021-01-27 19:14 | samc | Note Added: 0007005 | |
2021-01-27 19:14 | samc | Status | feedback => assigned |
2021-02-05 18:06 | sfernandez | Status | assigned => resolved |
2021-02-05 18:06 | sfernandez | Resolution | open => fixed |
2021-02-05 18:06 | sfernandez | Fixed in Version | => 3.0.10 |