[Windows] Remove workaround for label text decorations#22650
Merged
rmarinho merged 3 commits intoMay 28, 2024
Conversation
Contributor
|
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. |
Contributor
Author
|
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;
}
}
}
} |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/azp run |
Contributor
Used to include an UITest. |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
Author
|
Thank you |
Contributor
|
/azp run |
jsuarezruiz
approved these changes
May 28, 2024
|
Azure Pipelines successfully started running 3 pipeline(s). |
Foda
approved these changes
May 28, 2024
Contributor
Foda
left a comment
There was a problem hiding this comment.
Great contribution! Thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainbranch: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