View Issue Details

IDProjectCategoryView StatusLast Update
0005180NoesisGUIC++ SDKpublic2026-11-05 21:21
ReporterESwart Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version4.0 
Target Version4.0.2Fixed in Version4.0.2 
Summary0005180: No way to query Behaviors field without allocating a BehaviorsCollection
Description

Currently when using Interaction::GetBehaviors(), this will create a BehaviorsCollection if there was not already one. It would be nice to have a method to either check if there already is an attached collection, or to have a getter that does not create the collection.

PlatformAny

Activities

sfernandez

sfernandez

2026-11-03 16:09

manager   ~0012848

We're thinking on adding the following methods:

/// Indicates if the specified element defines a collection of behaviors
static bool HasBehaviors(const DependencyObject* obj, BehaviorCollection*& behaviors);

/// Indicates if the specified element defines a collection of triggers
static bool HasTriggers(const DependencyObject* obj, TriggerBaseCollection*& triggers);

Would that solve your scenario?

ESwart

ESwart

2026-11-03 21:11

reporter   ~0012851

Yes it would!

ESwart

ESwart

2026-11-03 21:13

reporter   ~0012852

Or to clarify, would the second parameter here be optional? Or if not, would it simply set the pointer I pass in to nullptr if there is no collection?

sfernandez

sfernandez

2026-11-04 10:48

manager   ~0012859

The idea of the second parameter is just a minor optimization to get the collection if it is already set:

BehaviorCollection* behaviors = nullptr;
if (Interaction::HasBehaviors(obj, behaviors))
{
    // do something with 'behaviors' collection
}

We can also offer a simple HasBehaviors(obj) and then you can call GetBehaviors(objt) to get the collection, it won't make much difference.

ESwart

ESwart

2026-11-04 23:57

reporter   ~0012867

Ok sounds good! I'm not picky about the actual interface here, I just want to make sure that if the element doesn't have behaviors, then I have an option to not mutate its state

Issue History

Date Modified Username Field Change
2026-08-20 22:36 ESwart New Issue
2026-08-21 20:19 jsantos Assigned To => sfernandez
2026-08-21 20:19 jsantos Status new => assigned
2026-08-21 20:19 jsantos Target Version => 4.0.1
2026-08-21 20:19 jsantos Product Version => 4.0
2026-10-16 12:18 jsantos Target Version 4.0.1 => 4.0.2
2026-11-03 16:09 sfernandez Status assigned => feedback
2026-11-03 16:09 sfernandez Note Added: 0012848
2026-11-03 21:11 ESwart Note Added: 0012851
2026-11-03 21:11 ESwart Status feedback => assigned
2026-11-03 21:13 ESwart Note Added: 0012852
2026-11-04 10:48 sfernandez Status assigned => feedback
2026-11-04 10:48 sfernandez Note Added: 0012859
2026-11-04 23:57 ESwart Note Added: 0012867
2026-11-04 23:57 ESwart Status feedback => assigned
2026-11-05 21:21 sfernandez Status assigned => resolved
2026-11-05 21:21 sfernandez Resolution open => fixed
2026-11-05 21:21 sfernandez Fixed in Version => 4.0.2