DataEventTrigger never trigger in first "frame"
Posted: 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.
To trigger the event, I do this:
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
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.
Code: Select all
struct Element final : public NotifierBase
{
Noesis::EventHandler myEvent;
NS_DECLARE_REFLECTION(Element, NotifierBase)
};Code: Select all
class ViewModel final: public Noesis::BaseComponent
{
public:
Noesis::Ptr<Noesis::ObservableCollection<Element>> m_elements;
NS_DECLARE_REFLECTION(ViewModel, BaseComponent)
};Code: Select all
Element* item = m_viewModel->m_elements->Get(0);
item->myEvent(item, Noesis::EventArgs::Empty);Code: Select all
<b:Interaction.Triggers>
<noesis:DataEventTrigger Source="{Binding}" EventName="MyEvent">
<b:ControlStoryboardAction Storyboard="{StaticResource MyAnim}" />
</noesis:DataEventTrigger>
</b:Interaction.Triggers>Do you have an idea? If needed I can make a simple code to reproduce this situation