I have a ToolWindow. It countains a UserControl which then contains a Textbox. I want the text to wrap in the textbox but I do not want to set the width of the textbox. The textbox should stretch and shrink when user resize the toolwindow.
I was able to havethis functionality easily using a WPF window:
Title="MainWindow" Height="350" Width="525">
<TextBox Name="textBox1" VerticalAlignment="Top" TextWrapping="Wrap" HorizontalAlignment="Stretch" />
But I cannot get the same functionality with a tool window. I tried:
var baseWindow = Window.GetWindow(window);
if (baseWindow != null)
baseWindow.ResizeMode = ResizeMode.CanResizeWithGrip;
But that did not help at all.
Is there a way?