lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.33k stars 707 forks source link

Set FluentWindowSizeToContent="WidthAndHeight" will show white border. #1027

Open ShrlAlgo opened 5 months ago

ShrlAlgo commented 5 months ago

Describe the bug

Set FluentWindow SizeToContent="WidthAndHeight" will show white border.Resize the window by mouse , it will be displayed properly.

To Reproduce

Create a FluentWindow and set SizeToContent="WidthAndHeight".

Expected behavior

When the FluentWindow initialised, it can be displayed properly

Screenshots

image

OS version

Windows 11

.NET version

.Net Framework4.7.2

WPF-UI NuGet version

WPF-UI 3.0.3

Additional context

No response

liungkejin commented 1 month ago

I have the same problem!

liungkejin commented 1 month ago

I found solution in #22

First, copy the WindowStyle.xaml to your project.

Then delete those properties about width and height

        <Setter Property="Height" Value="600" />
        <Setter Property="MinHeight" Value="320" />
        <Setter Property="Width" Value="1100" />
        <Setter Property="MinWidth" Value="460" />

Finally, apply this style to your window

<ui:FluentWindow
...
        xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
        Style="{DynamicResource DefaultWindowStyle}">
...
</ui:FluentWindow>