From dc681166e38be8cb180a64abab9f6f080244378a Mon Sep 17 00:00:00 2001 From: Andrew KeepCoding Date: Tue, 31 Jan 2023 19:43:21 +0900 Subject: [PATCH] Fix Hyperlink not being localized when it has content already --- WinUI3Localizer/LocalizationActions.cs | 6 +++--- WinUI3Localizer/WinUI3Localizer.csproj | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/WinUI3Localizer/LocalizationActions.cs b/WinUI3Localizer/LocalizationActions.cs index 6ddaa92..c3e459a 100644 --- a/WinUI3Localizer/LocalizationActions.cs +++ b/WinUI3Localizer/LocalizationActions.cs @@ -1,4 +1,4 @@ -using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Documents; using System; using System.Collections.Generic; @@ -30,7 +30,7 @@ public record ActionItem(Type TargetType, Action Action); }), new ActionItem(typeof(Bold), arguments => { - if (arguments.DependencyObject is Hyperlink target && target.Inlines.Count is 0) + if (arguments.DependencyObject is Hyperlink target) { target.Inlines.Clear(); target.Inlines.Add(new Run() { Text = arguments.Value }); @@ -38,7 +38,7 @@ public record ActionItem(Type TargetType, Action Action); }), new ActionItem(typeof(Hyperlink), arguments => { - if (arguments.DependencyObject is Hyperlink target && target.Inlines.Count is 0) + if (arguments.DependencyObject is Hyperlink target) { target.Inlines.Clear(); target.Inlines.Add(new Run() { Text = arguments.Value }); diff --git a/WinUI3Localizer/WinUI3Localizer.csproj b/WinUI3Localizer/WinUI3Localizer.csproj index 2c7edf4..b44bdf3 100644 --- a/WinUI3Localizer/WinUI3Localizer.csproj +++ b/WinUI3Localizer/WinUI3Localizer.csproj @@ -29,6 +29,7 @@ WinUI3Localizer Copyright (c) Andrew KeepCoding 2023 Andrew KeepCoding + README.md @@ -37,7 +38,12 @@ + + + + +