Open michael-hawker opened 1 year ago
@kmgallahan ah interesting. I don't think we have good coverage/implementation/expectations in most panels for supporting hidden children (either at initialization or dynamically).
Would certainly be something to audit across the panels and add more tests for. I was hoping we'd be able to do some of that leading into release, but we ran out of time.
If you have a specific scenario/example that's failing, please raise a new issue and feel free to submit a fix, if you have one. Thanks!
A common scenario would be starting an app with layout management similar to that found in Visual Studio. On launch, some panels may be hidden, to be later shown via toggles or triggers.
Without debugging or prior knowledge, looking at the source I see children are processed by index:
Not sure why or if child index values change as their visibility changes. Perhaps starting with Visibility="Collapsed"
means they only get added to the UIElementCollection once visible?
If that's the case then we'd need to get the children by XAML order... not sure how to do that.
@michael-hawker
It appears that the current implementation of DockPanel does not process children with
Visiblity = Collapsed
during initialization, meaning when they become visible they are added to the DockPanel in an unexpected order.Can you confirm if this is the desired behavior here?