-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
Describe the bug
Just simplify create a Segmented and add more than 1 item to it. Then set your screen scaling to 125% or 150% in System Settings. And you'll get crashed with LayoutCycleException.
<cwc:Segmented
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"
xmlns:cwc="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Style="{StaticResource DefaultSegmentedStyle}"
mc:Ignorable="d">
<cwc:SegmentedItem Content="Test1" Icon="{cw:FontIcon Glyph=}"/>
<cwc:SegmentedItem Content="Test2" Icon="{cw:FontIcon Glyph=}"/>
</cwc:Segmented>Steps to reproduce
1. Set your screen scale to 125% or 150% or etc except 100%.
2. Create a new WinUI 3 project and paste the XAML sample from above as the content of the page.
Expected behavior
The Segmented correctly layout.
Screenshots
No response
Code Platform
- UWP
- WinAppSDK / WinUI 3
- Web Assembly (WASM)
- Android
- iOS
- MacOS
- Linux / GTK
Windows Build Number
- Windows 10 1809 (Build 17763)
- Windows 10 1903 (Build 18362)
- Windows 10 1909 (Build 18363)
- Windows 10 2004 (Build 19041)
- Windows 10 20H2 (Build 19042)
- Windows 10 21H1 (Build 19043)
- Windows 10 21H2 (Build 19044)
- Windows 10 22H2 (Build 19045)
- Windows 11 21H2 (Build 22000)
- Other (specify)
Other Windows Build number
22621, 26058
App minimum and target SDK version
- Windows 10, version 1809 (Build 17763)
- Windows 10, version 1903 (Build 18362)
- Windows 10, version 1909 (Build 18363)
- Windows 10, version 2004 (Build 19041)
- Windows 10, version 2104 (Build 20348)
- Windows 11, version 22H2 (Build 22000)
- Other (specify)
Other SDK version
minimum: 19045, target: 22621
Visual Studio Version
2022
Visual Studio Build Number
17.9.2
Device form factor
Desktop
Additional context
Through debugging information I found that in fact we are always struggling with a width difference of only 2. Usually at this point we already have a nearly perfect measured height, so we should just set the final width directly rather than re-measure.
Help us help you
Yes, I'd like to be assigned to work on this item.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done