Does anyone know if it's even possible to enter a line break into a WPF Wrap panel? It goes against what the wrap panel is for, so I'm not sure if it's possible.
And if it's not, is there any other WPF control that actually allows me to enter a line break into it and supports adding children (my own custom controls?)
public class NewLine : FrameworkElement
{
public NewLine()
{
Height = 0;
var binding = new Binding
{
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(WrapPanel), 1),
Path = new PropertyPath("ActualWidth")
};
BindingOperations.SetBinding(this, WidthProperty, binding);
}
}
<WrapPanel>
<TextBox Text="Text1"/>
<TextBox Text="Text2"/>
<my:NewLine/>
<TextBox Text="Text3"/>
<TextBox Text="Text4"/>
</WrapPanel>