We have a few UI elements (Infragistics Ribbon Controls) where we wire Actions not by XAML but by code. We want to wire the action only temporarily.
What we do is:
and later we unwire it using
(i realize the second call to Message.SetAttach is superfluous).
This may be repeated for the same UI Element.
is never garbage collected. We don't keep any references to
. We keep a reference to
So, to investigate, we created an
whose lifecycle is 1:1 to
Now we use Message.SetAttach / Action.SetTarget on the
has a (temporary) reference to
. As soon as the reference to
is removed from
gets garbage collected.
Disclaimer: I'm not convinced that this is an issue with Caliburn.Micro, it could just as well be an issue with the Infragistics Controls.
However, i find myself a bit lost in terms of finding the cause.
Can you give me any pointers on where i could look next?
correct for de-attaching an action?
We are using Caliburn.Micro.1.5.1
Thank you for your time.