From 8be3281d4810b0205fcc7ba5d4a24ae4abb22b33 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 12 Oct 2021 09:08:42 +0200 Subject: [PATCH 1/6] Update pipeline --- .gitignore | 1 + eng/Version.props | 8 +- eng/pipelines/azure-pipelines.yml | 107 ++++++++++-------- eng/pipelines/common/variables.yml | 2 +- .../GraphicsControls.Sample.WinUI.csproj | 8 +- src/GraphicsControls/GraphicsControls.csproj | 3 - 6 files changed, 70 insertions(+), 59 deletions(-) diff --git a/.gitignore b/.gitignore index f1e3d20..c727b84 100644 --- a/.gitignore +++ b/.gitignore @@ -250,3 +250,4 @@ paket-files/ # JetBrains Rider .idea/ *.sln.iml +.DS_Store diff --git a/eng/Version.props b/eng/Version.props index 18f0091..9b8ce74 100644 --- a/eng/Version.props +++ b/eng/Version.props @@ -1,9 +1,9 @@ - 6.0.100-preview.2.21155.3 - 11.0.200-ci.main.148 - 14.3.100-ci.main.337 - 14.4.100-ci.main.1192 + 6.0.100-rc.1.1608 + 31.0.100-rc.1.12 + 15.0.100-rc.1.1534 + 15.0.100-rc.1.1534 \ No newline at end of file diff --git a/eng/pipelines/azure-pipelines.yml b/eng/pipelines/azure-pipelines.yml index b93b7d8..653a6e8 100644 --- a/eng/pipelines/azure-pipelines.yml +++ b/eng/pipelines/azure-pipelines.yml @@ -86,55 +86,68 @@ stages: variables: buildConfiguration : '${{ BuildCondition }}' steps: - - checkout: self - clean: true - submodules: true - - task: NuGetCommand@2 - inputs: - command: 'restore' - restoreSolution: '$(GraphicsControlsSln)' - feedsToUse: 'config' - nugetConfigPath: 'NuGet.config' + - task: UseDotNet@2 + displayName: 'Install .NET SDK' + inputs: + version: '$(DOTNET_VERSION)' + includePreviewVersions: true + - task: CmdLine@2 + displayName: 'Install .NET MAUI workload' + inputs: + script: 'dotnet workload install maui' + - task: JavaToolInstaller@0 + displayName: 'Install Java SDK 11.0' + inputs: + versionSpec: '11' + jdkArchitectureOption: 'x64' + jdkSourceOption: 'PreInstalled' + - checkout: self + clean: true + submodules: true + - task: DotNetCoreCLI@2 + displayName: 'Restore NuGet Packages' + inputs: + command: 'restore' + projects: $(GraphicsControlsSln) + feedsToUse: 'config' + nugetConfigPath: 'NuGet.config' + - task: DotNetCoreCLI@2 + displayName: 'Build Library Project' + inputs: + command: 'build' + projects: '$(GraphicsControlsLibraryProject)' + arguments: '-c $(BuildConfiguration) -bl:$(build.artifactstagingdirectory)/${{BuildCondition}}/win_build_${{ BuildCondition }}.binlog' + - task: DotNetCoreCLI@2 + displayName: 'Pack Library Project' + inputs: + command: 'pack' + packagesToPack: '$(GraphicsControlsLibraryProject)' + arguments: '--no-build -c $(BuildConfiguration) /p:PackageOutputPath="$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}' + - task: CopyFiles@2 + displayName: 'Copy Files dlls' + inputs: + Contents: src/**/bin/**/*.dll + TargetFolder: '$(build.artifactstagingdirectory)/${{ BuildCondition }}' - - task: MSBuild@1 - displayName: 'Build sln' - inputs: - solution: $(GraphicsControlsSln) - configuration: $(BuildConfiguration) - msbuildArguments: -bl:$(build.artifactstagingdirectory)/${{BuildCondition}}/win_build_${{ BuildCondition }}.binlog - - - task: MSBuild@1 - displayName: 'Pack sln' - inputs: - solution: $(GraphicsControlsLibraryProject) - configuration: $(BuildConfiguration) - msbuildArguments: -t:pack /p:PackageOutputPath="$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}" + - task: CopyFiles@2 + displayName: 'Copy nupkg' + inputs: + Contents: artifacts/*.nupkg + flattenFolders: true + TargetFolder: '$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}/' + + - task: CopyFiles@2 + displayName: 'Copy SignList.xml Files' + inputs: + Contents: eng/automation/SignList.xml + TargetFolder: '$(Build.ArtifactStagingDirectory)/nuget/${{ BuildCondition }}' + flattenFolders: true - - task: CopyFiles@2 - displayName: 'Copy Files dlls' - inputs: - Contents: src/**/bin/**/*.dll - TargetFolder: '$(build.artifactstagingdirectory)/${{ BuildCondition }}' - - - task: CopyFiles@2 - displayName: 'Copy nupkg' - inputs: - Contents: artifacts/*.nupkg - flattenFolders: true - TargetFolder: '$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}/' - - - task: CopyFiles@2 - displayName: 'Copy SignList.xml Files' - inputs: - Contents: eng/automation/SignList.xml - TargetFolder: '$(Build.ArtifactStagingDirectory)/nuget/${{ BuildCondition }}' - flattenFolders: true - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: win_build' - condition: always() - inputs: - ArtifactName: win_build + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: win_build' + condition: always() + inputs: + ArtifactName: win_build # only sign using the private server diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index a1b453f..de794ff 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -6,7 +6,7 @@ variables: - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: true - name: DOTNET_VERSION - value: 5.0.102 + value: 6.0.x - name: GraphicsControlsSln value: '**/GraphicsControls.sln' - name: GraphicsControlsLibraryProject diff --git a/src/GraphicsControls.Sample/GraphicsControls.Sample.WinUI/GraphicsControls.Sample.WinUI.csproj b/src/GraphicsControls.Sample/GraphicsControls.Sample.WinUI/GraphicsControls.Sample.WinUI.csproj index d8d56e4..9113536 100644 --- a/src/GraphicsControls.Sample/GraphicsControls.Sample.WinUI/GraphicsControls.Sample.WinUI.csproj +++ b/src/GraphicsControls.Sample/GraphicsControls.Sample.WinUI/GraphicsControls.Sample.WinUI.csproj @@ -34,10 +34,10 @@ - - - - + + + + diff --git a/src/GraphicsControls/GraphicsControls.csproj b/src/GraphicsControls/GraphicsControls.csproj index 254e5f8..9c06e69 100644 --- a/src/GraphicsControls/GraphicsControls.csproj +++ b/src/GraphicsControls/GraphicsControls.csproj @@ -7,9 +7,6 @@ enable true true - iossimulator-x64 - maccatalyst-x64 - true Microsoft.Maui.Graphics.Controls From 4e67e1e52e46da076de60fd1546172441ebef40a Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 12 Oct 2021 14:27:04 +0200 Subject: [PATCH 2/6] Eliminate warning and nuget to right location --- Microsoft.Maui.Graphics.Controls.MultiTargeting.targets | 2 +- eng/pipelines/azure-pipelines.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets b/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets index c33a092..b5eb19c 100644 --- a/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets +++ b/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets @@ -83,7 +83,7 @@ - + diff --git a/eng/pipelines/azure-pipelines.yml b/eng/pipelines/azure-pipelines.yml index 653a6e8..36b6552 100644 --- a/eng/pipelines/azure-pipelines.yml +++ b/eng/pipelines/azure-pipelines.yml @@ -122,7 +122,8 @@ stages: inputs: command: 'pack' packagesToPack: '$(GraphicsControlsLibraryProject)' - arguments: '--no-build -c $(BuildConfiguration) /p:PackageOutputPath="$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}' + packDirectory: '$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}' + arguments: '-c $(BuildConfiguration)' - task: CopyFiles@2 displayName: 'Copy Files dlls' inputs: From 69c57726cf4fe227b98205af796bccf9975301ec Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 12 Oct 2021 15:05:22 +0200 Subject: [PATCH 3/6] Update GitInfo.txt --- GitInfo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitInfo.txt b/GitInfo.txt index 0709b9c..69bc01f 100644 --- a/GitInfo.txt +++ b/GitInfo.txt @@ -1 +1 @@ -6.0.100-preview.6 +6.0.101-preview.9 From 701f28f707188ed93301debeeaad492e1660ea6a Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 12 Oct 2021 15:43:15 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dbccb31..7573737 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://dev.azure.com/devdiv/DevDiv/_apis/build/status/MAUI.Graphics.Controls?repoName=dotnet%2FMicrosoft.Maui.Graphics.Controls&branchName=main)](https://dev.azure.com/devdiv/DevDiv/_build/latest?definitionId=14477&repoName=dotnet%2FMicrosoft.Maui.Graphics.Controls&branchName=main) +Nightly Feed: https://aka.ms/maui-graphics-controls-nightly/index.json + **Microsoft.Maui.Graphics.Controls** is a **.NET MAUI experiment** that offers drawn controls allowing to choose between **Cupertino, Fluent and Material**. From ea3b0a108757b3760a9c03bff77f3bd58a70702e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Tue, 12 Oct 2021 12:42:59 +0200 Subject: [PATCH 5/6] Update .NET MAUI versions --- Microsoft.Maui.Graphics.Controls.MultiTargeting.targets | 2 +- src/GraphicsControls/GraphicsControls.csproj | 2 +- src/GraphicsControls/Handlers/Button/ButtonHandler.cs | 8 ++++---- .../Handlers/Button/CupertinoButtonDrawable.cs | 6 ++++-- .../Handlers/Button/FluentButtonDrawable.cs | 8 ++++++-- .../Handlers/Button/MaterialButtonDrawable.cs | 6 ++++-- src/GraphicsControls/Platform/ColorExtensions.cs | 2 +- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets b/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets index b5eb19c..490c48a 100644 --- a/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets +++ b/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets @@ -84,7 +84,7 @@ - + \ No newline at end of file diff --git a/src/GraphicsControls/GraphicsControls.csproj b/src/GraphicsControls/GraphicsControls.csproj index 9c06e69..c89dd26 100644 --- a/src/GraphicsControls/GraphicsControls.csproj +++ b/src/GraphicsControls/GraphicsControls.csproj @@ -12,7 +12,7 @@ Microsoft.Maui.Graphics.Controls - + \ No newline at end of file diff --git a/src/GraphicsControls/Handlers/Button/ButtonHandler.cs b/src/GraphicsControls/Handlers/Button/ButtonHandler.cs index b758a0c..f5b25b3 100644 --- a/src/GraphicsControls/Handlers/Button/ButtonHandler.cs +++ b/src/GraphicsControls/Handlers/Button/ButtonHandler.cs @@ -11,10 +11,10 @@ namespace Microsoft.Maui.Graphics.Controls public static PropertyMapper PropertyMapper = new PropertyMapper(ViewHandler.Mapper) { [nameof(IButton.Background)] = ViewHandler.MapInvalidate, - [nameof(IButton.Text)] = ViewHandler.MapInvalidate, - [nameof(IButton.TextColor)] = ViewHandler.MapInvalidate, - [nameof(IButton.Font)] = ViewHandler.MapInvalidate, - [nameof(IButton.CharacterSpacing)] = ViewHandler.MapInvalidate, + [nameof(IText.Text)] = ViewHandler.MapInvalidate, + [nameof(ITextStyle.TextColor)] = ViewHandler.MapInvalidate, + [nameof(ITextStyle.Font)] = ViewHandler.MapInvalidate, + [nameof(ITextStyle.CharacterSpacing)] = ViewHandler.MapInvalidate, [nameof(IButton.Padding)] = ViewHandler.MapInvalidate }; diff --git a/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs b/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs index 4fdeab4..6f780c2 100644 --- a/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs +++ b/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs @@ -31,13 +31,15 @@ { canvas.SaveState(); - canvas.FontColor = button.TextColor.WithDefault(Cupertino.Color.Label.Light.White); + var textColor = (button as ITextStyle)?.TextColor; + canvas.FontColor = textColor?.WithDefault(Cupertino.Color.Label.Light.White); canvas.FontSize = 17f; var height = dirtyRect.Height; var width = dirtyRect.Width; - canvas.DrawString(button.Text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); + var text = (button as IText)?.Text; + canvas.DrawString(text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); canvas.RestoreState(); } diff --git a/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs b/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs index ef00dad..a345e7f 100644 --- a/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs +++ b/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs @@ -67,7 +67,10 @@ canvas.SaveState(); if (button.IsEnabled) - canvas.FontColor = button.TextColor.WithDefault(Fluent.Color.Foreground.White); + { + var textColor = (button as ITextStyle)?.TextColor; + canvas.FontColor = textColor?.WithDefault(Fluent.Color.Foreground.White); + } else canvas.FontColor = Fluent.Color.Foreground.NeutralPrimary.ToColor(); @@ -76,7 +79,8 @@ var height = dirtyRect.Height; var width = dirtyRect.Width; - canvas.DrawString(button.Text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); + var text = (button as IText)?.Text; + canvas.DrawString(text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); canvas.RestoreState(); } diff --git a/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs b/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs index eda7fc3..bc1a6d2 100644 --- a/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs +++ b/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs @@ -42,7 +42,8 @@ namespace Microsoft.Maui.Graphics.Controls canvas.FontName = "Roboto"; - canvas.FontColor = button.TextColor.WithDefault(button.IsEnabled ? Material.Color.White : Material.Color.Gray1); + var textColor = (button as ITextStyle)?.TextColor; + canvas.FontColor = textColor?.WithDefault(button.IsEnabled ? Material.Color.White : Material.Color.Gray1); canvas.FontSize = Material.Font.Button; @@ -51,7 +52,8 @@ namespace Microsoft.Maui.Graphics.Controls var width = dirtyRect.Width; - canvas.DrawString(button.Text.ToUpper(), x, y, width, MaterialBackgroundHeight, HorizontalAlignment.Center, VerticalAlignment.Center); + var text = (button as IText)?.Text; + canvas.DrawString(text?.ToUpper(), x, y, width, MaterialBackgroundHeight, HorizontalAlignment.Center, VerticalAlignment.Center); canvas.RestoreState(); } diff --git a/src/GraphicsControls/Platform/ColorExtensions.cs b/src/GraphicsControls/Platform/ColorExtensions.cs index 3c886e6..38600ee 100644 --- a/src/GraphicsControls/Platform/ColorExtensions.cs +++ b/src/GraphicsControls/Platform/ColorExtensions.cs @@ -7,7 +7,7 @@ namespace Microsoft.Maui.Graphics.Controls { public static Color WithDefault(this Color color, string defaultColor) { - if (!color.IsDefault()) + if (color != null && !color.IsDefault()) return color; else return Color.FromArgb(defaultColor); From 7539c63c30cc8b0e4819bb1857b5c9d1e1138173 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 12 Oct 2021 16:01:51 +0200 Subject: [PATCH 6/6] Revert "Update .NET MAUI versions" This reverts commit ea3b0a108757b3760a9c03bff77f3bd58a70702e. --- Microsoft.Maui.Graphics.Controls.MultiTargeting.targets | 2 +- src/GraphicsControls/GraphicsControls.csproj | 2 +- src/GraphicsControls/Handlers/Button/ButtonHandler.cs | 8 ++++---- .../Handlers/Button/CupertinoButtonDrawable.cs | 6 ++---- .../Handlers/Button/FluentButtonDrawable.cs | 8 ++------ .../Handlers/Button/MaterialButtonDrawable.cs | 6 ++---- src/GraphicsControls/Platform/ColorExtensions.cs | 2 +- 7 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets b/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets index 490c48a..b5eb19c 100644 --- a/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets +++ b/Microsoft.Maui.Graphics.Controls.MultiTargeting.targets @@ -84,7 +84,7 @@ - + \ No newline at end of file diff --git a/src/GraphicsControls/GraphicsControls.csproj b/src/GraphicsControls/GraphicsControls.csproj index c89dd26..9c06e69 100644 --- a/src/GraphicsControls/GraphicsControls.csproj +++ b/src/GraphicsControls/GraphicsControls.csproj @@ -12,7 +12,7 @@ Microsoft.Maui.Graphics.Controls - + \ No newline at end of file diff --git a/src/GraphicsControls/Handlers/Button/ButtonHandler.cs b/src/GraphicsControls/Handlers/Button/ButtonHandler.cs index f5b25b3..b758a0c 100644 --- a/src/GraphicsControls/Handlers/Button/ButtonHandler.cs +++ b/src/GraphicsControls/Handlers/Button/ButtonHandler.cs @@ -11,10 +11,10 @@ namespace Microsoft.Maui.Graphics.Controls public static PropertyMapper PropertyMapper = new PropertyMapper(ViewHandler.Mapper) { [nameof(IButton.Background)] = ViewHandler.MapInvalidate, - [nameof(IText.Text)] = ViewHandler.MapInvalidate, - [nameof(ITextStyle.TextColor)] = ViewHandler.MapInvalidate, - [nameof(ITextStyle.Font)] = ViewHandler.MapInvalidate, - [nameof(ITextStyle.CharacterSpacing)] = ViewHandler.MapInvalidate, + [nameof(IButton.Text)] = ViewHandler.MapInvalidate, + [nameof(IButton.TextColor)] = ViewHandler.MapInvalidate, + [nameof(IButton.Font)] = ViewHandler.MapInvalidate, + [nameof(IButton.CharacterSpacing)] = ViewHandler.MapInvalidate, [nameof(IButton.Padding)] = ViewHandler.MapInvalidate }; diff --git a/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs b/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs index 6f780c2..4fdeab4 100644 --- a/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs +++ b/src/GraphicsControls/Handlers/Button/CupertinoButtonDrawable.cs @@ -31,15 +31,13 @@ { canvas.SaveState(); - var textColor = (button as ITextStyle)?.TextColor; - canvas.FontColor = textColor?.WithDefault(Cupertino.Color.Label.Light.White); + canvas.FontColor = button.TextColor.WithDefault(Cupertino.Color.Label.Light.White); canvas.FontSize = 17f; var height = dirtyRect.Height; var width = dirtyRect.Width; - var text = (button as IText)?.Text; - canvas.DrawString(text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); + canvas.DrawString(button.Text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); canvas.RestoreState(); } diff --git a/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs b/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs index a345e7f..ef00dad 100644 --- a/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs +++ b/src/GraphicsControls/Handlers/Button/FluentButtonDrawable.cs @@ -67,10 +67,7 @@ canvas.SaveState(); if (button.IsEnabled) - { - var textColor = (button as ITextStyle)?.TextColor; - canvas.FontColor = textColor?.WithDefault(Fluent.Color.Foreground.White); - } + canvas.FontColor = button.TextColor.WithDefault(Fluent.Color.Foreground.White); else canvas.FontColor = Fluent.Color.Foreground.NeutralPrimary.ToColor(); @@ -79,8 +76,7 @@ var height = dirtyRect.Height; var width = dirtyRect.Width; - var text = (button as IText)?.Text; - canvas.DrawString(text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); + canvas.DrawString(button.Text, 0, 0, width, height, HorizontalAlignment.Center, VerticalAlignment.Center); canvas.RestoreState(); } diff --git a/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs b/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs index bc1a6d2..eda7fc3 100644 --- a/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs +++ b/src/GraphicsControls/Handlers/Button/MaterialButtonDrawable.cs @@ -42,8 +42,7 @@ namespace Microsoft.Maui.Graphics.Controls canvas.FontName = "Roboto"; - var textColor = (button as ITextStyle)?.TextColor; - canvas.FontColor = textColor?.WithDefault(button.IsEnabled ? Material.Color.White : Material.Color.Gray1); + canvas.FontColor = button.TextColor.WithDefault(button.IsEnabled ? Material.Color.White : Material.Color.Gray1); canvas.FontSize = Material.Font.Button; @@ -52,8 +51,7 @@ namespace Microsoft.Maui.Graphics.Controls var width = dirtyRect.Width; - var text = (button as IText)?.Text; - canvas.DrawString(text?.ToUpper(), x, y, width, MaterialBackgroundHeight, HorizontalAlignment.Center, VerticalAlignment.Center); + canvas.DrawString(button.Text.ToUpper(), x, y, width, MaterialBackgroundHeight, HorizontalAlignment.Center, VerticalAlignment.Center); canvas.RestoreState(); } diff --git a/src/GraphicsControls/Platform/ColorExtensions.cs b/src/GraphicsControls/Platform/ColorExtensions.cs index 38600ee..3c886e6 100644 --- a/src/GraphicsControls/Platform/ColorExtensions.cs +++ b/src/GraphicsControls/Platform/ColorExtensions.cs @@ -7,7 +7,7 @@ namespace Microsoft.Maui.Graphics.Controls { public static Color WithDefault(this Color color, string defaultColor) { - if (color != null && !color.IsDefault()) + if (!color.IsDefault()) return color; else return Color.FromArgb(defaultColor);