From cb0906a4ce7649652b467e5577218ee7048a0315 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Mon, 28 Jun 2021 15:33:43 -0700 Subject: [PATCH 01/16] Set handler to shimmed handler so it doesn't get reshimmed (#1483) --- src/Compatibility/Core/src/Android/AppCompat/Platform.cs | 1 + src/Compatibility/Core/src/WinUI/Platform.cs | 1 + src/Compatibility/Core/src/iOS/Platform.cs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/Compatibility/Core/src/Android/AppCompat/Platform.cs b/src/Compatibility/Core/src/Android/AppCompat/Platform.cs index 334c85a88d7d..348045a59b9b 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/Platform.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/Platform.cs @@ -355,6 +355,7 @@ internal static IVisualElementRenderer CreateRenderer(VisualElement element, Con else if (handler is INativeViewHandler vh) { renderer = new HandlerToRendererShim(vh); + element.Handler = handler; SetRenderer(element, renderer); } } diff --git a/src/Compatibility/Core/src/WinUI/Platform.cs b/src/Compatibility/Core/src/WinUI/Platform.cs index 0d00b31542c5..ce13f0c571d4 100644 --- a/src/Compatibility/Core/src/WinUI/Platform.cs +++ b/src/Compatibility/Core/src/WinUI/Platform.cs @@ -100,6 +100,7 @@ public static IVisualElementRenderer CreateRenderer(VisualElement element) else if (handler is INativeViewHandler vh) { renderer = new HandlerToRendererShim(vh); + element.Handler = handler; SetRenderer(element, renderer); } } diff --git a/src/Compatibility/Core/src/iOS/Platform.cs b/src/Compatibility/Core/src/iOS/Platform.cs index 4b77b2636826..fc9cdfac48c2 100644 --- a/src/Compatibility/Core/src/iOS/Platform.cs +++ b/src/Compatibility/Core/src/iOS/Platform.cs @@ -280,6 +280,8 @@ public static IVisualElementRenderer CreateRenderer(VisualElement element) else if (handler is INativeViewHandler vh) { renderer = new HandlerToRendererShim(vh); + element.Handler = handler; + SetRenderer(element, renderer); } } From 6c51b60f31621d44cc570eb88c2c7871116ec275 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 28 Jun 2021 17:56:15 -0500 Subject: [PATCH 02/16] [templates] use copyOnly for certain files (#1462) Context: https://github.com/dotnet/templating/issues/3325 Context: https://github.com/dotnet/templating/wiki/Reference-for-template.json#content-manipulation In current .NET 6 Preview 6 builds, there is an issue if a template includes a binary file larger than ~8kb, it seems to get truncated when `dotnet new` extracts the template. A workaround is to use the `copyOnly` feature for binary files. Really, we should be doing this anyway, because otherwise the templating system considers replacing *text* in these binary files. It improves performance to do this and would hopefully prevent a future bug of random bytes getting replaced. For .NET MAUI, the following files need `copyOnly`: * `wwwroot/css` folder has several types of fonts inside * `.svg` and `.ttf` files --- .../templates/maui-blazor/.template.config/template.json | 7 +++++++ .../templates/maui-mobile/.template.config/template.json | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/Templates/src/templates/maui-blazor/.template.config/template.json b/src/Templates/src/templates/maui-blazor/.template.config/template.json index abb2e3bb3341..d0b85835aed2 100644 --- a/src/Templates/src/templates/maui-blazor/.template.config/template.json +++ b/src/Templates/src/templates/maui-blazor/.template.config/template.json @@ -12,6 +12,13 @@ "type": "solution" }, "sourceName": "MauiApp1", + "sources": [ + { + "source": "./", + "target": "./", + "copyOnly": [ "**/wwwroot/css/**", "**/*.svg", "**/*.ttf" ] + } + ], "preferNameDirectory": true, "primaryOutputs": [ { "path": "MauiApp1/MauiApp1.csproj" }, diff --git a/src/Templates/src/templates/maui-mobile/.template.config/template.json b/src/Templates/src/templates/maui-mobile/.template.config/template.json index 7c558cb1e518..431ac4b73e44 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/template.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/template.json @@ -12,6 +12,13 @@ "type": "solution" }, "sourceName": "MauiApp1", + "sources": [ + { + "source": "./", + "target": "./", + "copyOnly": [ "**/*.svg", "**/*.ttf" ] + } + ], "preferNameDirectory": true, "guids": [ "07CD65EF-6238-4365-AF5D-F6D433967F48", From 06b4db3cabd4c944e0b64f8e16ecdade70d47d0d Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 28 Jun 2021 19:33:38 -0500 Subject: [PATCH 03/16] [workload] the maui-core workload needs to abstract (#1480) Context: https://github.com/dotnet/designs/blob/02486c962c09113deec777cabd9a54e9acfef437/accepted/2020/workloads/workload-manifest.md#workload-definitions The `maui-core` workload isn't something we intend developers to install directly. It is a set of packs that are shared by all platform-specific workloads. We need to make the `maui-core` workload "abstract": > If `true`, this workload can only be extended, and is never exposed > directly as an installable workload. Default is `false`. --- src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json index 4e732be9643b..8d79a5cb24da 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json @@ -23,6 +23,7 @@ ] }, "maui-core": { + "abstract": true, "description": ".NET MAUI SDK Core Packages", "packs": [ "Microsoft.AspNetCore.Components.WebView.Maui", From 6760ba9c9d30fe1507f99cb646b538a9eee9e724 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Tue, 29 Jun 2021 13:49:47 +0200 Subject: [PATCH 04/16] Turn XamlC on by default (#1422) * Turn XamlC on by default * fix tests * winui Co-authored-by: Matthew Leibowitz --- .nuspec/Microsoft.Maui.Controls.targets | 1 + .../GradientGalleries/GradientViewsGallery.xaml.cs | 4 +++- .../SwipeViewGalleries/BasicSwipeGallery.xaml.cs | 3 +++ .../HorizontalSwipeThresholdGallery.xaml.cs | 5 ++++- .../ResourceSwipeItemsGallery.xaml.cs | 2 ++ .../SwipeBindableLayoutGallery.xaml.cs | 2 ++ .../SwipeCarouselViewGallery.xaml.cs | 2 ++ .../SwipeHorizontalCollectionViewGallery.xaml.cs | 2 ++ .../SwipeListViewGallery.xaml.cs | 2 ++ .../SwipeVerticalCollectionViewGallery.xaml.cs | 2 ++ .../SwipeViewBindingContextGallery.xaml.cs | 2 ++ .../SwipeViewGestureRecognizerGallery.xaml.cs | 5 ++++- .../SwipeViewVisualStatesCollectionGallery.xaml.cs | 5 ++++- .../VerticalSwipeThresholdGallery.xaml.cs | 5 ++++- .../DualScreenStateTriggerGallery.xaml.cs | 5 ++++- .../StateTriggerEventsGallery.xaml.cs | 2 ++ .../StateTriggersDirectlyOnElements.xaml.cs | 2 ++ .../src/Core/HanselForms/BlogPage.xaml.cs | 2 ++ .../src/Core/HanselForms/TwitterPage.xaml.cs | 2 ++ .../src/Core/LegacyRepro/Page1.xaml.cs | 3 +++ .../src/Core/XamStore/Views/DemoShellPage.xaml.cs | 1 + .../src/Issues.Shared/Bugzilla29107.xaml.cs | 2 ++ .../src/Issues.Shared/Bugzilla45284.xaml.cs | 2 ++ .../src/Issues.Shared/Bugzilla54977.xaml.cs | 2 ++ .../src/Issues.Shared/Issue12910.xaml.cs | 2 ++ .../src/Issues.Shared/Issue1653.xaml.cs | 2 ++ .../src/Issues.Shared/Issue1653v2.xaml.cs | 2 ++ .../src/Issues.Shared/Issue2282.xaml.cs | 2 ++ .../src/Issues.Shared/Issue2357.xaml.cs | 3 +++ .../src/Issues.Shared/Issue2951.xaml.cs | 2 ++ .../src/Issues.Shared/Issue8715.xaml.cs | 1 + .../src/Issues.Shared/RectTest.xaml.cs | 2 ++ ...atibility.ControlGallery.Android.UITests.csproj | 3 +++ .../test/WinUI.UITests/WinUI.UITests.csproj | 3 +++ ...Compatibility.ControlGallery.iOS.UITests.csproj | 3 +++ src/Controls/src/Build.Tasks/XamlCTask.cs | 14 ++------------ 36 files changed, 86 insertions(+), 18 deletions(-) diff --git a/.nuspec/Microsoft.Maui.Controls.targets b/.nuspec/Microsoft.Maui.Controls.targets index a4e5ebf5f3b0..11bf780167d3 100644 --- a/.nuspec/Microsoft.Maui.Controls.targets +++ b/.nuspec/Microsoft.Maui.Controls.targets @@ -129,6 +129,7 @@ OptimizeIL = "true" DebugSymbols = "$(DebugSymbols)" DebugType = "$(DebugType)" + DefaultCompile = "true" ValidateOnly = "$(_MauiXamlCValidateOnly)" KeepXamlResources = "$(MauiKeepXamlResources)" /> diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/GradientGalleries/GradientViewsGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/GradientGalleries/GradientViewsGallery.xaml.cs index f6ac2a4124df..8fd69368eacd 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/GradientGalleries/GradientViewsGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/GradientGalleries/GradientViewsGallery.xaml.cs @@ -1,7 +1,9 @@ using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.GradientGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class GradientViewsGallery : ContentPage { public GradientViewsGallery() @@ -106,4 +108,4 @@ void UpdateBackground(Brush background) TimePicker.Background = background; } } -} \ No newline at end of file +} diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/BasicSwipeGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/BasicSwipeGallery.xaml.cs index e07db9bec7f8..dca7424a97d5 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/BasicSwipeGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/BasicSwipeGallery.xaml.cs @@ -1,9 +1,12 @@ using System; +using Microsoft.Maui.Controls.Xaml; + using Microsoft.Maui.Controls.Internals; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class BasicSwipeGallery : ContentPage { public BasicSwipeGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/HorizontalSwipeThresholdGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/HorizontalSwipeThresholdGallery.xaml.cs index f57108fb85d8..ebc551089dba 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/HorizontalSwipeThresholdGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/HorizontalSwipeThresholdGallery.xaml.cs @@ -1,5 +1,8 @@ -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries +using Microsoft.Maui.Controls.Xaml; + +namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class HorizontalSwipeThresholdGallery : ContentPage { public HorizontalSwipeThresholdGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/ResourceSwipeItemsGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/ResourceSwipeItemsGallery.xaml.cs index 1f19f5fc57d8..5db8520d450a 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/ResourceSwipeItemsGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/ResourceSwipeItemsGallery.xaml.cs @@ -1,8 +1,10 @@ using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class ResourceSwipeItemsGallery : ContentPage { public ResourceSwipeItemsGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeBindableLayoutGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeBindableLayoutGallery.xaml.cs index cd120be655ad..3c9b1126e8ff 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeBindableLayoutGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeBindableLayoutGallery.xaml.cs @@ -1,10 +1,12 @@ using System.Collections.ObjectModel; using System.Windows.Input; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeBindableLayoutGallery : ContentPage { public SwipeBindableLayoutGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeCarouselViewGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeCarouselViewGallery.xaml.cs index ba62ed0f21c9..2dec36f9fbec 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeCarouselViewGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeCarouselViewGallery.xaml.cs @@ -1,8 +1,10 @@ using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeCarouselViewGallery : ContentPage { public SwipeCarouselViewGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeHorizontalCollectionViewGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeHorizontalCollectionViewGallery.xaml.cs index b518166f2dcf..746f3de500dc 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeHorizontalCollectionViewGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeHorizontalCollectionViewGallery.xaml.cs @@ -1,8 +1,10 @@ using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeHorizontalCollectionViewGallery : ContentPage { public SwipeHorizontalCollectionViewGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeListViewGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeListViewGallery.xaml.cs index 6047941edc4b..b938e2733d57 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeListViewGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeListViewGallery.xaml.cs @@ -1,8 +1,10 @@ using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeListViewGallery : ContentPage { public SwipeListViewGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeVerticalCollectionViewGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeVerticalCollectionViewGallery.xaml.cs index 74423d60503b..a25ad193fff6 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeVerticalCollectionViewGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeVerticalCollectionViewGallery.xaml.cs @@ -1,8 +1,10 @@ using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeVerticalCollectionViewGallery : ContentPage { public SwipeVerticalCollectionViewGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewBindingContextGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewBindingContextGallery.xaml.cs index b040bb4ba9ef..04a50a848379 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewBindingContextGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewBindingContextGallery.xaml.cs @@ -1,10 +1,12 @@ using System.Collections.ObjectModel; using System.Windows.Input; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeViewBindingContextGallery : ContentPage { public SwipeViewBindingContextGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewGestureRecognizerGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewGestureRecognizerGallery.xaml.cs index 0d2f3a29740b..aaebd8f0a586 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewGestureRecognizerGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewGestureRecognizerGallery.xaml.cs @@ -1,5 +1,8 @@ -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries +using Microsoft.Maui.Controls.Xaml; + +namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeViewGestureRecognizerGallery : ContentPage { public SwipeViewGestureRecognizerGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewVisualStatesCollectionGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewVisualStatesCollectionGallery.xaml.cs index aceb57d8037d..f7b1b205378d 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewVisualStatesCollectionGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/SwipeViewVisualStatesCollectionGallery.xaml.cs @@ -1,5 +1,8 @@ -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries +using Microsoft.Maui.Controls.Xaml; + +namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class SwipeViewVisualStatesCollectionGallery : ContentPage { public SwipeViewVisualStatesCollectionGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/VerticalSwipeThresholdGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/VerticalSwipeThresholdGallery.xaml.cs index 9ac2f4c94b3c..c08c55ca57f8 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/VerticalSwipeThresholdGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/SwipeViewGalleries/VerticalSwipeThresholdGallery.xaml.cs @@ -1,5 +1,8 @@ -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries +using Microsoft.Maui.Controls.Xaml; + +namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.SwipeViewGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class VerticalSwipeThresholdGallery : ContentPage { public VerticalSwipeThresholdGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/DualScreenStateTriggerGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/DualScreenStateTriggerGallery.xaml.cs index d70e8dc26956..0ce5f1b30aaa 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/DualScreenStateTriggerGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/DualScreenStateTriggerGallery.xaml.cs @@ -1,5 +1,8 @@ -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.VisualStateManagerGalleries +using Microsoft.Maui.Controls.Xaml; + +namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.VisualStateManagerGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class DualScreenStateTriggerGallery : ContentPage { public DualScreenStateTriggerGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggerEventsGallery.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggerEventsGallery.xaml.cs index f27e26dbd282..abe145bfb057 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggerEventsGallery.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggerEventsGallery.xaml.cs @@ -1,8 +1,10 @@ using System; using System.Windows.Input; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.VisualStateManagerGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class StateTriggerEventsGallery : ContentPage { public StateTriggerEventsGallery() diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggersDirectlyOnElements.xaml.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggersDirectlyOnElements.xaml.cs index fe3e5b6c9103..9b2956b4ae72 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggersDirectlyOnElements.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/VisualStateManagerGalleries/StateTriggersDirectlyOnElements.xaml.cs @@ -1,7 +1,9 @@ using System.Windows.Input; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.VisualStateManagerGalleries { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class StateTriggersDirectlyOnElements : ContentPage { public StateTriggersDirectlyOnElements() diff --git a/src/Compatibility/ControlGallery/src/Core/HanselForms/BlogPage.xaml.cs b/src/Compatibility/ControlGallery/src/Core/HanselForms/BlogPage.xaml.cs index fcd7ab7f94d5..462fae6b22fe 100644 --- a/src/Compatibility/ControlGallery/src/Core/HanselForms/BlogPage.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/HanselForms/BlogPage.xaml.cs @@ -7,9 +7,11 @@ using System.Threading.Tasks; using System.Xml.Linq; using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class BlogPage : ContentPage { diff --git a/src/Compatibility/ControlGallery/src/Core/HanselForms/TwitterPage.xaml.cs b/src/Compatibility/ControlGallery/src/Core/HanselForms/TwitterPage.xaml.cs index 2b313ce1b365..563a0b9c7d6a 100644 --- a/src/Compatibility/ControlGallery/src/Core/HanselForms/TwitterPage.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/HanselForms/TwitterPage.xaml.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Threading.Tasks; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class TwitterPage : ContentPage { diff --git a/src/Compatibility/ControlGallery/src/Core/LegacyRepro/Page1.xaml.cs b/src/Compatibility/ControlGallery/src/Core/LegacyRepro/Page1.xaml.cs index 85c079132e07..8c5292d1dbf5 100644 --- a/src/Compatibility/ControlGallery/src/Core/LegacyRepro/Page1.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/LegacyRepro/Page1.xaml.cs @@ -7,9 +7,12 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml; + namespace App2 { + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Page1 : ContentPage { public Page1() diff --git a/src/Compatibility/ControlGallery/src/Core/XamStore/Views/DemoShellPage.xaml.cs b/src/Compatibility/ControlGallery/src/Core/XamStore/Views/DemoShellPage.xaml.cs index 886242947f94..f847c6f29499 100644 --- a/src/Compatibility/ControlGallery/src/Core/XamStore/Views/DemoShellPage.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Core/XamStore/Views/DemoShellPage.xaml.cs @@ -10,6 +10,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.XamStore { [Preserve(AllMembers = true)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class DemoShellPage : ContentPage { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29107.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29107.xaml.cs index 752206791b9b..0c8eaf582043 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29107.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29107.xaml.cs @@ -1,5 +1,6 @@ using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { @@ -8,6 +9,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Bugzilla, 29107, "Xamarin.Android ScrollView text overlaps", PlatformAffected.Android)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Bugzilla29107 : TestContentPage { public Bugzilla29107() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45284.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45284.xaml.cs index 39b42cf3f418..f52594f061d4 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45284.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45284.xaml.cs @@ -4,6 +4,7 @@ using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { @@ -13,6 +14,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Bugzilla, 45284, "[iOS10] Extra tab icons display in iOS when binding Title on TabbedPage", PlatformAffected.iOS)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Bugzilla45284 : TabbedPage { public Bugzilla45284() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla54977.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla54977.xaml.cs index c63fe44109a6..c0e79943782f 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla54977.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla54977.xaml.cs @@ -1,5 +1,6 @@ using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { @@ -9,6 +10,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Bugzilla, 54977, "Toolbaritems do not appear", PlatformAffected.Android, NavigationBehavior.PushAsync)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Bugzilla54977 : ContentPage { string _prefix; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue12910.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue12910.xaml.cs index 82e4edcbd19f..d9f5dcd80bf4 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue12910.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue12910.xaml.cs @@ -5,6 +5,7 @@ using System.Windows.Input; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; #if UITEST using Xamarin.UITest; @@ -21,6 +22,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues [Issue(IssueTracker.Github, 12910, "[Bug] 'Cannot access a disposed object. Object name: 'DefaultRenderer' - on ios with CollectionView and EmptyView", PlatformAffected.iOS)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue12910 : TestContentPage { readonly Issue12910ViewModel _viewModel; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653.xaml.cs index 6a36291c409f..386032319386 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653.xaml.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Maui.Controls.Xaml; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; @@ -16,6 +17,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 1653, "ScrollView exceeding bounds", PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.WinPhone)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue1653 : ContentPage { public Issue1653() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653v2.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653v2.xaml.cs index 2d9f8e707bf5..16561708a062 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653v2.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1653v2.xaml.cs @@ -3,6 +3,7 @@ using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { @@ -12,6 +13,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 1653, "ScrollView exceeding bounds - v2", PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.WinPhone)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue1653v2 : ContentPage { public Issue1653v2() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2282.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2282.xaml.cs index 7ba0bfd0e3c6..fba62c0b145f 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2282.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2282.xaml.cs @@ -8,12 +8,14 @@ using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { #if APP [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 2282, "ListView ItemTapped issue on Windows phone", PlatformAffected.WinPhone)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue2282 : ContentPage { public Issue2282() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2357.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2357.xaml.cs index a1b66609beeb..39f020b865c0 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2357.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2357.xaml.cs @@ -8,6 +8,8 @@ using System.Threading.Tasks; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; + #if UITEST using Xamarin.UITest; using NUnit.Framework; @@ -24,6 +26,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues // this doesn't fail on Uwp but it leaves a browser window open and breaks later tests [Category(UITestCategories.UwpIgnore)] #endif + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue2357 : FlyoutPage { public Issue2357() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2951.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2951.xaml.cs index 525503ffac3a..1b3144b40df0 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2951.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2951.xaml.cs @@ -6,6 +6,7 @@ using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; #if UITEST using Xamarin.UITest.Queries; @@ -23,6 +24,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 2951, "On Android, button background is not updated when color changes ")] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue2951 : TestContentPage { public Issue2951() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8715.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8715.xaml.cs index 21c5dfbcab79..72fce198f1ba 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8715.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8715.xaml.cs @@ -12,6 +12,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { [Issue(IssueTracker.Github, 8715, "NullReferenceException Microsoft.Maui.Controls.Platform.iOS.StructuredItemsViewRenderer [Bug]", PlatformAffected.iOS)] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Issue8715 : TestShell { public Issue8715() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/RectTest.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/RectTest.xaml.cs index 889d9b361ec4..7849e5de7e2c 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/RectTest.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/RectTest.xaml.cs @@ -1,5 +1,6 @@ using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; #if UITEST using Xamarin.UITest; @@ -11,6 +12,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues [Preserve(AllMembers = true)] [Issue(IssueTracker.None, 1, "Using Rect struct to position items")] + [XamlCompilation(XamlCompilationOptions.Skip)] public partial class RectTest : TestContentPage { public RectTest() diff --git a/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj b/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj index a1e32fe7f146..3de8c2a659a9 100644 --- a/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj +++ b/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj @@ -66,6 +66,9 @@ {57b8b73d-c3b5-4c42-869e-7b2f17d354ac} Controls.Core + + Controls.Xaml + {d816b818-f58f-4738-93ae-924efab7a07f} Controls.CustomAttributes diff --git a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj index b7b9d2a2d44a..8c08f435ceca 100644 --- a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj +++ b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj @@ -72,6 +72,9 @@ {de354790-6107-468a-b388-e1eff1416240} Controls.Maps-net6 + + Controls.Xaml-net6 + {af64451f-e2bd-41c2-b083-f60c26ae2a9f} Controls.Core-net6 diff --git a/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj b/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj index 9a011e4d1c83..3db84bf9e278 100644 --- a/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj +++ b/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj @@ -66,6 +66,9 @@ {57b8b73d-c3b5-4c42-869e-7b2f17d354ac} Controls.Core + + Controls.Xaml + {d816b818-f58f-4738-93ae-924efab7a07f} Controls.CustomAttributes diff --git a/src/Controls/src/Build.Tasks/XamlCTask.cs b/src/Controls/src/Build.Tasks/XamlCTask.cs index 578c246f5e7f..e7cf50be8062 100644 --- a/src/Controls/src/Build.Tasks/XamlCTask.cs +++ b/src/Controls/src/Build.Tasks/XamlCTask.cs @@ -18,12 +18,7 @@ public class XamlCTask : XamlTask bool hasCompiledXamlResources; public bool KeepXamlResources { get; set; } public bool OptimizeIL { get; set; } - - [Obsolete("OutputGeneratedILAsCode is obsolete as of version 2.3.4. This option is no longer available.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public bool OutputGeneratedILAsCode { get; set; } - - public bool CompileByDefault { get; set; } + public bool DefaultCompile { get; set; } public bool ForceCompile { get; set; } public IAssemblyResolver DefaultAssemblyResolver { get; set; } @@ -41,7 +36,7 @@ public override bool Execute(out IList thrownExceptions) { thrownExceptions = null; LoggingHelper.LogMessage(Normal, $"{new string(' ', 0)}Compiling Xaml, assembly: {Assembly}"); - var skipassembly = !CompileByDefault; + var skipassembly = !DefaultCompile; bool success = true; if (!File.Exists(Assembly)) @@ -226,11 +221,6 @@ public override bool Execute(out IList thrownExceptions) initComp.Body.Optimize(); LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); } - -#pragma warning disable 0618 - if (OutputGeneratedILAsCode) - LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Decompiling option has been removed. Use a 3rd party decompiler to admire the beauty of the IL generated"); -#pragma warning restore 0618 resourcesToPrune.Add(resource); } if (hasCompiledXamlResources) From 4898b16684b71b60d27168455afb1123fc6a7b21 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Tue, 29 Jun 2021 07:29:51 -0500 Subject: [PATCH 05/16] Add FlexBasisTypeConverter to KnownConverters --- src/Controls/src/Core/TypeConverterAttribute.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Controls/src/Core/TypeConverterAttribute.cs b/src/Controls/src/Core/TypeConverterAttribute.cs index f413cbf19b73..679ba526d80b 100644 --- a/src/Controls/src/Core/TypeConverterAttribute.cs +++ b/src/Controls/src/Core/TypeConverterAttribute.cs @@ -35,6 +35,7 @@ using Microsoft.Maui.Controls.Shapes; using Microsoft.Maui.Graphics; using Rectangle = Microsoft.Maui.Graphics.Rectangle; +using Microsoft.Maui.Layouts; namespace Microsoft.Maui.Controls { @@ -57,6 +58,7 @@ public sealed class TypeConverterAttribute : Attribute { typeof(Point), typeof(PointTypeConverter) }, { typeof(PointCollection), typeof(PointCollectionConverter) }, { typeof(DoubleCollection), typeof(DoubleCollectionConverter) }, + { typeof(FlexBasis), typeof(FlexBasisTypeConverter) }, }; public static readonly TypeConverterAttribute Default = new TypeConverterAttribute(); From f1b60b67292b998dce27b23b268082b65e0095bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:22:07 +0100 Subject: [PATCH 06/16] Automated dotnet-format update (#1486) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../Controls.Sample/Pages/Base/BasePage.cs | 4 +-- .../Pages/CompatibilityPage.xaml.cs | 12 ++++----- .../Controls/ActivityIndicatorPage.xaml.cs | 14 +++++----- .../Pages/Controls/EditorPage.xaml.cs | 14 +++++----- .../Pages/Controls/EntryPage.xaml.cs | 14 +++++----- .../Pages/ControlsPage.xaml.cs | 14 +++++----- .../Pages/CustomNavigationPage.xaml.cs | 14 +++++----- .../Layouts/HorizontalStackLayoutPage.xaml.cs | 2 +- .../Controls.Sample/Pages/LayoutsPage.xaml.cs | 14 +++++----- .../Pages/Others/GraphicsViewPage.xaml.cs | 2 +- .../Controls.Sample/Pages/OthersPage.xaml.cs | 14 +++++----- .../samples/Controls.Sample/Startup.cs | 10 +++---- .../ViewModels/CompatibilityViewModel.cs | 2 +- .../ViewModels/ControlsViewModel.cs | 2 +- .../ViewModels/MainViewModel.cs | 4 +-- .../ViewModels/OthersViewModel.cs | 2 +- .../ViewModels/RefreshViewModel.cs | 6 ++--- .../samples/Controls.Sample/XamlApp.xaml.cs | 2 +- src/Controls/src/Core/Application.cs | 2 +- .../src/Core/HandlerImpl/Window.Impl.cs | 2 +- .../src/Core/HandlerImpl/Window.Standard.cs | 2 +- .../ModalNavigationService.Android.cs | 26 +++++++++---------- .../ModalNavigationService.Standard.cs | 2 +- .../ModalNavigationService.iOS.cs | 2 +- src/Essentials/samples/Samples/App.xaml.cs | 2 +- 25 files changed, 92 insertions(+), 92 deletions(-) diff --git a/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs b/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs index ab5909b1615c..a410f211ba2a 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs @@ -1,9 +1,9 @@ using System; +using System.Diagnostics; using System.Windows.Input; +using Maui.Controls.Sample.Models; using Microsoft.Maui; using Microsoft.Maui.Controls; -using Maui.Controls.Sample.Models; -using System.Diagnostics; namespace Maui.Controls.Sample.Pages.Base { diff --git a/src/Controls/samples/Controls.Sample/Pages/CompatibilityPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/CompatibilityPage.xaml.cs index 7d904500cd29..397cdc4357bd 100644 --- a/src/Controls/samples/Controls.Sample/Pages/CompatibilityPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/CompatibilityPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class CompatibilityPage + public partial class CompatibilityPage { - public CompatibilityPage() - { - InitializeComponent(); - } - } + public CompatibilityPage() + { + InitializeComponent(); + } + } } diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/ActivityIndicatorPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/ActivityIndicatorPage.xaml.cs index 72e86d68a1b9..836a6a2d37a6 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/ActivityIndicatorPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/ActivityIndicatorPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class ActivityIndicatorPage - { - public ActivityIndicatorPage() - { - InitializeComponent(); - } - } + public partial class ActivityIndicatorPage + { + public ActivityIndicatorPage() + { + InitializeComponent(); + } + } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/EditorPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/EditorPage.xaml.cs index 1e56e5174ff3..1ee2b9fef419 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/EditorPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/EditorPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class EditorPage - { - public EditorPage() - { - InitializeComponent(); - } - } + public partial class EditorPage + { + public EditorPage() + { + InitializeComponent(); + } + } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/EntryPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/EntryPage.xaml.cs index 5fdbe0122b1e..4669888778d4 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/EntryPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/EntryPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class EntryPage - { - public EntryPage() - { - InitializeComponent(); - } - } + public partial class EntryPage + { + public EntryPage() + { + InitializeComponent(); + } + } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Pages/ControlsPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/ControlsPage.xaml.cs index bd24e2981fa3..df21e1e002f7 100644 --- a/src/Controls/samples/Controls.Sample/Pages/ControlsPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/ControlsPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class ControlsPage - { - public ControlsPage() - { - InitializeComponent(); - } - } + public partial class ControlsPage + { + public ControlsPage() + { + InitializeComponent(); + } + } } diff --git a/src/Controls/samples/Controls.Sample/Pages/CustomNavigationPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/CustomNavigationPage.xaml.cs index c7b435b27ae1..59d9658d952e 100644 --- a/src/Controls/samples/Controls.Sample/Pages/CustomNavigationPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/CustomNavigationPage.xaml.cs @@ -1,15 +1,15 @@ using System; -using Microsoft.Maui.Controls; using Maui.Controls.Sample.ViewModels; +using Microsoft.Maui.Controls; namespace Maui.Controls.Sample.Pages { - public partial class CustomNavigationPage : NavigationPage - { + public partial class CustomNavigationPage : NavigationPage + { public CustomNavigationPage(IServiceProvider services, MainViewModel viewModel) : - base(new MainPage(services, viewModel)) + base(new MainPage(services, viewModel)) { - InitializeComponent(); - } - } + InitializeComponent(); + } + } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/HorizontalStackLayoutPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Layouts/HorizontalStackLayoutPage.xaml.cs index b4c5822cf49c..47e4613e6498 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Layouts/HorizontalStackLayoutPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/HorizontalStackLayoutPage.xaml.cs @@ -1,6 +1,6 @@ namespace Maui.Controls.Sample.Pages { - public partial class HorizontalStackLayoutPage + public partial class HorizontalStackLayoutPage { public HorizontalStackLayoutPage() { diff --git a/src/Controls/samples/Controls.Sample/Pages/LayoutsPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/LayoutsPage.xaml.cs index 661987ce25d9..70a0b196c31e 100644 --- a/src/Controls/samples/Controls.Sample/Pages/LayoutsPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/LayoutsPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class LayoutsPage - { - public LayoutsPage() - { - InitializeComponent(); - } - } + public partial class LayoutsPage + { + public LayoutsPage() + { + InitializeComponent(); + } + } } diff --git a/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs index 95ac52fed810..b716896ee353 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs @@ -151,7 +151,7 @@ public void Draw(ICanvas canvas, RectangleF dirtyRect) canvas.StrokeDashPattern = new float[] { 2, 2 }; canvas.DrawLine(650, 140, 800, 140); - canvas.StrokeDashPattern = new float[] { 4, 4, 1, 4}; + canvas.StrokeDashPattern = new float[] { 4, 4, 1, 4 }; canvas.DrawLine(650, 160, 800, 160); canvas.StrokeDashPattern = null; diff --git a/src/Controls/samples/Controls.Sample/Pages/OthersPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/OthersPage.xaml.cs index 72ceea8c73ac..e70420e9f200 100644 --- a/src/Controls/samples/Controls.Sample/Pages/OthersPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/OthersPage.xaml.cs @@ -1,10 +1,10 @@ namespace Maui.Controls.Sample.Pages { - public partial class OthersPage - { - public OthersPage() - { - InitializeComponent(); - } - } + public partial class OthersPage + { + public OthersPage() + { + InitializeComponent(); + } + } } diff --git a/src/Controls/samples/Controls.Sample/Startup.cs b/src/Controls/samples/Controls.Sample/Startup.cs index d58491af9df0..e446eee1e071 100644 --- a/src/Controls/samples/Controls.Sample/Startup.cs +++ b/src/Controls/samples/Controls.Sample/Startup.cs @@ -1,20 +1,20 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using Maui.Controls.Sample.Controls; using Maui.Controls.Sample.Pages; using Maui.Controls.Sample.Services; +using Maui.Controls.Sample.ViewModels; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Microsoft.Maui; +using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility; using Microsoft.Maui.Controls.Hosting; using Microsoft.Maui.Essentials; using Microsoft.Maui.Hosting; using Microsoft.Maui.LifecycleEvents; -using Microsoft.Maui.Controls; -using Maui.Controls.Sample.Controls; -using Maui.Controls.Sample.ViewModels; #if NET6_0_OR_GREATER using Microsoft.AspNetCore.Components.WebView.Maui; @@ -99,7 +99,7 @@ public void Configure(IAppHostBuilder appBuilder) PageType.Shell => typeof(AppShell), #if WINDOWS PageType.Main => typeof(TempPage), -#else +#else PageType.Main => typeof(CustomNavigationPage), #endif PageType.Blazor => diff --git a/src/Controls/samples/Controls.Sample/ViewModels/CompatibilityViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/CompatibilityViewModel.cs index 12126591a227..9043c6b3d0f9 100644 --- a/src/Controls/samples/Controls.Sample/ViewModels/CompatibilityViewModel.cs +++ b/src/Controls/samples/Controls.Sample/ViewModels/CompatibilityViewModel.cs @@ -20,7 +20,7 @@ protected override IEnumerable CreateItems() => new[] new SectionModel(typeof(CarouselViewPage), "CarouselView", "CarouselView displays a scrollable list of data items."), - + new SectionModel(typeof(FramePage), "Frame", "The Frame class derives from ContentView and displays a border, or frame, around its child."), diff --git a/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs index ee6e7e525534..fc1c2fa8a623 100644 --- a/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs +++ b/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Maui.Controls.Sample.Models; -using Maui.Controls.Sample.ViewModels.Base; using Maui.Controls.Sample.Pages; +using Maui.Controls.Sample.ViewModels.Base; namespace Maui.Controls.Sample.ViewModels { diff --git a/src/Controls/samples/Controls.Sample/ViewModels/MainViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/MainViewModel.cs index c42b0ffd2790..7082843f047f 100644 --- a/src/Controls/samples/Controls.Sample/ViewModels/MainViewModel.cs +++ b/src/Controls/samples/Controls.Sample/ViewModels/MainViewModel.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Extensions.Configuration; using Maui.Controls.Sample.Models; -using Maui.Controls.Sample.ViewModels.Base; using Maui.Controls.Sample.Pages; using Maui.Controls.Sample.Services; +using Maui.Controls.Sample.ViewModels.Base; +using Microsoft.Extensions.Configuration; namespace Maui.Controls.Sample.ViewModels { diff --git a/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs index f0e370b62f93..aaf28277aaea 100644 --- a/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs +++ b/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Maui.Controls.Sample.Models; -using Maui.Controls.Sample.ViewModels.Base; using Maui.Controls.Sample.Pages; +using Maui.Controls.Sample.ViewModels.Base; namespace Maui.Controls.Sample.ViewModels { diff --git a/src/Controls/samples/Controls.Sample/ViewModels/RefreshViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/RefreshViewModel.cs index bba54080e3c0..551f792a89e1 100644 --- a/src/Controls/samples/Controls.Sample/ViewModels/RefreshViewModel.cs +++ b/src/Controls/samples/Controls.Sample/ViewModels/RefreshViewModel.cs @@ -1,12 +1,12 @@ using System; -using System.ComponentModel; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Runtime.CompilerServices; -using System.Windows.Input; using System.Threading.Tasks; +using System.Windows.Input; +using Controls.Sample.Models; using Microsoft.Maui.Controls; using Microsoft.Maui.Graphics; -using Controls.Sample.Models; namespace Maui.Controls.Sample.ViewModels { diff --git a/src/Controls/samples/Controls.Sample/XamlApp.xaml.cs b/src/Controls/samples/Controls.Sample/XamlApp.xaml.cs index 84deb15d2a42..3b3c9deef4b5 100644 --- a/src/Controls/samples/Controls.Sample/XamlApp.xaml.cs +++ b/src/Controls/samples/Controls.Sample/XamlApp.xaml.cs @@ -12,7 +12,7 @@ public partial class XamlApp : Application public XamlApp(IServiceProvider services, ITextService textService) { InitializeComponent(); - + Services = services; Debug.WriteLine($"The AccentColor color is {Resources["AccentColor"]}"); diff --git a/src/Controls/src/Core/Application.cs b/src/Controls/src/Core/Application.cs index 57166516c3f4..f12d308ac215 100644 --- a/src/Controls/src/Core/Application.cs +++ b/src/Controls/src/Core/Application.cs @@ -408,7 +408,7 @@ internal void OnPageAppearing(Page page) internal void OnPageDisappearing(Page page) => PageDisappearing?.Invoke(this, page); - + async Task SetPropertiesAsync() { await SaveSemaphore.WaitAsync(); diff --git a/src/Controls/src/Core/HandlerImpl/Window.Impl.cs b/src/Controls/src/Core/HandlerImpl/Window.Impl.cs index 4d052baaf196..2dc80f7f5862 100644 --- a/src/Controls/src/Core/HandlerImpl/Window.Impl.cs +++ b/src/Controls/src/Core/HandlerImpl/Window.Impl.cs @@ -20,7 +20,7 @@ public partial class Window : VisualElement, IWindow internal override ReadOnlyCollection LogicalChildrenInternal => _logicalChildren ??= new ReadOnlyCollection(InternalChildren); - internal IMauiContext MauiContext => Page?.Handler?.MauiContext + internal IMauiContext MauiContext => Page?.Handler?.MauiContext ?? throw new InvalidOperationException("MauiContext is null"); internal ModalNavigationService ModalNavigationService { get; } diff --git a/src/Controls/src/Core/HandlerImpl/Window.Standard.cs b/src/Controls/src/Core/HandlerImpl/Window.Standard.cs index e8cbf96f4f39..33b4759d1605 100644 --- a/src/Controls/src/Core/HandlerImpl/Window.Standard.cs +++ b/src/Controls/src/Core/HandlerImpl/Window.Standard.cs @@ -7,7 +7,7 @@ namespace Microsoft.Maui.Controls { public partial class Window - { + { void SetupNativeService(Page? page) { throw new NotImplementedException(); diff --git a/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Android.cs b/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Android.cs index 1fc30830f89d..09de996de89c 100644 --- a/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Android.cs +++ b/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Android.cs @@ -2,16 +2,16 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text; using System.Threading.Tasks; using Android.Content; +using Android.Runtime; using Android.Views; -using Microsoft.Maui.Graphics; -using AView = Android.Views.View; using Android.Views.Animations; -using System.ComponentModel; using AndroidX.Activity; -using Android.Runtime; +using Microsoft.Maui.Graphics; +using AView = Android.Views.View; namespace Microsoft.Maui.Controls.Platform { @@ -68,16 +68,16 @@ public Task PopModalAsync(bool animated) modalContainer .Animate()?.TranslationY(_renderer.Height)? .SetInterpolator(new AccelerateInterpolator(1))?.SetDuration(300)?.SetListener(new GenericAnimatorListener - { - OnEnd = a => { - modalContainer.RemoveFromParent(); - modalContainer.Dispose(); - source.TrySetResult(modal); - CurrentPageController?.SendAppearing(); - modalContainer = null; - } - }); + OnEnd = a => + { + modalContainer.RemoveFromParent(); + modalContainer.Dispose(); + source.TrySetResult(modal); + CurrentPageController?.SendAppearing(); + modalContainer = null; + } + }); } else { diff --git a/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Standard.cs b/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Standard.cs index c984abca971a..23ead192620c 100644 --- a/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Standard.cs +++ b/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.Standard.cs @@ -9,7 +9,7 @@ namespace Microsoft.Maui.Controls.Platform { internal partial class ModalNavigationService { - public Task PopModalAsync(bool animated) + public Task PopModalAsync(bool animated) { throw new NotImplementedException(); } diff --git a/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.iOS.cs b/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.iOS.cs index ee3c16d4e66f..0b9f0b9be312 100644 --- a/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.iOS.cs +++ b/src/Controls/src/Core/Platform/ModalNavigationService/ModalNavigationService.iOS.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using UIKit; namespace Microsoft.Maui.Controls.Platform diff --git a/src/Essentials/samples/Samples/App.xaml.cs b/src/Essentials/samples/Samples/App.xaml.cs index 798193b48783..f2e5cb96d7bb 100644 --- a/src/Essentials/samples/Samples/App.xaml.cs +++ b/src/Essentials/samples/Samples/App.xaml.cs @@ -26,7 +26,7 @@ public App() InitializeComponent(); VersionTracking.Track(); - + MainPage = new NavigationPage(new HomePage()); try { From 99479d60ccd2690887bd881e2ee8708031eec0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 29 Jun 2021 17:50:27 +0200 Subject: [PATCH 07/16] Implement TextColor property in DatePickerHandlers (#1459) * Implement TextColor property in DatePickerHandlers * [Sample] Add DatePicker with TextColor Co-authored-by: Rui Marinho --- .../Pages/Controls/DatePickerPage.xaml | 6 +++- .../DatePicker/DatePickerHandler.Android.cs | 19 ++++++----- .../DatePicker/DatePickerHandler.iOS.cs | 15 +++++++-- .../Platform/Android/DatePickerExtensions.cs | 33 +++++++++++++++++++ .../src/Platform/iOS/DatePickerExtensions.cs | 13 ++++++++ .../DatePickerHandlerTests.Android.cs | 11 ++++++- .../DatePicker/DatePickerHandlerTests.cs | 13 ++++++++ .../DatePicker/DatePickerHandlerTests.iOS.cs | 6 +++- 8 files changed, 102 insertions(+), 14 deletions(-) diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/DatePickerPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/DatePickerPage.xaml index 9aa8cedce270..fdbf7990824e 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/DatePickerPage.xaml +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/DatePickerPage.xaml @@ -16,6 +16,10 @@ Style="{StaticResource Headline}"/> +