From f9f1df702a0993c347afb720977af71da513c9e3 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Tue, 24 May 2022 02:16:24 -0800 Subject: [PATCH 01/11] Updated Maui --- .github/workflows/dev.yml | 10 +++------- .github/workflows/main.yml | 10 +++------- Directory.Build.props | 2 +- External/Maui | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index a98441d2..ec6c12fb 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -48,15 +48,11 @@ jobs: - name: Install Maui Workload shell: pwsh run: | - & dotnet workload install maui ` - --skip-sign-check ` - --from-rollback-file https://aka.ms/dotnet/maui/6.0.300/rc.3.json ` - --source https://aka.ms/dotnet6/nuget/index.json ` - --source https://api.nuget.org/v3/index.json + & dotnet workload install maui - - name: Set Maui Version - run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- https://aka.ms/dotnet/maui/6.0.300/rc.3.json + # - name: Set Maui Version + # run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- https://aka.ms/dotnet/maui/6.0.300/rc.3.json - name: Restore Comet-Nuget.sln run: msbuild /r build/Comet-Nuget.sln diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9f332a9..0b9b6397 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,15 +49,11 @@ jobs: - name: Install Maui Workload shell: pwsh run: | - & dotnet workload install maui ` - --skip-sign-check ` - --from-rollback-file https://aka.ms/dotnet/maui/6.0.300/rc.3.json ` - --source https://aka.ms/dotnet6/nuget/index.json ` - --source https://api.nuget.org/v3/index.json + & dotnet workload install maui - - name: Set Maui Version - run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- https://aka.ms/dotnet/maui/6.0.300/rc.3.json + # - name: Set Maui Version + # run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- https://aka.ms/dotnet/maui/6.0.300/rc.3.json - name: Restore Comet-Nuget.sln run: msbuild /r build/Comet-Nuget.sln diff --git a/Directory.Build.props b/Directory.Build.props index 65cf6276..b1063230 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 6.0.300-rc.1.5355 + 6.0.312 diff --git a/External/Maui b/External/Maui index bb116a4a..c121ea3a 160000 --- a/External/Maui +++ b/External/Maui @@ -1 +1 @@ -Subproject commit bb116a4a908174c33a1d62de3dee833c8a125372 +Subproject commit c121ea3a06bc8139c061379c077cdd7e751886d1 From 8132524ef023c962a40abd8fd18921dff12e9a04 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Tue, 24 May 2022 05:52:17 -0800 Subject: [PATCH 02/11] Changed back to a rollback file --- .github/workflows/dev.yml | 9 ++++++--- .github/workflows/main.yml | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index ec6c12fb..bb028b07 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -48,11 +48,14 @@ jobs: - name: Install Maui Workload shell: pwsh run: | - & dotnet workload install maui + & dotnet workload install maui ` + --skip-sign-check ` + --from-rollback-file http://aka.ms/dotnet/maui/6.0.300.json ` + --source https://api.nuget.org/v3/index.json - # - name: Set Maui Version - # run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- https://aka.ms/dotnet/maui/6.0.300/rc.3.json + - name: Set Maui Version + run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- http://aka.ms/dotnet/maui/6.0.300.json - name: Restore Comet-Nuget.sln run: msbuild /r build/Comet-Nuget.sln diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b9b6397..6e84db5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,11 +49,14 @@ jobs: - name: Install Maui Workload shell: pwsh run: | - & dotnet workload install maui + & dotnet workload install maui ` + --skip-sign-check ` + --from-rollback-file http://aka.ms/dotnet/maui/6.0.300.json ` + --source https://api.nuget.org/v3/index.json - # - name: Set Maui Version - # run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- https://aka.ms/dotnet/maui/6.0.300/rc.3.json + - name: Set Maui Version + run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- http://aka.ms/dotnet/maui/6.0.300.json - name: Restore Comet-Nuget.sln run: msbuild /r build/Comet-Nuget.sln From 122b2c30664148d7077451dfe49760da09c0ca59 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Mon, 30 May 2022 18:54:18 -0800 Subject: [PATCH 03/11] Bump Template version. fixes #256 --- .github/workflows/main-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-template.yml b/.github/workflows/main-template.yml index f3556d5b..39f6e29e 100644 --- a/.github/workflows/main-template.yml +++ b/.github/workflows/main-template.yml @@ -52,7 +52,7 @@ jobs: shell: bash run: | MINOR_VERSION=$(( $BASE + $GITHUB_RUN_NUMBER )) - VERSION=0.3.$MINOR_VERSION-beta + VERSION=0.4.$MINOR_VERSION-beta echo "PACKAGE VERSION: $VERSION" nuget pack "templates\comet-templates.nuspec" -version $VERSION From 996336fa4fc6fe68023a3b235bfd00d448f005f3 Mon Sep 17 00:00:00 2001 From: Nathaniel Bond Date: Wed, 20 Jul 2022 03:18:34 -0400 Subject: [PATCH 04/11] Add image button --- src/Comet/AppHostBuilderExtensions.cs | 1 + src/Comet/Controls/ControlsGenerator.cs | 2 +- src/Comet/Controls/ImageButton.cs | 62 +++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/Comet/Controls/ImageButton.cs diff --git a/src/Comet/AppHostBuilderExtensions.cs b/src/Comet/AppHostBuilderExtensions.cs index 17b33c5c..0e83ee2c 100644 --- a/src/Comet/AppHostBuilderExtensions.cs +++ b/src/Comet/AppHostBuilderExtensions.cs @@ -57,6 +57,7 @@ namespace Comet { typeof(FlyoutView), typeof(FlyoutViewHandler) }, { typeof(GraphicsView), typeof(GraphicsViewHandler) }, { typeof(Image) , typeof(ImageHandler) }, + { typeof(ImageButton) , typeof(ImageButtonHandler) }, //{ typeof(Picker), typeof(PickerHandler) }, { typeof(ProgressBar), typeof(ProgressBarHandler) }, { typeof(SearchBar), typeof(SearchBarHandler) }, diff --git a/src/Comet/Controls/ControlsGenerator.cs b/src/Comet/Controls/ControlsGenerator.cs index 698de280..b2ced0bf 100644 --- a/src/Comet/Controls/ControlsGenerator.cs +++ b/src/Comet/Controls/ControlsGenerator.cs @@ -5,7 +5,7 @@ using Microsoft.Maui; using Comet; //Property:NewPropertyName=DefaultValue [assembly: CometGenerate(typeof(ITextButton), nameof(ITextButton.Text), nameof(IButton.Clicked), ClassName = "Button", Skip = new[] { $"{nameof(ITextStyle.TextColor)}:{EnvironmentKeys.Colors.Color}" }, Namespace = "Comet")] -//[assembly: CometGenerate(typeof(IImageButton), nameof(IImageButton.Source), nameof(IButton.Clicked), ClassName = "ImageButton", Namespace = "Comet")] +[assembly: CometGenerate(typeof(IImageButton), nameof(IImageButton.Source), nameof(IButton.Clicked), ClassName = "ImageButton", Namespace = "Comet")] //[assembly: CometGenerate(typeof(IBorder), BaseClass = "ContentView", Namespace = "Comet")] [assembly: CometGenerate(typeof(IIndicatorView), nameof(IIndicatorView.Count), ClassName = "IndicatorView", Namespace = "Comet")] diff --git a/src/Comet/Controls/ImageButton.cs b/src/Comet/Controls/ImageButton.cs new file mode 100644 index 00000000..25dffadd --- /dev/null +++ b/src/Comet/Controls/ImageButton.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using Comet.Graphics; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; + +namespace Comet +{ + public partial class ImageButton : View, Microsoft.Maui.IImageButton + { + protected static Dictionary ImageHandlerPropertyMapper = new(HandlerPropertyMapper) + { + [nameof(ImageSource)] = nameof(IImageSourcePart.Source), + }; + + public ImageButton(Binding source, Action clicked = null) + { + StringSource = source; + Clicked = clicked; + } + + public ImageButton(Func source, Action clicked = null) : this((Binding)source, clicked) { } + + private Binding _source; + public Binding StringSource + { + get => _source; + protected set + { + this.SetBindingValue(ref _source, value); + CreateImageSource(_source.CurrentValue); + } + } + + public override void ViewPropertyChanged(string property, object value) + { + base.ViewPropertyChanged(property, value); + if (property == nameof(StringSource)) + { + InvalidateMeasurement(); + CreateImageSource((string)value); + } + } + + private void CreateImageSource(string source) + { + try + { + this.source ??= new Binding(); + this.source.Set((ImageSource)source); + ViewHandler?.UpdateValue(nameof(IImageSourcePart.Source)); + } + catch (Exception exc) + { + Logger.Warn("An unexpected error occurred loading a bitmap.", exc); + } + } + + protected override string GetHandlerPropertyName(string property) + => ImageHandlerPropertyMapper.TryGetValue(property, out var value) ? value : property; + } +} From 6c2d2fa695bb16affb7952967a9c62433475bd9c Mon Sep 17 00:00:00 2001 From: Nathaniel Bond Date: Wed, 20 Jul 2022 03:34:59 -0400 Subject: [PATCH 05/11] Refactor props dictionary name --- src/Comet/Controls/ImageButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Comet/Controls/ImageButton.cs b/src/Comet/Controls/ImageButton.cs index 25dffadd..aafb135a 100644 --- a/src/Comet/Controls/ImageButton.cs +++ b/src/Comet/Controls/ImageButton.cs @@ -8,7 +8,7 @@ namespace Comet { public partial class ImageButton : View, Microsoft.Maui.IImageButton { - protected static Dictionary ImageHandlerPropertyMapper = new(HandlerPropertyMapper) + protected static Dictionary ImageButtonHandlerPropertyMapper = new(HandlerPropertyMapper) { [nameof(ImageSource)] = nameof(IImageSourcePart.Source), }; @@ -57,6 +57,6 @@ namespace Comet } protected override string GetHandlerPropertyName(string property) - => ImageHandlerPropertyMapper.TryGetValue(property, out var value) ? value : property; + => ImageButtonHandlerPropertyMapper.TryGetValue(property, out var value) ? value : property; } } From cc7be2ceef5afcf6350f9a44ae48f37fedd321c9 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Mon, 30 May 2022 18:56:15 -0800 Subject: [PATCH 06/11] Update main-template.yml --- .github/workflows/main-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-template.yml b/.github/workflows/main-template.yml index 39f6e29e..adfcfd22 100644 --- a/.github/workflows/main-template.yml +++ b/.github/workflows/main-template.yml @@ -1,4 +1,4 @@ -name: main-build +name: main-template #this drops to nuget From e94b56f0115ef54796c0426c43127ead54a6e94d Mon Sep 17 00:00:00 2001 From: James Clancey Date: Mon, 30 May 2022 18:58:31 -0800 Subject: [PATCH 07/11] Update main-template.yml --- .github/workflows/main-template.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main-template.yml b/.github/workflows/main-template.yml index adfcfd22..b3469b59 100644 --- a/.github/workflows/main-template.yml +++ b/.github/workflows/main-template.yml @@ -7,6 +7,7 @@ on: branches: [ main] paths: - 'templates/**' + - '.github/workflows/main-template.yml' workflow_dispatch: From 5d846d78c2e0be3e61860c1482c9e8bd74c160b4 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Thu, 29 Sep 2022 11:28:11 -0800 Subject: [PATCH 08/11] Update dev.yml --- .github/workflows/dev.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index bb028b07..966e1e4b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -33,7 +33,7 @@ jobs: run: | $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1 - & .\dotnet-install.ps1 -Quality daily -Channel 6.0.3xx -InstallDir "$env:ProgramFiles\dotnet\" -Verbose + & .\dotnet-install.ps1 -InstallDir "$env:ProgramFiles\dotnet\" -Verbose & dotnet --list-sdks # - name: Install Visual Studio Preview @@ -50,13 +50,8 @@ jobs: run: | & dotnet workload install maui ` --skip-sign-check ` - --from-rollback-file http://aka.ms/dotnet/maui/6.0.300.json ` - --source https://api.nuget.org/v3/index.json - - name: Set Maui Version - run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- http://aka.ms/dotnet/maui/6.0.300.json - - name: Restore Comet-Nuget.sln run: msbuild /r build/Comet-Nuget.sln From 95bd4bbf1485e743f53768e5c017c35d089210ec Mon Sep 17 00:00:00 2001 From: James Clancey Date: Thu, 29 Sep 2022 11:28:46 -0800 Subject: [PATCH 09/11] Remove the build props --- Comet.nuspec | 4 ++-- Directory.Build.props | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 Directory.Build.props diff --git a/Comet.nuspec b/Comet.nuspec index 3cc4a236..2ecd749c 100644 --- a/Comet.nuspec +++ b/Comet.nuspec @@ -37,8 +37,8 @@ - - CometSample @@ -20,6 +21,9 @@ CA1416 1701;1702;0649; + + false + @@ -34,10 +38,12 @@ - - - - + + - + + + + + \ No newline at end of file diff --git a/sample/Comet.Sample/Directory.Build.props b/sample/Comet.Sample/Directory.Build.props deleted file mode 100644 index f52c28da..00000000 --- a/sample/Comet.Sample/Directory.Build.props +++ /dev/null @@ -1,8 +0,0 @@ - - - true - true - - - - \ No newline at end of file diff --git a/sample/Comet.Sample/Directory.Build.targets b/sample/Comet.Sample/Directory.Build.targets deleted file mode 100644 index 1d37630f..00000000 --- a/sample/Comet.Sample/Directory.Build.targets +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Comet/Comet.csproj b/src/Comet/Comet.csproj index 75cb2118..80257ccc 100644 --- a/src/Comet/Comet.csproj +++ b/src/Comet/Comet.csproj @@ -1,5 +1,5 @@ + - net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst $(TargetFrameworks);net6.0-windows10.0.19041 @@ -11,16 +11,17 @@ 14.2 14.0 21.0 - 10.0.17763.0 - 10.0.17763.0 - - + + + + - runtime; build; native; contentfiles; analyzers; buildtransitive + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + \ No newline at end of file From d5f3190d9e48c8301f4e4155d700a6d5945b6fd5 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Thu, 29 Sep 2022 12:08:54 -0800 Subject: [PATCH 11/11] Updated build files --- .github/workflows/main-template.yml | 2 +- .github/workflows/main.yml | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main-template.yml b/.github/workflows/main-template.yml index b3469b59..370eaa06 100644 --- a/.github/workflows/main-template.yml +++ b/.github/workflows/main-template.yml @@ -29,7 +29,7 @@ jobs: run: | $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1 - & .\dotnet-install.ps1 -Version 6.0.100 -InstallDir "$env:ProgramFiles\dotnet\" -Verbose + & .\dotnet-install.ps1 -InstallDir "$env:ProgramFiles\dotnet\" -Verbose & dotnet --list-sdks # - name: Install Visual Studio Preview diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e84db5e..e82d9421 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: run: | $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1 - & .\dotnet-install.ps1 -Quality daily -Channel 6.0.3xx -InstallDir "$env:ProgramFiles\dotnet\" -Verbose + & .\dotnet-install.ps1 -InstallDir "$env:ProgramFiles\dotnet\" -Verbose & dotnet --list-sdks # - name: Install Visual Studio Preview @@ -50,13 +50,7 @@ jobs: shell: pwsh run: | & dotnet workload install maui ` - --skip-sign-check ` - --from-rollback-file http://aka.ms/dotnet/maui/6.0.300.json ` - --source https://api.nuget.org/v3/index.json - - - - name: Set Maui Version - run: dotnet run --project build/MauiVersionUpdater/MauiVersionUpdater.csproj -- http://aka.ms/dotnet/maui/6.0.300.json + --skip-sign-check - name: Restore Comet-Nuget.sln run: msbuild /r build/Comet-Nuget.sln