Skip to content

RelativePanel does not measure Correctly #794

@danwalmsley

Description

@danwalmsley

Describe the bug
A clear and concise description of what the bug is.

image

Top is UWP, bottom is WPF handycontrol version,

Since the recent fix we do not return the measured size or minimum size the content takes up.
This is because we are returning the maximum available size from MeasureOverride, regardless of Horizontal and VerticalAlignment.
To Reproduce

```
<handy:RelativePanel Background="Gray" HorizontalAlignment="Left" VerticalAlignment="Top">
    <Rectangle x:Name="RedRect" Fill="Red" Height="44" Width="44"/>
    <Rectangle x:Name="BlueRect" Fill="Blue"
           Height="44" Width="88"
           handy:RelativePanel.RightOf="RedRect" />

    <Rectangle x:Name="GreenRect" Fill="Green" 
           Height="44"
           handy:RelativePanel.Below="RedRect" 
           handy:RelativePanel.AlignLeftWith="RedRect" 
           handy:RelativePanel.AlignRightWith="BlueRect"/>
    <Rectangle Fill="Orange"
           handy:RelativePanel.Below="GreenRect" 
           handy:RelativePanel.AlignLeftWith="BlueRect" 
           handy:RelativePanel.AlignRightWithPanel="True"
           handy:RelativePanel.AlignBottomWithPanel="True"/>
</handy:RelativePanel>
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions