I have a WrapPanel inside a Window. In this case the controls inside the WrapPanel wrap when I manually resize the window.
However, the initial width is too much. I have put all controls in a horizontal wrap panel.
To make an initial width, I tried to set the Window to a width of 1000 (first try) and the wrappanel to 1000 (second try), but in this case the wrapping does not work anymore, only the 'border' (or padding) of the whole window is decreased or increased.
How can I change the width (and height) of the window in such a way that when I manually resize, the wrapping is taken into account.
Below a part of the XAML code:
Window x:Class="PcgTools.ListGenerator.ListGeneratorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Binding ListGenerator, Source={StaticResource LocStrings}}" ResizeMode="CanResizeWithGrip"
Icon="/PcgTools;component/Gui/pcgtools.ico" Loaded="Window_Loaded" Closed="Window_Closed"
ShowInTaskbar="True" WindowStartupLocation="CenterOwner" SizeToContent="WidthAndHeight">
<WrapPanel Name="wrapPanel" Margin="4" Orientation="Horizontal">