FrancoisRecisio
Topic Author
Posts: 6
Joined: 06 Nov 2023, 12:07

DataEventTrigger never trigger in first "frame"

14 Aug 2024, 11:55

Hello!

I'm having trouble with DataEventTrigger, and I can't figure out if it's a bug or if I'm using them incorrectly.

I use a source object as data context in my code-behind class. Inside the source object, I have a list of elements of the same type. And within this type, I have an event defined.
struct Element final : public NotifierBase
{
	Noesis::EventHandler myEvent;

	NS_DECLARE_REFLECTION(Element, NotifierBase)
};
class ViewModel final: public Noesis::BaseComponent
{
public:
	Noesis::Ptr<Noesis::ObservableCollection<Element>> m_elements;

	NS_DECLARE_REFLECTION(ViewModel, BaseComponent)
};
To trigger the event, I do this:
Element* item = m_viewModel->m_elements->Get(0);
item->myEvent(item, Noesis::EventArgs::Empty);
<b:Interaction.Triggers>
	<noesis:DataEventTrigger Source="{Binding}" EventName="MyEvent">
		<b:ControlStoryboardAction Storyboard="{StaticResource MyAnim}" />
	</noesis:DataEventTrigger>
</b:Interaction.Triggers>
This works well... unless I create the element in the same call, or also if the element was created long before, but has never been displayed (as if the binding was not set up yet).

Do you have an idea? If needed I can make a simple code to reproduce this situation
 
User avatar
jsantos
Site Admin
Posts: 4063
Joined: 20 Jan 2012, 17:18
Contact:

Re: DataEventTrigger never trigger in first "frame"

19 Aug 2024, 12:36

Hello! This seems like a bug. Could you please file a ticket and, if possible, include a minimal reproducible code example?
 
FrancoisRecisio
Topic Author
Posts: 6
Joined: 06 Nov 2023, 12:07

Re: DataEventTrigger never trigger in first "frame"

19 Aug 2024, 15:34

I created a ticket here : https://www.noesisengine.com/bugs/view.php?id=3648
I hope you find it helpful!
 
User avatar
jsantos
Site Admin
Posts: 4063
Joined: 20 Jan 2012, 17:18
Contact:

Re: DataEventTrigger never trigger in first "frame"

21 Aug 2024, 12:50

Thank you!

Who is online

Users browsing this forum: No registered users and 14 guests