I have an items presenter that contains expanders. (In order to debug the events, I have a custom items presenter class with an OnChildDesiredSizeChanged event that does nothing more than base.OnChildDesiredEvent. That way I can debug what I
am really working on.
I have a custom expander class that I want to have change its desired size when it is collapsed. The frustrating thing about expander is that they will update a desired size when you expand, but not when you collapse it. So I have a custom expander
class with my own on collapse event. The idea is to remeasure the expander. I had thought that doing so would cause it to notify parents that its desired size changed like what already happens when we expand.
So here is the collapse handler in my custom expander.
protected override void OnCollapsed()
UIElement hdr = Header as UIElement;
if (hdr != null)
Debugging I can see the desired size get smaller before and after I call measure. So my desired size propert
View Complete Post