UserControl Width is Nan while it's ActualWidth set to the Column it placed on
I have a UserControl, I do not set it's Width / Height, the UserControl has 2 TextBox inside a 开发者_Go百科StackPanel. when I place it in a Column where it's Width="Auto", the control stretches to fill the entire column, while the 2 TextBox maintain their Width (desire) I want to keep the Control Width to it's Content Width, how to I do that ?
HorizontalAlignment="Left"
This will keep the Control from stretching based on the container which it resides and instead will expand based on its contents if the Width
is set to Auto
.
MSDN provides an overview on Alignment, Margins, and Padding which may be of assistance.
精彩评论