From 5f3f4daf0de7ec421ae8c7ca9b22541de6cd9d69 Mon Sep 17 00:00:00 2001 From: wstaelens Date: Fri, 3 Nov 2023 15:18:39 +0100 Subject: [PATCH 1/2] Update NullableBoolConverter.cs --- .../System/Windows/NullableBoolConverter.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs index 8d79663fb0d..03f21bac831 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs @@ -57,15 +57,10 @@ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) /// TypeConverter.StandardValuesCollection public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { - if (_standardValues == null) - { - ArrayList list1 = new ArrayList(3); - list1.Add((bool?)true); - list1.Add((bool?)false); - list1.Add((bool?)null); - _standardValues = new TypeConverter.StandardValuesCollection(list1.ToArray()); - } - return _standardValues; + return _standardValues ??= new TypeConverter.StandardValuesCollection(new Nullable[] +{ + true, false, null +}); } /// From 08e3723690c1f765088d5b204a45bbe4c8c413b0 Mon Sep 17 00:00:00 2001 From: wstaelens Date: Wed, 29 Nov 2023 09:46:24 +0100 Subject: [PATCH 2/2] Update src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs Co-authored-by: ThomasGoulet73 <51839772+ThomasGoulet73@users.noreply.github.com> --- .../System/Windows/NullableBoolConverter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs index 03f21bac831..a56a34277a0 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/NullableBoolConverter.cs @@ -58,9 +58,9 @@ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { return _standardValues ??= new TypeConverter.StandardValuesCollection(new Nullable[] -{ - true, false, null -}); + { + true, false, null + }); } ///