0
votes

I guess I am curious because I found an infinite loop in which the child was being sized larger and then the parent got larger repeatedly and fixed it. However, I'm wondering if perhaps it is a better idea to just override measure and find the parent's size and then return the desiredsize instead. By not changing Width or Height, I eliminate the possibility of creating an endless loop. On the flip side, by not binding the width in xaml, how the width of the control is being determined is now hidden in code-behind.

1

1 Answers

2
votes

You could just use HorizontalAlignment="Stretch"