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:
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ResizeMode="CanResizeWithGrip"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBox Name="textBox1" VerticalAlignment="Top" TextWrapping="Wrap" HorizontalAlignment="Stretch" />
</Grid>
</
Window>
But I cannot get the same functionality with a tool window. I tried:
window.Float((
Size) arg);
var baseWindow = Window.GetWindow(window);
if (baseWindow != null)
{
baseWindow.ResizeMode = ResizeMode.CanResizeWithGrip;
}
But that did not help at all.
Is there a way?