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
Windows Build Number
Other Windows Build number
22621, 26058
App minimum and target SDK version
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.
Describe the bug
Just simplify create a
Segmentedand add more than 1 item to it. Then set your screen scaling to 125% or 150% in System Settings. And you'll get crashed withLayoutCycleException.Steps to reproduce
Expected behavior
The Segmented correctly layout.
Screenshots
No response
Code Platform
Windows Build Number
Other Windows Build number
22621, 26058
App minimum and target SDK version
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.