Catel: Preventing DataWindow from resizing automatically

68 Views Asked by At

I created a little software with 4 Tabs inside the DataWindow Control. Each Tab inherits a CustomControl. The problem is, that the window automatically resizes based on the content (In one tab there is list that needs more width and in another tab the list is way smaller).

I tried the "Custom Data Window Style". Didn't work.

Example:

<Application.Resources>
    <Style x:Key="DataWindowStyle" TargetType="{x:Type catel:DataWindow}">
        <Setter Property="MinHeight" Value="400"/>
        <Setter Property="Height" Value="500"/>
        <Setter Property="Width" Value="500"/>
        <Setter Property="MinWidth" Value="500"/>
        <Setter Property="WindowState" Value="Maximized"></Setter>
    </Style>
</Application.Resources>

I tried harcoded things. Didn't work either.

Is there any way in Catel to prevent this automatic resizing based on the content?

Some examples of the software (hole window sizes): Tab with big list

Tab with small list

1

There are 1 best solutions below

2
Geert van Horrik On BEST ANSWER

You can set SizeToContent to Manual.