I am getting \"Value does not fall within the expected range exception\" when adding
children to stack panel. This happens even when myStackPanel.Children.Count = 0 just be
Double check the stack trace. Sometimes the line number is off but it's possible that the exception is occurring in the setter for the Name property. It must follow the normal rules for an identifier.