Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RelativePanel 被错误实现 #1637

Open
SlimeNull opened this issue Aug 23, 2024 · 1 comment
Open

RelativePanel 被错误实现 #1637

SlimeNull opened this issue Aug 23, 2024 · 1 comment

Comments

@SlimeNull
Copy link

Describe the bug

  1. 不能正确 Measure 大小
  2. 布局在某些行为上与 WinUI3 不一致
  3. 编写 XAML 时, 预览不会更新

明明是居中, 它却占满了整个宽度, 明明有内容, 却没有被撑起来

image

同时指定靠左, 以及水平居中, 理论上它应该忽略其中一个设置, 但在这里, 它既不是在左边, 也不是在中间

image

Steps to reproduce the bug

示例代码:

<hc:RelativePanel Height="100">
    <Border x:Name="hfirstBD"
            hc:RelativePanel.AlignLeftWithPanel="True"
            hc:RelativePanel.AlignHorizontalCenterWithPanel="True"
            BorderBrush="Red"
            BorderThickness="2"
            Width="50"
            Height="50"/>
    <Border x:Name="hsecondBD"
            hc:RelativePanel.RightOf="hfirstBD"
            BorderBrush="Green"
            BorderThickness="2"
            Width="50"
            Height="30"/>
    <Border x:Name="hthirdBD" hc:RelativePanel.RightOf="hsecondBD"
            BorderBrush="#00a2ea"
            BorderThickness="2"
            Width="50"
            Height="60"/>
    <Border x:Name="hforthBD"
            hc:RelativePanel.Below="hfirstBD"
            BorderBrush="#9c4e9a"
            BorderThickness="2"
            Width="60"
            Height="55"/>
    <Border hc:RelativePanel.RightOf="hforthBD"
            hc:RelativePanel.Below="hthirdBD"
            BorderBrush="#ffca0a"
            BorderThickness="2"
            Width="76"
            Height="55"/>
</hc:RelativePanel>

Expected behavior

No response

Screenshots

No response

NuGet package version

None

IDE

Visual Studio 2022

Framework type

.Net 6.0

Windows version

Windows 11 (22000)

Additional context

nuget 版本 3.5.1 (截止到 20224/8/23, 该版本为最新版本)
框架使用 .NET8
操作系统 Windows11 23H2 22631.4037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@SlimeNull and others