-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Remove workaround for label text decorations #22650
[Windows] Remove workaround for label text decorations #22650
Conversation
Hey there @MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
I have verified that the code still works using sandbox (branch, MartyIX@b9c7f17) which simply does:
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.MainPage"
xmlns:local="clr-namespace:Maui.Controls.Sample">
<VerticalStackLayout>
<Label x:Name="myLabel" Text="This is the text"/>
<Button Text="Click me" Clicked="Button_Clicked"/>
</VerticalStackLayout>
</ContentPage>
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample
{
public partial class MainPage : ContentPage
{
private int i = 0;
public MainPage()
{
InitializeComponent();
}
private void Button_Clicked(object sender, EventArgs e)
{
i++;
if (i % 2 == 1)
{
myLabel.TextDecorations = TextDecorations.Underline | TextDecorations.Strikethrough;
}
else
{
myLabel.TextDecorations = TextDecorations.None;
}
}
}
} |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Used to include an UITest. |
Azure Pipelines successfully started running 3 pipeline(s). |
Thank you |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution! Thank you!
Description of Change
According to microsoft/microsoft-ui-xaml#1093 (comment) the issue microsoft/microsoft-ui-xaml#1093 should be fixed in WinUI 3 in WinAppSDK 1.4. Removed code was added in #726 which was three years ago. The issue was fixed last year.
Performance impact
Two measurements for
main
branch:Two measurements for the PR branch:
-> 98% improvement. It's really big so that's why I did second measurements but it appears that it really has big impact (on all labels). Anyway, even the measurements were wrong, from performance point of view doing less takes less time.
Issues Fixed
Contributes to #21787