From d67afe36916733dcbd87ead53af16597955d0a6d Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:11:31 -0700 Subject: [PATCH 1/7] Update to .NET 8 --- Directory.Build.props | 6 +++--- azure-pipelines.yml | 6 +++--- global.json | 8 +++---- ...CommunityToolkit.Maui.Markup.Sample.csproj | 2 +- .../BindingHelpers.cs | 21 ++++++++++++------- ...munityToolkit.Maui.Markup.UnitTests.csproj | 2 +- .../CommunityToolkit.Maui.Markup.csproj | 6 +++++- 7 files changed, 30 insertions(+), 21 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2baee69e..67831577 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,9 @@  - - false - latest + net8.0 + 8.0.0-rc.2.9511 + preview enable enable NETSDK1023 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 900723a7..e057849b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,9 +1,9 @@ variables: - CurrentSemanticVersionBase: '1.0.0' + CurrentSemanticVersionBase: '99.0.0' PreviewNumber: $[counter(variables['CurrentSemanticVersionBase'], 1001)] CurrentSemanticVersion: '$(CurrentSemanticVersionBase)-preview$(PreviewNumber)' NugetPackageVersion: '$(CurrentSemanticVersion)' - NET_VERSION: '7.0.x' + NET_VERSION: '8.0.x' RunPoliCheck: false PathToLibrarySolution: 'src/CommunityToolkit.Maui.Markup.sln' PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Markup.Sample.sln' @@ -11,7 +11,7 @@ variables: PathToCommunityToolkitSampleCsproj: 'samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj' PathToCommunityToolkitUnitTestCsproj: 'src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj' PathToCommunityToolkitSourceGeneratorsCsproj: 'src/CommunityToolkit.Maui.Markup.SourceGenerators/CommunityToolkit.Maui.Markup.SourceGenerators.csproj' - XcodeVersion: '14.3.1' + XcodeVersion: '15.0.1' ShouldCheckDependencies: true trigger: diff --git a/global.json b/global.json index 9c9b66dc..4a7386d5 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "7.0.100", - "rollForward": "latestMajor", - "allowPrerelease": false + "version": "8.0.100-rc.2.23502.2", + "rollForward": "latestFeature", + "allowPrerelease": true } -} +} \ No newline at end of file diff --git a/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj b/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj index 0ef0815b..5ed7e78f 100644 --- a/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj +++ b/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj @@ -1,7 +1,7 @@ - net7.0-android;net7.0-ios;net7.0-maccatalyst + $(NetVersion)-android;$(NetVersion)-ios;$(NetVersion)-maccatalyst $(TargetFrameworks);net7.0-windows10.0.19041.0 $(TargetFrameworks);net7.0-tizen Exe diff --git a/src/CommunityToolkit.Maui.Markup.UnitTests/BindingHelpers.cs b/src/CommunityToolkit.Maui.Markup.UnitTests/BindingHelpers.cs index 76c96fe8..69be3ab8 100644 --- a/src/CommunityToolkit.Maui.Markup.UnitTests/BindingHelpers.cs +++ b/src/CommunityToolkit.Maui.Markup.UnitTests/BindingHelpers.cs @@ -9,7 +9,7 @@ namespace CommunityToolkit.Maui.Markup.UnitTests; static class BindingHelpers { static MethodInfo? getContextMethodInfo; - static FieldInfo? bindingFieldInfo; + static FieldInfo? bindingsFieldInfo; internal static void AssertBindingExists( BindableObject bindable, @@ -146,8 +146,8 @@ internal static void AssertBindingExists( TDest? fallbackValue = default, Action? assertConvert = null) => AssertBindingExists( - bindable, targetProperty, bindings, converter, null, mode, assertConverterInstanceIsAnyNotNull, - stringFormat, targetNullValue, fallbackValue, assertConvert); + bindable, targetProperty, bindings, converter, null, mode, assertConverterInstanceIsAnyNotNull, + stringFormat, targetNullValue, fallbackValue, assertConvert); internal static void AssertBindingExists( BindableObject bindable, @@ -199,21 +199,26 @@ internal static void AssertBindingExists( { getContextMethodInfo ??= typeof(BindableObject).GetMethod("GetContext", BindingFlags.NonPublic | BindingFlags.Instance); - var context = getContextMethodInfo?.Invoke(bindable, new object[] { property }); + var context = getContextMethodInfo?.Invoke(bindable, new object[] + { + property + }); if (context is null) { return null; } - bindingFieldInfo ??= context?.GetType().GetField("Binding"); + bindingsFieldInfo ??= context.GetType().GetField("Bindings"); + + var bindingsList = bindingsFieldInfo?.GetValue(context) as SortedList; - return bindingFieldInfo?.GetValue(context) as TBinding; + return (TBinding?)bindingsList?.First().Value; } internal static IValueConverter AssertConvert(this IValueConverter converter, TValue value, object? parameter, TConvertedValue expectedConvertedValue, bool twoWay = false, bool backOnly = false, CultureInfo? culture = null) { - Assert.That(converter.Convert(value, typeof(object), parameter, culture), Is.EqualTo(backOnly ? default : expectedConvertedValue)); - Assert.That(converter.ConvertBack(expectedConvertedValue, typeof(object), parameter, culture), Is.EqualTo(twoWay || backOnly ? value : default(TValue))); + Assert.That(converter.Convert(value, typeof(object), parameter, culture ?? CultureInfo.InvariantCulture), Is.EqualTo(backOnly ? default : expectedConvertedValue)); + Assert.That(converter.ConvertBack(expectedConvertedValue, typeof(object), parameter, culture ?? CultureInfo.InvariantCulture), Is.EqualTo(twoWay || backOnly ? value : default(TValue))); return converter; } diff --git a/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj b/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj index aa8c93c1..c3500142 100644 --- a/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj +++ b/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj @@ -1,7 +1,7 @@ - net7.0 + $(NetVersion) true false true diff --git a/src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj b/src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj index 18feeeb0..57f795ff 100644 --- a/src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj +++ b/src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj @@ -1,7 +1,7 @@  - net7.0 + $(NetVersion) true enable true @@ -40,6 +40,10 @@ + + + + From c33918788e43ff2b19f67d8750b404b38e6115cc Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:13:13 -0700 Subject: [PATCH 2/7] Update CommunityToolkit.Maui.Markup.Sample.csproj --- .../CommunityToolkit.Maui.Markup.Sample.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj b/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj index 5ed7e78f..3e0e6070 100644 --- a/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj +++ b/samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj @@ -2,8 +2,8 @@ $(NetVersion)-android;$(NetVersion)-ios;$(NetVersion)-maccatalyst - $(TargetFrameworks);net7.0-windows10.0.19041.0 - $(TargetFrameworks);net7.0-tizen + $(TargetFrameworks);$(NetVersion)-windows10.0.19041.0 + $(TargetFrameworks);$(NetVersion)-tizen Exe CommunityToolkit.Maui.Markup.Sample true From baa15a6606aa03c1a4c357f4ebddc1a34e022744 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:16:18 -0700 Subject: [PATCH 3/7] Update azure-pipelines.yml --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e057849b..4f2d9424 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -84,6 +84,7 @@ jobs: inputs: packageType: 'sdk' version: '$(NET_VERSION)' + includePreviewVersions: true - task: CmdLine@2 displayName: 'Install .NET MAUI Workload' From bec763ec094deb005dfc8c270cf61004ff47c39e Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:33:11 -0700 Subject: [PATCH 4/7] Obsolete Click Gesture Reccognizers --- Directory.Build.props | 1 + .../CommunityToolkit.Maui.Markup.UnitTests.csproj | 1 + .../GesturesExtensionsTests.cs | 7 +++++++ src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs | 2 ++ 4 files changed, 11 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 67831577..d53459be 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,7 @@ enable enable NETSDK1023 + true true false true diff --git a/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj b/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj index c3500142..563a6077 100644 --- a/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj +++ b/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj @@ -6,6 +6,7 @@ false true $(BaseIntermediateOutputPath)\GF + CS0618 diff --git a/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs b/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs index 7128e3e8..8db37da2 100644 --- a/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs +++ b/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs @@ -8,6 +8,7 @@ namespace CommunityToolkit.Maui.Markup.UnitTests; class GesturesExtensionsTests : BaseMarkupTestFixture where TGestureElement : View, IGestureRecognizers, new() { [Test] + [Obsolete($"{nameof(ClickGesture)} is now obsolete")] public void BindClickGestureDefaults() { var gestureElement = new TGestureElement(); @@ -20,6 +21,7 @@ public void BindClickGestureDefaults() } [Test] + [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] public void BindClickGesturePositionalParameters() { const int numberOfClicks = 2; @@ -68,6 +70,7 @@ public void BindTapGesturePositionalParameters() } [Test] + [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] public void ClickGesture() { const int numberOfClicks = 2; @@ -216,6 +219,7 @@ public void SupportDerivedFromLabel() // A View class GesturesExtensionsTypedBindingsTests : BaseMarkupTestFixture where TGestureElement : View, IGestureRecognizers, new() { [Test] + [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] public void BindClickGestureDefaults() { var gestureElement = new TGestureElement @@ -231,6 +235,7 @@ public void BindClickGestureDefaults() } [Test] + [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] public void BindClickGestureDefaultsWithNestedBindings() { var guid = Guid.NewGuid(); @@ -255,6 +260,7 @@ public void BindClickGestureDefaultsWithNestedBindings() } [Test] + [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] public void BindClickGesturePositionalParameters() { const int numberOfClicks = 2; @@ -281,6 +287,7 @@ public void BindClickGesturePositionalParameters() [Test] + [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] public void BindClickGesturePositionalParametersWithNestedBindings() { const int numberOfClicks = 2; diff --git a/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs b/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs index f9464162..8b3e7b4b 100644 --- a/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs +++ b/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs @@ -15,6 +15,7 @@ public static partial class GesturesExtensions /// Binding source for Command Binding /// Total number of clicks required to trigger /// + [Obsolete($"{nameof(BindClickGesture)} is deprecated; please use ${nameof(BindTapGesture)} instead.")] public static TGestureElement BindClickGesture(this TGestureElement gestureElement, string commandPath, object? commandSource = null, @@ -76,6 +77,7 @@ public static TGestureElement BindTapGesture(this TGestureEleme /// invoked once threshold is reached /// Total number of clicks required to trigger /// + [Obsolete($"{nameof(ClickGesture)} is deprecated; please use ${nameof(TapGesture)} instead.")] public static TGestureElement ClickGesture(this TGestureElement gestureElement, Action onClicked, int? numberOfClicksRequired = null) where TGestureElement : IGestureRecognizers From 99ae603deb38014db13925eaa26dfd4ed0beae02 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:43:04 -0700 Subject: [PATCH 5/7] Mark all `ClickGesture` Methods Obsolete --- .../CommunityToolkit.Maui.Markup.UnitTests.csproj | 1 - .../GesturesExtensionsTests.cs | 15 ++++++++------- .../DefaultBindableProperties.cs | 2 -- .../GesturesExtensions.TypedBindings.cs | 4 ++++ .../GesturesExtensions.cs | 1 + 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj b/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj index 563a6077..c3500142 100644 --- a/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj +++ b/src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj @@ -6,7 +6,6 @@ false true $(BaseIntermediateOutputPath)\GF - CS0618 diff --git a/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs b/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs index 8db37da2..35213839 100644 --- a/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs +++ b/src/CommunityToolkit.Maui.Markup.UnitTests/GesturesExtensionsTests.cs @@ -8,7 +8,7 @@ namespace CommunityToolkit.Maui.Markup.UnitTests; class GesturesExtensionsTests : BaseMarkupTestFixture where TGestureElement : View, IGestureRecognizers, new() { [Test] - [Obsolete($"{nameof(ClickGesture)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void BindClickGestureDefaults() { var gestureElement = new TGestureElement(); @@ -21,7 +21,7 @@ public void BindClickGestureDefaults() } [Test] - [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void BindClickGesturePositionalParameters() { const int numberOfClicks = 2; @@ -70,7 +70,7 @@ public void BindTapGesturePositionalParameters() } [Test] - [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void ClickGesture() { const int numberOfClicks = 2; @@ -219,7 +219,7 @@ public void SupportDerivedFromLabel() // A View class GesturesExtensionsTypedBindingsTests : BaseMarkupTestFixture where TGestureElement : View, IGestureRecognizers, new() { [Test] - [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void BindClickGestureDefaults() { var gestureElement = new TGestureElement @@ -235,7 +235,7 @@ public void BindClickGestureDefaults() } [Test] - [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void BindClickGestureDefaultsWithNestedBindings() { var guid = Guid.NewGuid(); @@ -260,7 +260,7 @@ public void BindClickGestureDefaultsWithNestedBindings() } [Test] - [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void BindClickGesturePositionalParameters() { const int numberOfClicks = 2; @@ -287,7 +287,7 @@ public void BindClickGesturePositionalParameters() [Test] - [Obsolete($"{nameof(ClickGestureRecognizer)} is now obsolete")] + [Obsolete($"ClickGestureRecognizer is now obsolete")] public void BindClickGesturePositionalParametersWithNestedBindings() { const int numberOfClicks = 2; @@ -543,6 +543,7 @@ public void BindSwipeGesturePositionalParametersWithNestedBindings() } [Test] + [Obsolete] public void MultipleGestureBindings() { var gestureElement = new TGestureElement diff --git a/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs b/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs index 7f11ef6a..7f503a97 100644 --- a/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs +++ b/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs @@ -18,7 +18,6 @@ public static class DefaultBindableProperties { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(Button)}", Button.CommandProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(CarouselPage)}", Page.TitleProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(CheckBox)}", CheckBox.IsCheckedProperty }, - { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ClickGestureRecognizer)}", ClickGestureRecognizer.CommandProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(CollectionView)}", CollectionView.ItemsSourceProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ContentPage)}", Page.TitleProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ContentPresenter)}", ContentPresenter.ContentProperty }, @@ -85,7 +84,6 @@ public static class DefaultBindableProperties { // Key: full type name of BindableObject, Value: command property and corresponding commandParameter property { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(Button)}", (Button.CommandProperty, Button.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(TextCell)}", (TextCell.CommandProperty, TextCell.CommandParameterProperty) }, - { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ClickGestureRecognizer)}", (ClickGestureRecognizer.CommandProperty, ClickGestureRecognizer.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ImageButton)}", (ImageButton.CommandProperty, ImageButton.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(MenuItem)}", (MenuItem.CommandProperty, MenuItem.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(RefreshView)}", (RefreshView.CommandProperty, RefreshView.CommandParameterProperty) }, diff --git a/src/CommunityToolkit.Maui.Markup/GesturesExtensions.TypedBindings.cs b/src/CommunityToolkit.Maui.Markup/GesturesExtensions.TypedBindings.cs index a982ea83..a4c8ff2b 100644 --- a/src/CommunityToolkit.Maui.Markup/GesturesExtensions.TypedBindings.cs +++ b/src/CommunityToolkit.Maui.Markup/GesturesExtensions.TypedBindings.cs @@ -6,6 +6,7 @@ namespace CommunityToolkit.Maui.Markup; public static partial class GesturesExtensions { /// Add a and bind to its Command + [Obsolete($"{nameof(BindClickGesture)} is deprecated; please use ${nameof(BindTapGesture)} instead.")] public static TGestureElement BindClickGesture( this TGestureElement gestureElement, Expression> getter, @@ -24,6 +25,7 @@ public static TGestureElement BindClickGestureAdd a and bind to its Command and (optionally) CommandParameter properties + [Obsolete($"{nameof(BindClickGesture)} is deprecated; please use ${nameof(BindTapGesture)} instead.")] public static TGestureElement BindClickGesture( this TGestureElement gestureElement, Expression> getter, @@ -65,6 +67,7 @@ public static TGestureElement BindClickGestureAdd a and bind to its Command + [Obsolete($"{nameof(BindClickGesture)} is deprecated; please use ${nameof(BindTapGesture)} instead.")] public static TGestureElement BindClickGesture( this TGestureElement gestureElement, Func getter, @@ -84,6 +87,7 @@ public static TGestureElement BindClickGestureAdd a and bind to its Command and (optionally) CommandParameter properties + [Obsolete($"{nameof(BindClickGesture)} is deprecated; please use ${nameof(BindTapGesture)} instead.")] public static TGestureElement BindClickGesture( this TGestureElement gestureElement, Func getter, diff --git a/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs b/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs index 8b3e7b4b..32c037d0 100644 --- a/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs +++ b/src/CommunityToolkit.Maui.Markup/GesturesExtensions.cs @@ -207,6 +207,7 @@ public static TGestureElement TapGesture(this TGestureElement g return gestureElement; } + [Obsolete($"{nameof(BindClickGesture)} is deprecated; please use ${nameof(BindTapGesture)} instead.")] static TGestureElement ConfigureClickGesture(this TGestureElement gestureElement, ClickGestureRecognizer clickGesture, int? numberOfClicksRequired = null) where TGestureElement : IGestureRecognizers From 8b005139a233337c893a07c0ade1d48bc4dff27b Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:56:59 -0700 Subject: [PATCH 6/7] Update DefaultBindableProperties.cs --- .../DefaultBindableProperties.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs b/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs index 7f503a97..b00f3ab0 100644 --- a/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs +++ b/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs @@ -18,6 +18,9 @@ public static class DefaultBindableProperties { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(Button)}", Button.CommandProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(CarouselPage)}", Page.TitleProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(CheckBox)}", CheckBox.IsCheckedProperty }, +#pragma warning disable CS0618 + { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ClickGestureRecognizer)}", ClickGestureRecognizer.CommandProperty }, +#pragma warning disable CS0618 { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(CollectionView)}", CollectionView.ItemsSourceProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ContentPage)}", Page.TitleProperty }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ContentPresenter)}", ContentPresenter.ContentProperty }, @@ -82,6 +85,9 @@ public static class DefaultBindableProperties static readonly Dictionary bindableObjectTypeDefaultCommandAndParameterProperties = new() { // Key: full type name of BindableObject, Value: command property and corresponding commandParameter property +#pragma warning disable CS0618 + { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ClickGestureRecognizer)}", (ClickGestureRecognizer.CommandProperty, ClickGestureRecognizer.CommandParameterProperty) }, +#pragma warning restore CS0618 { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(Button)}", (Button.CommandProperty, Button.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(TextCell)}", (TextCell.CommandProperty, TextCell.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ImageButton)}", (ImageButton.CommandProperty, ImageButton.CommandParameterProperty) }, From c086184a7994f1a1bd47da15c7978f86904c9680 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:57:58 -0700 Subject: [PATCH 7/7] Update DefaultBindableProperties.cs --- src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs b/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs index b00f3ab0..f787311c 100644 --- a/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs +++ b/src/CommunityToolkit.Maui.Markup/DefaultBindableProperties.cs @@ -85,11 +85,11 @@ public static class DefaultBindableProperties static readonly Dictionary bindableObjectTypeDefaultCommandAndParameterProperties = new() { // Key: full type name of BindableObject, Value: command property and corresponding commandParameter property + { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(Button)}", (Button.CommandProperty, Button.CommandParameterProperty) }, + { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(TextCell)}", (TextCell.CommandProperty, TextCell.CommandParameterProperty) }, #pragma warning disable CS0618 { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ClickGestureRecognizer)}", (ClickGestureRecognizer.CommandProperty, ClickGestureRecognizer.CommandParameterProperty) }, #pragma warning restore CS0618 - { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(Button)}", (Button.CommandProperty, Button.CommandParameterProperty) }, - { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(TextCell)}", (TextCell.CommandProperty, TextCell.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(ImageButton)}", (ImageButton.CommandProperty, ImageButton.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(MenuItem)}", (MenuItem.CommandProperty, MenuItem.CommandParameterProperty) }, { $"{nameof(Microsoft)}.{nameof(Microsoft.Maui)}.{nameof(Microsoft.Maui.Controls)}.{nameof(RefreshView)}", (RefreshView.CommandProperty, RefreshView.CommandParameterProperty) },