My CustomGraphicsGroup disappears after confirming a messagebox

My CustomGraphicsGroup disappears after confirming a messagebox

nraynaud
Enthusiast Enthusiast
379 Views
2 Replies
Message 1 of 3

My CustomGraphicsGroup disappears after confirming a messagebox

nraynaud
Enthusiast
Enthusiast

Hi all, 

 

I might be misunderstanding CustomGraphicsGroup life cycle. I created a Command, when the command is created, I create a CustomGraphicsGroup and draw on it. But at various times my CustomGraphicsGroup disappears from the display.

 - if I confirm a messagebox()

 - if I change the visibility of a body

 - if I change the visibility of the origin (here is a demo: http://recordit.co/ussDOdkA6P the red lines are on the custom graphics)

Even if the graphics is not visually displayed, it's still in the collection of customGraphicsGroups, and its properties isVisible and isValid are still true.

 

There are no events for me to understand the expected life cycle, I am a bit puzzled. My intended behavior was that the graphics would be here until I remove it, and that I would add and remove objects from it to change its appearance, and delete it altogether when I'm done with it.

 

Thanks for your help.

 

Nicolas.

 

0 Likes
380 Views
2 Replies
Replies (2)
Message 2 of 3

nraynaud
Enthusiast
Enthusiast

Upon further investigation, my graphic group has been emptied, its count has fallen to zero after it became invisible.

I still don't know why.

 

Thanks for your help.

0 Likes
Message 3 of 3

nraynaud
Enthusiast
Enthusiast

After a bit of soul searching it's about the life cycle and transactions.

 

I did my display changes in the InputChanged event, but they have to go into the Preview event.

0 Likes