diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index efd6fbe9b113..edb70cab2421 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.22531.1",
+ "version": "1.0.0-prerelease.22569.1",
"commands": [
"xharness"
]
diff --git a/.github/workflows/dotnet-autoformat-pr.yml b/.github/workflows/dotnet-autoformat-pr.yml
index 8333354d0072..f5625114c39a 100644
--- a/.github/workflows/dotnet-autoformat-pr.yml
+++ b/.github/workflows/dotnet-autoformat-pr.yml
@@ -12,6 +12,7 @@ jobs:
steps:
- name: 'Autoformat'
- uses: rolfbjarne/autoformat@v0.1
+ uses: rolfbjarne/autoformat@v0.2
with:
- projects: "Microsoft.Maui.sln"
\ No newline at end of file
+ projects: "Microsoft.Maui.sln"
+ onlyFilesModifiedInPullRequest: true
diff --git a/.github/workflows/dotnet-format-daily.yml b/.github/workflows/dotnet-format-daily.yml
index eb1806e80ebf..746572d877d4 100644
--- a/.github/workflows/dotnet-format-daily.yml
+++ b/.github/workflows/dotnet-format-daily.yml
@@ -18,7 +18,7 @@ jobs:
ref: ${{ github.head_ref }}
- name: Run dotnet format
- run: dotnet format whitespace ./src --folder --exclude Templates/src
+ run: dotnet format whitespace ./src --folder --exclude Templates/src BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs Graphics/src/Graphics.Win2D/W2DCanvas.cs Graphics/src/Graphics.Win2D/W2DExtensions.cs
- name: Commit files
if: steps.format.outputs.has-changes == 'true'
diff --git a/.nuspec/Microsoft.Maui.Controls.targets b/.nuspec/Microsoft.Maui.Controls.targets
index dc1e84f73a81..afbfa45a65e3 100644
--- a/.nuspec/Microsoft.Maui.Controls.targets
+++ b/.nuspec/Microsoft.Maui.Controls.targets
@@ -11,7 +11,6 @@
true
false
- True
diff --git a/Directory.Build.props b/Directory.Build.props
index 0543ceb45135..cccc263c3431 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -150,7 +150,7 @@
-
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
index b09a7de6ec0b..70e0848283db 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -70,7 +70,7 @@
-
+
- 1.1.5
- 10.0.22621.1
+ 1.2.221116.1
+ 10.0.22621.755
1.0.4
7.0.0
@@ -61,9 +61,9 @@
<_HarfBuzzSharpVersion>2.8.2.2
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.193b587552cb0ed39372a049d7e6c692db98c267.483
7.0.100-preview.5.22226.1
- 1.0.0-prerelease.22531.1
- 1.0.0-prerelease.22531.1
- 1.0.0-prerelease.22531.1
+ 1.0.0-prerelease.22569.1
+ 1.0.0-prerelease.22569.1
+ 1.0.0-prerelease.22569.1
0.9.0
0.5.13
1.2.0
diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake
index 4b6b6e87ac68..fb1127f7cb4a 100644
--- a/eng/cake/dotnet.cake
+++ b/eng/cake/dotnet.cake
@@ -324,13 +324,16 @@ Task("dotnet-pack-docs")
CleanDirectories(destDir);
// Get the docs for .NET MAUI
- foreach (var nupkg in GetFiles("./artifacts/Microsoft.Maui.*.Ref.*.nupkg"))
+ foreach (var nupkg in GetFiles("./artifacts/Microsoft.Maui.*.Ref.any.*.nupkg"))
{
var d = $"{tempDir}/{nupkg.GetFilename()}";
+
Unzip(nupkg, d);
DeleteFiles($"{d}/**/*.pri");
DeleteFiles($"{d}/**/*.aar");
- CopyDirectory($"{d}/ref", $"{destDir}");
+ DeleteFiles($"{d}/**/*.DesignTools.*");
+ CopyFiles($"{d}/ref/**/net?.?/**/*.dll", $"{destDir}");
+ CopyFiles($"{d}/ref/**/net?.?/**/*.xml", $"{destDir}");
}
// Get the docs for libraries separately distributed as NuGets
@@ -343,7 +346,8 @@ Task("dotnet-pack-docs")
DeleteFiles($"{d}/**/*.pri");
DeleteFiles($"{d}/**/*.aar");
DeleteFiles($"{d}/**/*.pdb");
- CopyDirectory($"{d}/lib", $"{destDir}");
+ CopyFiles($"{d}/lib/**/{{net,netstandard}}?.?/**/*.dll", $"{destDir}");
+ CopyFiles($"{d}/lib/**/{{net,netstandard}}?.?/**/*.xml", $"{destDir}");
}
}
diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml
index 9617544c0932..603f06e892d1 100644
--- a/eng/pipelines/common/device-tests-steps.yml
+++ b/eng/pipelines/common/device-tests-steps.yml
@@ -4,6 +4,7 @@ parameters:
device: '' # the xharness device to use
cakeArgs: '' # additional cake args
provisionatorChannel: 'latest'
+ agentPoolAccessToken: ''
steps:
- template: provision.yml
@@ -42,3 +43,8 @@ steps:
condition: always()
inputs:
artifactName: $(System.PhaseName)
+
+ # This must always be placed as the last step in the job
+ - template: agent-rebooter/mac.v1.yml@yaml-templates
+ parameters:
+ AgentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
diff --git a/eng/pipelines/common/device-tests.yml b/eng/pipelines/common/device-tests.yml
index 560c218028a8..886b0abd38cf 100644
--- a/eng/pipelines/common/device-tests.yml
+++ b/eng/pipelines/common/device-tests.yml
@@ -4,6 +4,7 @@ parameters:
androidApiLevels: [ 33 ]
iosVersions: [ 'latest' ]
provisionatorChannel: 'latest'
+ agentPoolAccessToken: ''
projects:
- name: name
desc: Human Description
@@ -38,6 +39,7 @@ stages:
path: ${{ project.android }}
device: android-emulator-32_${{ api }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
+ agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
- stage: ios_device_tests
displayName: iOS Device Tests
@@ -64,3 +66,4 @@ stages:
${{ if ne(version, 'latest') }}:
device: ios-simulator-64_${{ version }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
+ agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml
index a85b87b0715d..e7febf96d06b 100644
--- a/eng/pipelines/common/variables.yml
+++ b/eng/pipelines/common/variables.yml
@@ -1,6 +1,4 @@
variables:
-- name: Codeql.Enabled
- value: true
- name: BuildVersion
value: $[counter('buildversion-counter', 5000)]
- name: NUGET_VERSION
@@ -55,6 +53,11 @@ variables:
value: Maui
- name: POWERSHELL_VERSION
value: 7.1.3
+- name: Codeql.Enabled
+ value: $[and(
+ eq(variables['Build.SourceBranch'], 'refs/heads/main'),
+ eq(variables['Build.DefinitionName'], 'MAUI')
+ )]
- ${{ if ne(variables['Build.DefinitionName'], 'MAUI-private') }}:
- name: PrivateBuild
value: false
diff --git a/eng/pipelines/device-tests.yml b/eng/pipelines/device-tests.yml
index ceba5bbe20dd..efff785379ce 100644
--- a/eng/pipelines/device-tests.yml
+++ b/eng/pipelines/device-tests.yml
@@ -44,6 +44,8 @@ pr:
variables:
- template: /eng/pipelines/common/variables.yml
+ - name: AgentPoolAccessToken
+ value: $(botdeploy--azdo--token--register--xamarin-public--untrusted)
parameters:
- name: provisionatorChannel
@@ -75,13 +77,14 @@ resources:
name: xamarin/yaml-templates
endpoint: xamarin
ref: refs/heads/main
-
+
stages:
- template: common/device-tests.yml
parameters:
androidPool: ${{ parameters.androidPool }}
iosPool: ${{ parameters.iosPool }}
+ agentPoolAccessToken: $(AgentPoolAccessToken)
${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}:
androidApiLevels: [ 30, 29, 28, 27, 26, 25, 24, 23 ]
# androidApiLevels: [ 30, 29, 28, 27, 26, 25, 24, 23, 22, 21 ] # fix the issue of getting the test results off
@@ -95,18 +98,18 @@ stages:
projects:
- name: essentials
desc: Essentials
- androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
+ androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
android: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj
ios: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj
- name: core
desc: Core
- androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
+ androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
android: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj
- name: controls
desc: Controls
- androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
+ androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
@@ -116,4 +119,4 @@ stages:
android: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj
-
+
diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml
index d2b75a129807..b7f2662be1fd 100644
--- a/eng/pipelines/handlers.yml
+++ b/eng/pipelines/handlers.yml
@@ -126,13 +126,13 @@ resources:
stages:
- - stage: build_net6
+ - stage: build_net
displayName: Build .NET MAUI
dependsOn: []
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
- - job: build_net6_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
+ - job: build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
workspace:
clean: all
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
@@ -209,7 +209,7 @@ stages:
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
- - job: build_net6_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
+ - job: build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
workspace:
clean: all
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
diff --git a/eng/provisioning/provisioning.csx b/eng/provisioning/provisioning.csx
index 1e4b50e9f719..5f7a5db6cea3 100644
--- a/eng/provisioning/provisioning.csx
+++ b/eng/provisioning/provisioning.csx
@@ -88,7 +88,8 @@ if(String.IsNullOrWhiteSpace(ANDROID_API_SDKS))
// AndroidVirtualDevice.NEXUS_5X)
.SdkManagerPackage ("build-tools;33.0.0");
}
-else{
+else
+{
var androidSDK = AndroidSdk();
foreach(var sdk in ANDROID_API_SDKS.Split(','))
diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38284.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38284.cs
index e7513cb59eba..5fd45f65b0c9 100644
--- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38284.cs
+++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla38284.cs
@@ -1,10 +1,9 @@
using System;
-
using Microsoft.Maui.Controls.CustomAttributes;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Maps;
-using Microsoft.Maui.Maps;
using Microsoft.Maui.Devices.Sensors;
+using Microsoft.Maui.Maps;
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues
{
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 2c6e0241b393..d17209e6c520 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
@@ -18,7 +18,7 @@
-
+
diff --git a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj
index 2a0f6d508ab4..0e1fee4adbf5 100644
--- a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj
+++ b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj
@@ -23,7 +23,7 @@
-
+
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 ac10586cfceb..f5f4e803a5ba 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
@@ -18,7 +18,7 @@
-
+
diff --git a/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs
index 25043e633ffd..d107e627539d 100644
--- a/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs
+++ b/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs
@@ -11,8 +11,8 @@
using AndroidX.AppCompat.Widget;
using Microsoft.Maui.Controls.Platform;
using Color = Microsoft.Maui.Graphics.Color;
-using Size = Microsoft.Maui.Graphics.Size;
using SearchView = AndroidX.AppCompat.Widget.SearchView;
+using Size = Microsoft.Maui.Graphics.Size;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
{
diff --git a/src/Compatibility/Core/src/AppHostBuilderExtensions.Windows.cs b/src/Compatibility/Core/src/AppHostBuilderExtensions.Windows.cs
index 942dcf6521d5..445520ea53c7 100644
--- a/src/Compatibility/Core/src/AppHostBuilderExtensions.Windows.cs
+++ b/src/Compatibility/Core/src/AppHostBuilderExtensions.Windows.cs
@@ -1,16 +1,16 @@
#nullable enable
+using System;
+using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Compatibility.Platform.UWP;
using Microsoft.Maui.Graphics.Win2D;
+using Microsoft.Maui.Hosting;
+using Microsoft.Maui.LifecycleEvents;
using BoxRenderer = Microsoft.Maui.Controls.Compatibility.Platform.UWP.BoxViewBorderRenderer;
using CellRenderer = Microsoft.Maui.Controls.Compatibility.Platform.UWP.TextCellRenderer;
+using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.UWP.DefaultRenderer;
+using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.UWP.UriImageSourceHandler;
using ResourcesProvider = Microsoft.Maui.Controls.Compatibility.Platform.UWP.WindowsResourcesProvider;
using StreamImagesourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.UWP.StreamImageSourceHandler;
-using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.UWP.UriImageSourceHandler;
-using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.UWP.DefaultRenderer;
-using Microsoft.Maui.LifecycleEvents;
-using Microsoft.Maui.Controls.Compatibility;
-using System;
-using Microsoft.Maui.Hosting;
namespace Microsoft.Maui.Controls.Compatibility.Hosting
{
diff --git a/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs b/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs
index 13ec0f44c146..7458b4405dae 100644
--- a/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs
+++ b/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;
-using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
using Microsoft.Maui.Controls.Compatibility.Platform.UWP;
using Microsoft.Maui.Graphics;
+using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
namespace Microsoft.Maui.Controls.Compatibility
{
diff --git a/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs b/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs
index 6163c0a393c5..92547367d548 100644
--- a/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs
+++ b/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs
@@ -1,7 +1,7 @@
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using VisualElementSpecifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.VisualElement;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs b/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs
index 9ee893f7b399..af6f0b5e5172 100644
--- a/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs
@@ -1,7 +1,7 @@
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/BoxViewBorderRenderer.cs b/src/Compatibility/Core/src/Windows/BoxViewBorderRenderer.cs
index e8ff5a404388..08a2ca9d7323 100644
--- a/src/Compatibility/Core/src/Windows/BoxViewBorderRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/BoxViewBorderRenderer.cs
@@ -1,10 +1,10 @@
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
-using WShape = Microsoft.UI.Xaml.Shapes.Shape;
-using Microsoft.Maui.Controls.Platform;
using WBorder = Microsoft.UI.Xaml.Controls.Border;
+using WShape = Microsoft.UI.Xaml.Shapes.Shape;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ButtonRenderer.cs b/src/Compatibility/Core/src/Windows/ButtonRenderer.cs
index 1354e2953d6d..1ad41f2efd50 100644
--- a/src/Compatibility/Core/src/Windows/ButtonRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ButtonRenderer.cs
@@ -1,16 +1,16 @@
+using System;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media.Imaging;
using Microsoft.UI.Xaml.Input;
-using Microsoft.Maui.Controls.Internals;
+using Microsoft.UI.Xaml.Media.Imaging;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WImage = Microsoft.UI.Xaml.Controls.Image;
using WStretch = Microsoft.UI.Xaml.Media.Stretch;
using WThickness = Microsoft.UI.Xaml.Thickness;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
-using System;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs b/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs
index a9b1b0586960..8b3090ddd8a3 100644
--- a/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.Specialized;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.Internals;
using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/CellControl.cs b/src/Compatibility/Core/src/Windows/CellControl.cs
index 3e8253f1628d..54a5d5a864c6 100644
--- a/src/Compatibility/Core/src/Windows/CellControl.cs
+++ b/src/Compatibility/Core/src/Windows/CellControl.cs
@@ -2,7 +2,10 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
-using Windows.UI.Input;
+using Microsoft.Maui.Controls.Handlers.Compatibility;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
@@ -10,14 +13,11 @@
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Animation;
-using Microsoft.Maui.Controls.Internals;
+using Windows.UI.Input;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Handlers.Compatibility;
-using Microsoft.Maui.Controls.Platform;
-using WMenuFlyout = Microsoft.UI.Xaml.Controls.MenuFlyout;
using WFlyoutBase = Microsoft.UI.Xaml.Controls.Primitives.FlyoutBase;
+using WMenuFlyout = Microsoft.UI.Xaml.Controls.MenuFlyout;
+using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs b/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs
index 41df44e104be..3c7a7b026bf5 100644
--- a/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs
@@ -1,8 +1,8 @@
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/CollectionView/CollectionViewRenderer.cs b/src/Compatibility/Core/src/Windows/CollectionView/CollectionViewRenderer.cs
index d13d1dd8d135..09fee605a00e 100644
--- a/src/Compatibility/Core/src/Windows/CollectionView/CollectionViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CollectionView/CollectionViewRenderer.cs
@@ -4,12 +4,12 @@
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
-using Windows.Foundation;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
-using Microsoft.Maui.Controls.Internals;
+using Windows.Foundation;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs b/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
index 7985061f586e..8f631109c378 100644
--- a/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
+++ b/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
@@ -1,11 +1,11 @@
using System;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.Internals;
-using WThickness = Microsoft.UI.Xaml.Thickness;
using WSize = Windows.Foundation.Size;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
+using WThickness = Microsoft.UI.Xaml.Thickness;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs b/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs
index 7e55c5140549..c36be5cb7483 100644
--- a/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs
@@ -2,17 +2,17 @@
using System.Collections.Specialized;
using System.ComponentModel;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
-using Microsoft.Maui.Controls.Internals;
using UwpApp = Microsoft.UI.Xaml.Application;
using UwpDataTemplate = Microsoft.UI.Xaml.DataTemplate;
using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility;
using WRect = Windows.Foundation.Rect;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
using WVisibility = Microsoft.UI.Xaml.Visibility;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs b/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
index b2766bc3db20..dcec99e74879 100644
--- a/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
@@ -1,16 +1,16 @@
using System;
using System.ComponentModel;
using System.Linq;
-using Windows.UI.Text;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Documents;
using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Controls.Internals;
+using Windows.UI.Text;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/EditorRenderer.cs b/src/Compatibility/Core/src/Windows/EditorRenderer.cs
index 1f31a2e07085..4c203788a1cf 100644
--- a/src/Compatibility/Core/src/Windows/EditorRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/EditorRenderer.cs
@@ -1,14 +1,14 @@
using System;
using System.ComponentModel;
-using Windows.UI.Text;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
-using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.InputView;
using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Windows.UI.Text;
+using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.InputView;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/EntryCellTextBox.cs b/src/Compatibility/Core/src/Windows/EntryCellTextBox.cs
index 34b593b2ba7a..a80218f0a5ba 100644
--- a/src/Compatibility/Core/src/Windows/EntryCellTextBox.cs
+++ b/src/Compatibility/Core/src/Windows/EntryCellTextBox.cs
@@ -1,7 +1,7 @@
-using Windows.System;
+using System;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
-using System;
+using Windows.System;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/EntryRenderer.cs b/src/Compatibility/Core/src/Windows/EntryRenderer.cs
index fed472a6d5d9..42ecc9180776 100644
--- a/src/Compatibility/Core/src/Windows/EntryRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/EntryRenderer.cs
@@ -1,16 +1,16 @@
using System;
using System.ComponentModel;
-using Windows.System;
-using Windows.UI.Text;
+using Microsoft.Extensions.Logging;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
-using WBrush = Microsoft.UI.Xaml.Media.Brush;
+using Windows.System;
+using Windows.UI.Text;
using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.InputView;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
-using Microsoft.Extensions.Logging;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/Extensions/ClipExtensions.cs b/src/Compatibility/Core/src/Windows/Extensions/ClipExtensions.cs
index 2c5ed22aacf0..2b418ed26ed8 100644
--- a/src/Compatibility/Core/src/Windows/Extensions/ClipExtensions.cs
+++ b/src/Compatibility/Core/src/Windows/Extensions/ClipExtensions.cs
@@ -1,12 +1,12 @@
#pragma warning disable CS8305
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.Shapes;
using Microsoft.UI.Composition;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Hosting;
-using Microsoft.Maui.Controls.Shapes;
using WRectangleGeometry = Microsoft.UI.Xaml.Media.RectangleGeometry;
-using Microsoft.Maui.Controls.Platform;
#if UWP_18362
using WVector2 = System.Numerics.Vector2;
diff --git a/src/Compatibility/Core/src/Windows/Extensions/ImageExtensions.cs b/src/Compatibility/Core/src/Windows/Extensions/ImageExtensions.cs
index 6d8629fa5a54..f24f20c9da8c 100644
--- a/src/Compatibility/Core/src/Windows/Extensions/ImageExtensions.cs
+++ b/src/Compatibility/Core/src/Windows/Extensions/ImageExtensions.cs
@@ -1,18 +1,18 @@
using System;
-using Microsoft.Graphics.Canvas.UI.Xaml;
-using Microsoft.UI.Xaml.Media.Imaging;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
-using Windows.Foundation;
+using Microsoft.Extensions.Logging;
+using Microsoft.Graphics.Canvas.UI.Xaml;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Controls.Internals;
+using Microsoft.UI.Xaml.Media.Imaging;
+using Windows.Foundation;
using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
-using Microsoft.Maui.Controls.Platform;
-using Microsoft.Extensions.Logging;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FileImageSourceHandler.cs b/src/Compatibility/Core/src/Windows/FileImageSourceHandler.cs
index 67812728c302..e00b23e82293 100644
--- a/src/Compatibility/Core/src/Windows/FileImageSourceHandler.cs
+++ b/src/Compatibility/Core/src/Windows/FileImageSourceHandler.cs
@@ -1,11 +1,11 @@
using System;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Imaging;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using IOPath = System.IO.Path;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs b/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs
index 42e39b514247..fe245f4175c7 100644
--- a/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs
+++ b/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs
@@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
using WVisibility = Microsoft.UI.Xaml.Visibility;
diff --git a/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs b/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs
index 1b7774ac38d5..fe1539cf88c6 100644
--- a/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs
@@ -1,17 +1,17 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Devices;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
-using Microsoft.UI.Xaml.Automation.Peers;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
using WVisibility = Microsoft.UI.Xaml.Visibility;
-using Microsoft.Maui.Devices;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FormsCancelButton.cs b/src/Compatibility/Core/src/Windows/FormsCancelButton.cs
index bf140faeaf83..fa1662240e57 100644
--- a/src/Compatibility/Core/src/Windows/FormsCancelButton.cs
+++ b/src/Compatibility/Core/src/Windows/FormsCancelButton.cs
@@ -1,7 +1,7 @@
using System;
using Microsoft.UI.Xaml.Controls;
-using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WBorder = Microsoft.UI.Xaml.Controls.Border;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FormsComboBox.cs b/src/Compatibility/Core/src/Windows/FormsComboBox.cs
index ead13ba1bc4f..8f7a51e36847 100644
--- a/src/Compatibility/Core/src/Windows/FormsComboBox.cs
+++ b/src/Compatibility/Core/src/Windows/FormsComboBox.cs
@@ -1,7 +1,7 @@
using System;
+using Microsoft.Maui.Devices;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation;
-using Microsoft.Maui.Devices;
using WVisualState = Microsoft.UI.Xaml.VisualState;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/FormsCommandBar.cs b/src/Compatibility/Core/src/Windows/FormsCommandBar.cs
index 5beb59c17fb4..df3ae96e3e58 100644
--- a/src/Compatibility/Core/src/Windows/FormsCommandBar.cs
+++ b/src/Compatibility/Core/src/Windows/FormsCommandBar.cs
@@ -1,9 +1,9 @@
using System;
-using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Media;
+using Windows.Foundation.Collections;
using WVisibility = Microsoft.UI.Xaml.Visibility;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs b/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs
index 7c8550afe983..f5a113fc7bbb 100644
--- a/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs
+++ b/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs
@@ -1,8 +1,8 @@
using System;
using System.Linq;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.Internals;
using WVisibility = Microsoft.UI.Xaml.Visibility;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/FormsPivot.cs b/src/Compatibility/Core/src/Windows/FormsPivot.cs
index 6193e10623e6..d7a91183df8d 100644
--- a/src/Compatibility/Core/src/Windows/FormsPivot.cs
+++ b/src/Compatibility/Core/src/Windows/FormsPivot.cs
@@ -1,8 +1,8 @@
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/FormsPresenter.cs b/src/Compatibility/Core/src/Windows/FormsPresenter.cs
index cb5315a89167..23ed6646383f 100644
--- a/src/Compatibility/Core/src/Windows/FormsPresenter.cs
+++ b/src/Compatibility/Core/src/Windows/FormsPresenter.cs
@@ -1,7 +1,7 @@
using System;
-using Microsoft.UI.Xaml;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
+using Microsoft.UI.Xaml;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FormsTextBox.cs b/src/Compatibility/Core/src/Windows/FormsTextBox.cs
index 9b1c2798f08a..e70201fec87f 100644
--- a/src/Compatibility/Core/src/Windows/FormsTextBox.cs
+++ b/src/Compatibility/Core/src/Windows/FormsTextBox.cs
@@ -1,17 +1,17 @@
using System;
using System.Linq;
+using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using Windows.System;
-using Windows.UI.Core;
+using Microsoft.Maui.Devices;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
-using Microsoft.Maui.Devices;
+using Windows.System;
+using Windows.UI.Core;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WVisualStateManager = Microsoft.UI.Xaml.VisualStateManager;
-using System.Text;
-using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FrameRenderer.cs b/src/Compatibility/Core/src/Windows/FrameRenderer.cs
index 23734d4776c3..3eab53873e04 100644
--- a/src/Compatibility/Core/src/Windows/FrameRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/FrameRenderer.cs
@@ -1,11 +1,11 @@
+using System;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.Platform;
using WBorder = Microsoft.UI.Xaml.Controls.Border;
-using System;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/FrameworkElementExtensions.cs b/src/Compatibility/Core/src/Windows/FrameworkElementExtensions.cs
index 38b5406bc90f..8a49258a0241 100644
--- a/src/Compatibility/Core/src/Windows/FrameworkElementExtensions.cs
+++ b/src/Compatibility/Core/src/Windows/FrameworkElementExtensions.cs
@@ -3,13 +3,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Controls.Internals;
using WBinding = Microsoft.UI.Xaml.Data.Binding;
-using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WBindingExpression = Microsoft.UI.Xaml.Data.BindingExpression;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs b/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs
index 3870d43ef66f..61821e5f7c32 100644
--- a/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs
+++ b/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs
@@ -1,10 +1,10 @@
using System;
using System.ComponentModel;
-using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Compatibility.Platform.UWP;
-using Microsoft.UI.Xaml;
-using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
+using Microsoft.UI.Xaml;
namespace Microsoft.Maui.Controls.Compatibility
{
diff --git a/src/Compatibility/Core/src/Windows/ImageButtonRenderer.cs b/src/Compatibility/Core/src/Windows/ImageButtonRenderer.cs
index 4fbe3456378f..51aad0073a6d 100644
--- a/src/Compatibility/Core/src/Windows/ImageButtonRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ImageButtonRenderer.cs
@@ -1,17 +1,17 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Media;
+using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
+using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WImage = Microsoft.UI.Xaml.Controls.Image;
using WStretch = Microsoft.UI.Xaml.Media.Stretch;
using WThickness = Microsoft.UI.Xaml.Thickness;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
-using Microsoft.Extensions.Logging;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ImageRenderer.cs b/src/Compatibility/Core/src/Windows/ImageRenderer.cs
index 0226af3b4031..d6ec732881e1 100644
--- a/src/Compatibility/Core/src/Windows/ImageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ImageRenderer.cs
@@ -1,10 +1,10 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
-using Microsoft.UI.Xaml;
+using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
-using Microsoft.Extensions.Logging;
+using Microsoft.UI.Xaml;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs b/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs
index 7f53219e6630..52610e43a02c 100644
--- a/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Markup;
@@ -8,7 +9,6 @@
using WEllipse = Microsoft.UI.Xaml.Shapes.Ellipse;
using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle;
using WShape = Microsoft.UI.Xaml.Shapes.Shape;
-using Microsoft.Maui.Controls.Platform;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/KeyboardExtensions.cs b/src/Compatibility/Core/src/Windows/KeyboardExtensions.cs
index ad2d13dddd87..c57b36a3e31f 100644
--- a/src/Compatibility/Core/src/Windows/KeyboardExtensions.cs
+++ b/src/Compatibility/Core/src/Windows/KeyboardExtensions.cs
@@ -1,7 +1,7 @@
using System;
-using Microsoft.UI.Xaml.Input;
-using Microsoft.Maui.Controls.Internals;
using Microsoft.Extensions.Logging;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.UI.Xaml.Input;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/LabelRenderer.cs b/src/Compatibility/Core/src/Windows/LabelRenderer.cs
index 538cba221c77..ed5d49c48af6 100644
--- a/src/Compatibility/Core/src/Windows/LabelRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/LabelRenderer.cs
@@ -3,18 +3,18 @@
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Xml.Linq;
+using Microsoft.Maui.Controls.Compatibility.Platform.UAP;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Documents;
using Windows.UI.Text;
-using Microsoft.Maui.Controls.Platform;
-using Microsoft.Maui.Controls.Compatibility.Platform.UAP;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Label;
using WRect = Windows.Foundation.Rect;
using WThickness = Microsoft.UI.Xaml.Thickness;
-using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/LayoutRenderer.cs b/src/Compatibility/Core/src/Windows/LayoutRenderer.cs
index 88451629b674..399d29286aea 100644
--- a/src/Compatibility/Core/src/Windows/LayoutRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/LayoutRenderer.cs
@@ -1,12 +1,12 @@
using System.ComponentModel;
-using Windows.UI;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Media;
+using Windows.UI;
using WRect = Windows.Foundation.Rect;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
-using Microsoft.UI;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ListViewRenderer.cs b/src/Compatibility/Core/src/Windows/ListViewRenderer.cs
index 8b5662d9dc62..fd57e2757fd6 100644
--- a/src/Compatibility/Core/src/Windows/ListViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ListViewRenderer.cs
@@ -1,29 +1,29 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
-using Windows.Foundation;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Devices;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Devices;
-using WListView = Microsoft.UI.Xaml.Controls.ListView;
-using WBinding = Microsoft.UI.Xaml.Data.Binding;
-using WApp = Microsoft.UI.Xaml.Application;
-using WRect = Windows.Foundation.Rect;
-using Microsoft.Maui.Controls.Internals;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Windows.Foundation;
using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListView;
-using System.Collections.ObjectModel;
-using Microsoft.Maui.Controls.Platform;
using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility;
+using WApp = Microsoft.UI.Xaml.Application;
+using WBinding = Microsoft.UI.Xaml.Data.Binding;
+using WListView = Microsoft.UI.Xaml.Controls.ListView;
+using WRect = Windows.Foundation.Rect;
using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/MasterBackgroundConverter.cs b/src/Compatibility/Core/src/Windows/MasterBackgroundConverter.cs
index 4be2b83c36bf..5779cb45fc46 100644
--- a/src/Compatibility/Core/src/Windows/MasterBackgroundConverter.cs
+++ b/src/Compatibility/Core/src/Windows/MasterBackgroundConverter.cs
@@ -1,9 +1,9 @@
using System;
-using Windows.UI;
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
+using Windows.UI;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/NativeBindingExtensions.cs b/src/Compatibility/Core/src/Windows/NativeBindingExtensions.cs
index 8c1a8d60fb0c..00de36ce7264 100644
--- a/src/Compatibility/Core/src/Windows/NativeBindingExtensions.cs
+++ b/src/Compatibility/Core/src/Windows/NativeBindingExtensions.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using Microsoft.UI.Xaml;
using Microsoft.Maui.Controls.Internals;
+using Microsoft.UI.Xaml;
using static System.String;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/NativeBindingService.cs b/src/Compatibility/Core/src/Windows/NativeBindingService.cs
index ad2bd98941e7..794e91db2e33 100644
--- a/src/Compatibility/Core/src/Windows/NativeBindingService.cs
+++ b/src/Compatibility/Core/src/Windows/NativeBindingService.cs
@@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
-using Microsoft.UI.Xaml;
using Microsoft.Maui.Controls.Xaml.Internals;
+using Microsoft.UI.Xaml;
[assembly: Microsoft.Maui.Controls.Dependency(typeof(Microsoft.Maui.Controls.Compatibility.Platform.UWP.NativeBindingService))]
diff --git a/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs b/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs
index d09e3a9cfd22..8c49cd00da43 100644
--- a/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs
+++ b/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs
@@ -3,10 +3,10 @@
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices.WindowsRuntime;
+using Microsoft.Extensions.Logging;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.UI.Xaml;
using WinRT;
-using Microsoft.Maui.Controls.Internals;
-using Microsoft.Extensions.Logging;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs b/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs
index 1e04eab771a6..035e1b2b3742 100644
--- a/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs
+++ b/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs
@@ -1,7 +1,7 @@
using System;
using System.Reflection;
-using Microsoft.UI.Xaml;
using Microsoft.Maui.Controls.Xaml.Internals;
+using Microsoft.UI.Xaml;
[assembly: Microsoft.Maui.Controls.Dependency(typeof(Microsoft.Maui.Controls.Compatibility.Platform.UWP.NativeValueConverterService))]
diff --git a/src/Compatibility/Core/src/Windows/NativeViewWrapperRenderer.cs b/src/Compatibility/Core/src/Windows/NativeViewWrapperRenderer.cs
index 7d75da534847..d4621f23b4f0 100644
--- a/src/Compatibility/Core/src/Windows/NativeViewWrapperRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/NativeViewWrapperRenderer.cs
@@ -1,6 +1,6 @@
-using Microsoft.UI.Xaml;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
+using Microsoft.UI.Xaml;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs b/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs
index dd0af6b56038..017835ab299e 100644
--- a/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs
@@ -3,20 +3,20 @@
using System.Collections.Specialized;
using System.ComponentModel;
using System.Threading.Tasks;
-using Windows.Devices.Input;
-using Windows.UI.Input;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media.Animation;
+using Windows.Devices.Input;
using Windows.UI.Core;
-using Microsoft.UI.Xaml.Data;
-using Microsoft.Maui.Controls.Internals;
+using Windows.UI.Input;
using static Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Page;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/PageControl.cs b/src/Compatibility/Core/src/Windows/PageControl.cs
index 0946936c7cc5..0250ab3a79a3 100644
--- a/src/Compatibility/Core/src/Windows/PageControl.cs
+++ b/src/Compatibility/Core/src/Windows/PageControl.cs
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
using WVisibility = Microsoft.UI.Xaml.Visibility;
diff --git a/src/Compatibility/Core/src/Windows/PageRenderer.cs b/src/Compatibility/Core/src/Windows/PageRenderer.cs
index 7e51203a0a48..ea783ab81be6 100644
--- a/src/Compatibility/Core/src/Windows/PageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/PageRenderer.cs
@@ -1,11 +1,11 @@
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using Windows.UI.ViewManagement;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
-using System;
-using Microsoft.Maui.Controls.Platform;
+using Windows.UI.ViewManagement;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/PickerRenderer.cs b/src/Compatibility/Core/src/Windows/PickerRenderer.cs
index 446413b0667e..3b60785dcc1e 100644
--- a/src/Compatibility/Core/src/Windows/PickerRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/PickerRenderer.cs
@@ -1,14 +1,14 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
-using Windows.UI.Core;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Controls.Internals;
+using Windows.UI.Core;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/Platform.cs b/src/Compatibility/Core/src/Windows/Platform.cs
index f80eea2f8b0f..444b3926be5a 100644
--- a/src/Compatibility/Core/src/Windows/Platform.cs
+++ b/src/Compatibility/Core/src/Windows/Platform.cs
@@ -2,18 +2,18 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Windows.Foundation.Metadata;
using Windows.UI.Core;
-using Microsoft.Maui.Controls.Internals;
using NativeAutomationProperties = Microsoft.UI.Xaml.Automation.AutomationProperties;
using WFlowDirection = Microsoft.UI.Xaml.FlowDirection;
using WImage = Microsoft.UI.Xaml.Controls.Image;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
using WVisibility = Microsoft.UI.Xaml.Visibility;
-using Microsoft.Extensions.Logging;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ProgressBarRenderer.cs b/src/Compatibility/Core/src/Windows/ProgressBarRenderer.cs
index 54efb30a4c0a..583fa7421d35 100644
--- a/src/Compatibility/Core/src/Windows/ProgressBarRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ProgressBarRenderer.cs
@@ -1,9 +1,9 @@
using System.ComponentModel;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.Maui.Controls.Internals;
-using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls.Primitives;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/RadioButtonRenderer.cs b/src/Compatibility/Core/src/Windows/RadioButtonRenderer.cs
index 289e1bbd2e12..8582d7d059c3 100644
--- a/src/Compatibility/Core/src/Windows/RadioButtonRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/RadioButtonRenderer.cs
@@ -1,11 +1,11 @@
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
+using static Microsoft.Maui.Controls.Compatibility.Platform.UWP.ViewToRendererConverter;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WThickness = Microsoft.UI.Xaml.Thickness;
-using static Microsoft.Maui.Controls.Compatibility.Platform.UWP.ViewToRendererConverter;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs b/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs
index 05023d1c98bb..19bf077ca593 100644
--- a/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs
@@ -1,15 +1,15 @@
using System;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Graphics;
+using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Media;
using Windows.Foundation;
using Windows.UI.Core;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.RefreshView;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs b/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs
index 6fb295b83b77..6cbb2ce3f497 100644
--- a/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs
@@ -1,12 +1,12 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using WRect = Windows.Foundation.Rect;
using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
+using WRect = Windows.Foundation.Rect;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs b/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs
index 4e07b428f7f0..85eb26b0343c 100644
--- a/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs
@@ -1,13 +1,13 @@
using System.ComponentModel;
-using Windows.UI.Text;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
-using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.SearchBar;
using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Windows.UI.Text;
+using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.SearchBar;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/SliderRenderer.cs b/src/Compatibility/Core/src/Windows/SliderRenderer.cs
index 00f6204ffaf2..404f3520a08d 100644
--- a/src/Compatibility/Core/src/Windows/SliderRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/SliderRenderer.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls.Primitives;
@@ -7,7 +8,6 @@
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/StepperControl.cs b/src/Compatibility/Core/src/Windows/StepperControl.cs
index 20c8c67dcb23..18d294052608 100644
--- a/src/Compatibility/Core/src/Windows/StepperControl.cs
+++ b/src/Compatibility/Core/src/Windows/StepperControl.cs
@@ -1,15 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using WVisualStateManager = Microsoft.UI.Xaml.VisualStateManager;
-using WVisualStateGroup = Microsoft.UI.Xaml.VisualStateGroup;
using WVisualState = Microsoft.UI.Xaml.VisualState;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
+using WVisualStateGroup = Microsoft.UI.Xaml.VisualStateGroup;
+using WVisualStateManager = Microsoft.UI.Xaml.VisualStateManager;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/SwipeViewRenderer.cs b/src/Compatibility/Core/src/Windows/SwipeViewRenderer.cs
index 5de9fadb35bd..b150f3c12e74 100644
--- a/src/Compatibility/Core/src/Windows/SwipeViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/SwipeViewRenderer.cs
@@ -1,15 +1,15 @@
using System;
-using System.Linq;
-using System.ComponentModel;
using System.Collections.Generic;
using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Linq;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using WSwipeBehaviorOnInvoked = Microsoft.UI.Xaml.Controls.SwipeBehaviorOnInvoked;
using WSwipeControl = Microsoft.UI.Xaml.Controls.SwipeControl;
-using WSwipeItems = Microsoft.UI.Xaml.Controls.SwipeItems;
using WSwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem;
+using WSwipeItems = Microsoft.UI.Xaml.Controls.SwipeItems;
using WSwipeMode = Microsoft.UI.Xaml.Controls.SwipeMode;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/SwitchRenderer.cs b/src/Compatibility/Core/src/Windows/SwitchRenderer.cs
index c6c879e9a73f..1d9da0bd4a1f 100644
--- a/src/Compatibility/Core/src/Windows/SwitchRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/SwitchRenderer.cs
@@ -1,17 +1,17 @@
using System.ComponentModel;
using System.Linq;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation;
using Microsoft.UI.Xaml.Shapes;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WColor = Windows.UI.Color;
-using WGrid = Microsoft.UI.Xaml.Controls.Grid;
using WEllipse = Microsoft.UI.Xaml.Shapes.Ellipse;
+using WGrid = Microsoft.UI.Xaml.Controls.Grid;
using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
using WVisualStateManager = Microsoft.UI.Xaml.VisualStateManager;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs b/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
index 59c6f9c4b7ad..d30c60259747 100644
--- a/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
@@ -1,30 +1,30 @@
using System;
-using System.Linq;
using System.Collections.Specialized;
using System.ComponentModel;
+using System.Linq;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
-using Microsoft.Maui.Controls.Internals;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using PageSpecifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Page;
+using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.TabbedPage;
+using VisualElementSpecifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.VisualElement;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WGrid = Microsoft.UI.Xaml.Controls.Grid;
-using WTextAlignment = Microsoft.UI.Xaml.TextAlignment;
using WHorizontalAlignment = Microsoft.UI.Xaml.HorizontalAlignment;
-using WVisibility = Microsoft.UI.Xaml.Visibility;
-using WStackPanel = Microsoft.UI.Xaml.Controls.StackPanel;
using WImage = Microsoft.UI.Xaml.Controls.Image;
+using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
+using WStackPanel = Microsoft.UI.Xaml.Controls.StackPanel;
+using WTextAlignment = Microsoft.UI.Xaml.TextAlignment;
using WTextBlock = Microsoft.UI.Xaml.Controls.TextBlock;
-using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.TabbedPage;
-using VisualElementSpecifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.VisualElement;
-using PageSpecifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Page;
-using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
+using WVisibility = Microsoft.UI.Xaml.Visibility;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/TableViewRenderer.cs b/src/Compatibility/Core/src/Windows/TableViewRenderer.cs
index 667434a8f791..d8ebea5993ca 100644
--- a/src/Compatibility/Core/src/Windows/TableViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TableViewRenderer.cs
@@ -1,10 +1,10 @@
using System;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using WItemsControl = Microsoft.UI.Xaml.Controls.ItemsControl;
using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/TextCellRenderer.cs b/src/Compatibility/Core/src/Windows/TextCellRenderer.cs
index 331a00eb545b..270066274036 100644
--- a/src/Compatibility/Core/src/Windows/TextCellRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TextCellRenderer.cs
@@ -1,10 +1,10 @@
using System;
using System.Windows.Input;
-using WDataTemplate = Microsoft.UI.Xaml.DataTemplate;
-using WApplication = Microsoft.UI.Xaml.Application;
+using Microsoft.Maui.Controls.Handlers.Compatibility;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform.Compatibility;
-using Microsoft.Maui.Controls.Handlers.Compatibility;
+using WApplication = Microsoft.UI.Xaml.Application;
+using WDataTemplate = Microsoft.UI.Xaml.DataTemplate;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs b/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs
index a1280fcd69a7..d853d127d0ec 100644
--- a/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs
@@ -1,14 +1,14 @@
using System;
using System.ComponentModel;
using System.Linq;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Controls.Internals;
using Microsoft.UI.Xaml.Controls.Primitives;
+using Microsoft.UI.Xaml.Media;
using WBrush = Microsoft.UI.Xaml.Media.Brush;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs b/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs
index 0f006b2b9812..a27c6a632e9a 100644
--- a/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs
+++ b/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs
@@ -1,8 +1,8 @@
using System;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+using Microsoft.Maui.Devices;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.Devices;
-using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using WBorder = Microsoft.UI.Xaml.Controls.Border;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs b/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs
index abcd4d3a2252..22dd13b2ad42 100644
--- a/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs
+++ b/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs
@@ -2,12 +2,12 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
-using Windows.Storage.Streams;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media.Imaging;
+using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
-using Microsoft.Extensions.Logging;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Media.Imaging;
+using Windows.Storage.Streams;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ViewRenderer.cs b/src/Compatibility/Core/src/Windows/ViewRenderer.cs
index 61c4ea28a357..c0804a0d84ab 100644
--- a/src/Compatibility/Core/src/Windows/ViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ViewRenderer.cs
@@ -1,7 +1,7 @@
+using System;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
-using Microsoft.Maui.Controls.Platform;
-using System;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/ViewToRendererConverter.cs b/src/Compatibility/Core/src/Windows/ViewToRendererConverter.cs
index c66f83b0d062..a9b079768cf2 100644
--- a/src/Compatibility/Core/src/Windows/ViewToRendererConverter.cs
+++ b/src/Compatibility/Core/src/Windows/ViewToRendererConverter.cs
@@ -1,9 +1,9 @@
using System;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using WRect = Windows.Foundation.Rect;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs b/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
index 4d554e73d5e3..ae5de36e3553 100644
--- a/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
@@ -1,17 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.Maui.Controls.Internals;
using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.VisualElement;
using WRect = Windows.Foundation.Rect;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls.Platform;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/Windows/VisualElementTracker.cs b/src/Compatibility/Core/src/Windows/VisualElementTracker.cs
index d02726e2c36c..59da8736fdc4 100644
--- a/src/Compatibility/Core/src/Windows/VisualElementTracker.cs
+++ b/src/Compatibility/Core/src/Windows/VisualElementTracker.cs
@@ -5,19 +5,19 @@
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
-using Windows.ApplicationModel.DataTransfer;
-using Windows.Graphics.Imaging;
-using Windows.Storage.Streams;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Graphics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Hosting;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
-using Microsoft.Maui.Controls.Internals;
+using Windows.ApplicationModel.DataTransfer;
+using Windows.Graphics.Imaging;
+using Windows.Storage.Streams;
using WCompositeTransform = Microsoft.UI.Xaml.Media.CompositeTransform;
using WScaleTransform = Microsoft.UI.Xaml.Media.ScaleTransform;
-using Microsoft.Maui.Graphics;
using WVisibility = Microsoft.UI.Xaml.Visibility;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
diff --git a/src/Compatibility/Core/src/Windows/WebViewRenderer.cs b/src/Compatibility/Core/src/Windows/WebViewRenderer.cs
index 486302dff0c1..ff23bdfd056f 100644
--- a/src/Compatibility/Core/src/Windows/WebViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/WebViewRenderer.cs
@@ -1,19 +1,19 @@
#pragma warning disable CA1416 // Validate platform compatibility
using System;
+using System.Collections.Generic;
using System.ComponentModel;
-using Windows.UI.Core;
+using System.Linq;
+using System.Net;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Internals;
-using static System.String;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
-using System.Threading.Tasks;
-using System.Net;
-using Windows.Web.Http;
-using System.Collections.Generic;
-using System.Linq;
using Microsoft.UI.Xaml.Controls;
+using Windows.UI.Core;
+using Windows.Web.Http;
+using static System.String;
using WWebView = Microsoft.UI.Xaml.Controls.WebView2;
-using Microsoft.Maui.Controls.Platform;
-using Microsoft.Extensions.Logging;
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
diff --git a/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs b/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs
index 193e644a9fb5..12b0ec93061d 100644
--- a/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs
+++ b/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS
[SupportedOSPlatform("ios11.0")]
internal class DragAndDropDelegate : NSObject, IUIDragInteractionDelegate, IUIDropInteractionDelegate
{
-#region UIDragInteractionDelegate
+ #region UIDragInteractionDelegate
[Export("dragInteraction:session:willEndWithOperation:")]
@@ -39,7 +39,7 @@ public UIDragItem[] GetItemsForBeginningSession(UIDragInteraction interaction, I
return new UIDragItem[0];
}
-#endregion
+ #endregion
[Export("dropInteraction:canHandleSession:")]
[Preserve(Conditional = true)]
diff --git a/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs
index b64de4c1548b..edc2f9b6f357 100644
--- a/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs
+++ b/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs
@@ -133,7 +133,10 @@ public virtual void SetupLayer()
public override void LayoutSubviews()
{
if (_previousSize != Bounds.Size)
+ {
SetNeedsDisplay();
+ this.UpdateBackgroundLayer();
+ }
base.LayoutSubviews();
}
diff --git a/src/Compatibility/Maps/src/Android/MapRenderer.cs b/src/Compatibility/Maps/src/Android/MapRenderer.cs
index c13a8d26905f..fe526759bf13 100644
--- a/src/Compatibility/Maps/src/Android/MapRenderer.cs
+++ b/src/Compatibility/Maps/src/Android/MapRenderer.cs
@@ -25,10 +25,10 @@
using APolygon = Android.Gms.Maps.Model.Polygon;
using APolyline = Android.Gms.Maps.Model.Polyline;
using Circle = Microsoft.Maui.Controls.Maps.Circle;
+using IList = System.Collections.IList;
using Math = System.Math;
using Polygon = Microsoft.Maui.Controls.Maps.Polygon;
using Polyline = Microsoft.Maui.Controls.Maps.Polyline;
-using IList = System.Collections.IList;
namespace Microsoft.Maui.Controls.Compatibility.Maps.Android
{
diff --git a/src/Controls/Foldable/src/TwoPaneView.cs b/src/Controls/Foldable/src/TwoPaneView.cs
index b5d0dfb52375..ecd35d114895 100644
--- a/src/Controls/Foldable/src/TwoPaneView.cs
+++ b/src/Controls/Foldable/src/TwoPaneView.cs
@@ -142,6 +142,7 @@ public double MinWideModeWidth
///
/// Gets the calculated width (in wide mode) or height (in tall mode) of pane 1, or sets the GridLength value of pane 1.
///
+ [System.ComponentModel.TypeConverter(typeof(GridLengthTypeConverter))]
public GridLength Pane1Length
{
get { return (GridLength)GetValue(Pane1LengthProperty); }
@@ -151,6 +152,7 @@ public GridLength Pane1Length
///
/// Gets the calculated width (in wide mode) or height (in tall mode) of pane 2, or sets the GridLength value of pane 2.
///
+ [System.ComponentModel.TypeConverter(typeof(GridLengthTypeConverter))]
public GridLength Pane2Length
{
get { return (GridLength)GetValue(Pane2LengthProperty); }
diff --git a/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs
index 938e7c972fa8..eb289be18680 100644
--- a/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs
+++ b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs
@@ -1,9 +1,9 @@
using System;
+using System.Runtime.CompilerServices;
+using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Shapes;
using Microsoft.Maui.Graphics;
-using System.Runtime.CompilerServices;
-using Microsoft.Maui;
namespace Maui.Controls.Sample.Controls
{
diff --git a/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml.cs
index 4f106de6d20f..a6604b6bc7e1 100644
--- a/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml.cs
@@ -1,9 +1,9 @@
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Controls;
+using System;
using System.Collections.Generic;
-using System;
-using Maui.Controls.Sample.Pages.ShellGalleries;
using System.Linq;
+using Maui.Controls.Sample.Pages.ShellGalleries;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample.Pages
{
diff --git a/src/Controls/samples/Controls.Sample/Pages/Compatibility/FramePage.xaml b/src/Controls/samples/Controls.Sample/Pages/Compatibility/FramePage.xaml
index df4b3db49236..c671d3c19803 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Compatibility/FramePage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Compatibility/FramePage.xaml
@@ -16,6 +16,21 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml
index 5769bfd19634..d64ca2817c65 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml
@@ -1,18 +1,28 @@
-
-
+
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml.cs
index 216189c02fd2..dd511be5e60f 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/MapPinsGallery.xaml.cs
@@ -8,8 +8,8 @@ namespace Maui.Controls.Sample.Pages.MapsGalleries
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MapPinsGallery
{
- private readonly Random _locationRandomSeed = new();
- private int _locationIncrement = 0;
+ readonly Random _locationRandomSeed = new();
+ int _locationIncrement = 0;
// TODO generate actual random pins
private readonly Position[] _randomLocations =
@@ -62,26 +62,26 @@ public MapPinsGallery()
Location = new Position(47.64232, -122.13684),
};
- microsoftPin.MarkerClicked += (s, a) =>
+ microsoftPin.MarkerClicked += (sender, args) =>
{
- DisplayAlert("Marker", "OK", "OK");
+ DisplayAlert("Marker", $"Marker Clicked: {((Pin)sender).Label}", "OK");
};
// TODO this doesn't seem to work on iOS?
- microsoftPin.InfoWindowClicked += (s, a) =>
+ microsoftPin.InfoWindowClicked += (sender, args) =>
{
- DisplayAlert("Info", "OK", "OK");
+ DisplayAlert("Info", $"Info Window Clicked: {((Pin)sender).Label}", "OK");
};
pinsMap.Pins.Add(microsoftPin);
}
- private void AddPin_Clicked(object sender, EventArgs e)
+ void OnAddPinClicked(object sender, EventArgs e)
{
AddPin();
}
- private void RemovePin_Clicked(object sender, EventArgs e)
+ void OnRemovePinClicked(object sender, EventArgs e)
{
if (pinsMap.Pins.Count > 0)
{
@@ -90,7 +90,7 @@ private void RemovePin_Clicked(object sender, EventArgs e)
}
}
- private void Add10Pins_Clicked(object sender, EventArgs e)
+ void OnAdd10PinsClicked(object sender, EventArgs e)
{
for (int i = 0; i <= 10; i++)
{
@@ -98,7 +98,7 @@ private void Add10Pins_Clicked(object sender, EventArgs e)
}
}
- private void AddPin()
+ void AddPin()
{
pinsMap.Pins.Add(new Pin()
{
@@ -106,5 +106,10 @@ private void AddPin()
Location = _randomLocations[_locationRandomSeed.Next(0, _randomLocations.Length)],
});
}
+
+ void OnMapClicked(object sender, MapClickedEventArgs e)
+ {
+ DisplayAlert("Map", $"Map {e.Location.Latitude}, {e.Location.Longitude} clicked.", "Ok");
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PinItemsSourceGallery.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PinItemsSourceGallery.xaml.cs
index be3d02732fdd..0dbd4e6cd19d 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PinItemsSourceGallery.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PinItemsSourceGallery.xaml.cs
@@ -1,12 +1,12 @@
using System;
-using Microsoft.Maui.Controls;
-using Microsoft.Maui.Maps;
-using Microsoft.Maui.Controls.Maps;
-using System.Windows.Input;
using System.Collections;
using System.Collections.ObjectModel;
-using System.Linq;
using System.ComponentModel;
+using System.Linq;
+using System.Windows.Input;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Maps;
+using Microsoft.Maui.Maps;
using Position = Microsoft.Maui.Devices.Sensors.Location;
namespace Maui.Controls.Sample.Pages.MapsGalleries
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml
index 3cf5971736ad..e4de80c53b32 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml
@@ -9,208 +9,214 @@
mc:Ignorable="d"
x:Class="Maui.Controls.Sample.Pages.MapsGalleries.PolygonsGallery"
Title="Polygon/Polyline Gallery">
-
+
+
+
+ 47.6381401
+ -122.1317367
+
+
+
+
+ 47.6381473
+ -122.1350841
+
+
+
+
+ 47.6382847
+ -122.1353094
+
+
+
+
+ 47.6384582
+ -122.1354703
+
+
+
+
+ 47.6401136
+ -122.1360819
+
+
+
+
+ 47.6403883
+ -122.1364681
+
+
+
+
+ 47.6407426
+ -122.1377019
+
+
+
+
+ 47.6412558
+ -122.1404056
+
+
+
+
+ 47.6414148
+ -122.1418647
+
+
+
+
+ 47.6414654
+ -122.1432702
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml.cs
index 9c3376fce23a..6884973a5fac 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/MapsGalleries/PolygonsGallery.xaml.cs
@@ -1,4 +1,5 @@
-using Microsoft.Maui.Controls;
+using System;
+using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages.MapsGalleries
{
@@ -8,5 +9,10 @@ public PolygonsGallery()
{
InitializeComponent();
}
+
+ void OnClearMapElementsClicked(object sender, EventArgs args)
+ {
+ MapElementsMap.MapElements.Clear();
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml
index ee79f58194ca..4280de31b84f 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml
@@ -15,7 +15,12 @@
Text="Disabled"
Style="{StaticResource Headline}"/>
+
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml.cs
index 69ba8195fabd..45c591425731 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/StepperPage.xaml.cs
@@ -14,5 +14,19 @@ void OnValueChanged(object sender, ValueChangedEventArgs args)
{
Debug.WriteLine($"Stepper Value: {args.NewValue}");
}
+
+ void OnEnableButtonClicked(object sender, System.EventArgs e)
+ {
+ if (EnableStepper.IsEnabled)
+ {
+ EnableStepper.IsEnabled = false;
+ EnableButton.Text = "Enable Stepper";
+ }
+ else
+ {
+ EnableStepper.IsEnabled = true;
+ EnableButton.Text = "Disable Stepper";
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Others/TwoPaneViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Others/TwoPaneViewPage.xaml.cs
index b057b7d402db..84b5b06b909b 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Others/TwoPaneViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Others/TwoPaneViewPage.xaml.cs
@@ -1,8 +1,8 @@
namespace Maui.Controls.Sample.Pages
{
using Microsoft.Maui;
- using Microsoft.Maui.Foldable;
using Microsoft.Maui.Controls.Foldable;
+ using Microsoft.Maui.Foldable;
///
/// Sample demonstrating the use of TwoPaneView control and
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs
index 51477d5c9323..e32007f7f1d8 100644
--- a/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs
+++ b/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using Maui.Controls.Sample.Models;
-using Maui.Controls.Sample.ViewModels.Base;
using Maui.Controls.Sample.Pages.ScrollViewPages;
+using Maui.Controls.Sample.ViewModels.Base;
+using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
-using Microsoft.Maui;
namespace Maui.Controls.Sample.ViewModels
{
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs
index 143a587b4068..ee1e37e817de 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs
@@ -205,8 +205,7 @@ void UpdateClippedToBounds()
if (Element == null)
return;
- var shouldClip = Element.IsSet(Microsoft.Maui.Controls.Compatibility.Layout.IsClippedToBoundsProperty)
- ? Element.IsClippedToBounds : Element.CornerRadius > 0f;
+ var shouldClip = Element.IsClippedToBoundsSet(Element.CornerRadius > 0f);
this.SetClipToOutline(shouldClip);
}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs
index 77455e715be0..5fe68322f1d4 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs
@@ -120,7 +120,7 @@ public virtual void SetupLayer()
_actualView.Layer.RasterizationScale = UIScreen.MainScreen.Scale;
_actualView.Layer.ShouldRasterize = true;
- _actualView.Layer.MasksToBounds = Element.IsClippedToBounds;
+ _actualView.Layer.MasksToBounds = Element.IsClippedToBoundsSet(true);
}
void UpdateShadow()
@@ -132,7 +132,10 @@ void UpdateShadow()
public override void LayoutSubviews()
{
if (_previousSize != Bounds.Size)
+ {
SetNeedsDisplay();
+ this.UpdateBackgroundLayer();
+ }
base.LayoutSubviews();
}
diff --git a/src/Controls/src/Core/Frame.cs b/src/Controls/src/Core/Frame.cs
index 37b98d585c35..307c2922f418 100644
--- a/src/Controls/src/Core/Frame.cs
+++ b/src/Controls/src/Core/Frame.cs
@@ -83,4 +83,10 @@ void IBorderElement.OnBorderColorPropertyChanged(Color oldValue, Color newValue)
bool IBorderElement.IsBorderWidthSet() => false;
}
+
+ internal static class FrameExtensions
+ {
+ internal static bool IsClippedToBoundsSet(this Frame frame, bool defaultValue) =>
+ frame.IsSet(Compatibility.Layout.IsClippedToBoundsProperty) ? frame.IsClippedToBounds : defaultValue;
+ }
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/Application/Application.cs b/src/Controls/src/Core/HandlerImpl/Application/Application.cs
index 09ef53df4b66..5b3036a34576 100644
--- a/src/Controls/src/Core/HandlerImpl/Application/Application.cs
+++ b/src/Controls/src/Core/HandlerImpl/Application/Application.cs
@@ -6,6 +6,8 @@ public partial class Application
new PropertyMapper(ApplicationHandler.Mapper)
{
#if ANDROID
+ // There is also a mapper on Window for this property since this property is relevant at the window level for
+ // Android not the application level
[PlatformConfiguration.AndroidSpecific.Application.WindowSoftInputModeAdjustProperty.PropertyName] = MapWindowSoftInputModeAdjust,
#endif
};
diff --git a/src/Controls/src/Core/HandlerImpl/Button/Button.Impl.cs b/src/Controls/src/Core/HandlerImpl/Button/Button.Impl.cs
index c5ac6ca268e5..2459e6637fd8 100644
--- a/src/Controls/src/Core/HandlerImpl/Button/Button.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Button/Button.Impl.cs
@@ -1,4 +1,4 @@
-using System.Runtime.CompilerServices;
+using System.Runtime.CompilerServices;
using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.Controls
@@ -15,6 +15,8 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
Handler?.UpdateValue(nameof(IButtonStroke.StrokeColor));
else if (propertyName == BorderWidthProperty.PropertyName)
Handler?.UpdateValue(nameof(IButtonStroke.StrokeThickness));
+ else if (propertyName == ImageSourceProperty.PropertyName)
+ Handler?.UpdateValue(nameof(IImage.Source));
}
void IButton.Clicked()
diff --git a/src/Controls/src/Core/HandlerImpl/RefreshView/RefreshView.Impl.cs b/src/Controls/src/Core/HandlerImpl/RefreshView/RefreshView.Impl.cs
index 44d5160750f9..66beafe24a7c 100644
--- a/src/Controls/src/Core/HandlerImpl/RefreshView/RefreshView.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/RefreshView/RefreshView.Impl.cs
@@ -7,30 +7,5 @@ public partial class RefreshView : IRefreshView
Paint IRefreshView.RefreshColor => RefreshColor?.AsPaint();
IView IRefreshView.Content => base.Content;
-
- // This shouldn't need be needed once TemplatedView inherits from Controls.Layout
- protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
- {
- if (Content == null)
- return new Size(100, 100);
-
- var margin = Margin;
-
- // Adjust the constraints to account for the margins
- widthConstraint -= margin.HorizontalThickness;
- heightConstraint -= margin.VerticalThickness;
-
- // Use the old measurement override to figure out the xplat size
- var measure = OnMeasure(widthConstraint, heightConstraint).Request;
-
- // Make sure the native control gets measured
- var nativeMeasure = Handler?.GetDesiredSize(measure.Width, measure.Height);
-
- // Account for the margins when reporting the desired size value
- DesiredSize = new Size(measure.Width + margin.HorizontalThickness,
- measure.Height + margin.VerticalThickness);
-
- return DesiredSize;
- }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs b/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs
index 9e2d887896b4..755c50f4b952 100644
--- a/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs
@@ -87,17 +87,9 @@ protected override Size ArrangeOverride(Rect bounds)
Size IContentView.CrossPlatformArrange(Rect bounds)
{
- if ((this as IContentView).PresentedContent is IView presentedContent)
+ if (this is IScrollView scrollView)
{
- var padding = Padding;
-
- // Normally we'd just want the content to be arranged within the ContentView's Frame,
- // but ScrollView content might be larger than the ScrollView itself (for obvious reasons)
- // So in each dimension, we assume the larger of the two values.
- bounds.Width = Math.Max(bounds.Width, presentedContent.DesiredSize.Width + padding.HorizontalThickness);
- bounds.Height = Math.Max(bounds.Height, presentedContent.DesiredSize.Height + padding.VerticalThickness);
-
- this.ArrangeContent(bounds);
+ return scrollView.ArrangeContentUnbounded(bounds);
}
return bounds.Size;
diff --git a/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs b/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs
index a1fc5fb8ac03..9ebf072d2715 100644
--- a/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs
+++ b/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs
@@ -3,6 +3,7 @@
using Android.App;
using Android.Views;
using AndroidX.AppCompat.App;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Handlers;
namespace Microsoft.Maui.Controls
@@ -20,5 +21,20 @@ public static void MapContent(WindowHandler handler, IWindow view)
public static void MapContent(IWindowHandler handler, IWindow view)
{
}
+
+ internal static void MapWindowSoftInputModeAdjust(IWindowHandler handler, IWindow view)
+ {
+ if (view.Parent is Application app)
+ {
+ var setting = PlatformConfiguration.AndroidSpecific.Application.GetWindowSoftInputModeAdjust(app);
+ view.UpdateWindowSoftInputModeAdjust(setting.ToPlatform());
+ }
+ }
+
+ private protected override void OnParentChangedCore()
+ {
+ base.OnParentChangedCore();
+ Handler?.UpdateValue(PlatformConfiguration.AndroidSpecific.Application.WindowSoftInputModeAdjustProperty.PropertyName);
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs b/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs
index 639c962173b3..a77158de08cc 100644
--- a/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs
@@ -21,7 +21,7 @@ public partial class Window : NavigableElement, IWindow, IVisualTreeElement, ITo
public static readonly BindableProperty PageProperty = BindableProperty.Create(
nameof(Page), typeof(Page), typeof(Window), default(Page?),
propertyChanging: OnPageChanging,
- propertyChanged: OnPageChanged);
+ propertyChanged: (b, o, n) => ((Window)b).OnPageChanged(o as Page, n as Page));
public static readonly BindableProperty FlowDirectionProperty =
BindableProperty.Create(nameof(FlowDirection), typeof(FlowDirection), typeof(Window), FlowDirection.MatchParent, propertyChanging: FlowDirectionChanging, propertyChanged: FlowDirectionChanged);
@@ -586,31 +586,26 @@ toolbarElement.Toolbar is Toolbar tb &&
}
}
- static void OnPageChanged(BindableObject bindable, object oldValue, object newValue)
+ void OnPageChanged(Page? oldPage, Page? newPage)
{
- if (bindable is not Window window)
- return;
-
- var oldPage = oldValue as Page;
if (oldPage != null)
{
- window.InternalChildren.Remove(oldPage);
+ InternalChildren.Remove(oldPage);
oldPage.HandlerChanged -= OnPageHandlerChanged;
oldPage.HandlerChanging -= OnPageHandlerChanging;
}
if (oldPage is Shell shell)
- shell.PropertyChanged += ShellPropertyChanged;
+ shell.PropertyChanged -= ShellPropertyChanged;
- var newPage = newValue as Page;
if (newPage != null)
{
- window.InternalChildren.Add(newPage);
- newPage.NavigationProxy.Inner = window.NavigationProxy;
- window._menuBarTracker.Target = newPage;
+ InternalChildren.Add(newPage);
+ newPage.NavigationProxy.Inner = NavigationProxy;
+ _menuBarTracker.Target = newPage;
}
- window.ModalNavigationManager.SettingNewPage();
+ ModalNavigationManager.SettingNewPage();
if (newPage != null)
{
@@ -624,24 +619,24 @@ static void OnPageChanged(BindableObject bindable, object oldValue, object newVa
if (newPage is Shell newShell)
newShell.PropertyChanged += ShellPropertyChanged;
- window?.Handler?.UpdateValue(nameof(IWindow.FlowDirection));
+ Handler?.UpdateValue(nameof(IWindow.FlowDirection));
+ }
- void OnPageHandlerChanged(object? sender, EventArgs e)
- {
- window.ModalNavigationManager.PageAttachedHandler();
- window.AlertManager.Subscribe();
- }
+ void OnPageHandlerChanged(object? sender, EventArgs e)
+ {
+ ModalNavigationManager.PageAttachedHandler();
+ AlertManager.Subscribe();
+ }
- void OnPageHandlerChanging(object? sender, HandlerChangingEventArgs e)
- {
- window.AlertManager.Unsubscribe();
- }
+ void OnPageHandlerChanging(object? sender, HandlerChangingEventArgs e)
+ {
+ AlertManager.Unsubscribe();
+ }
- void ShellPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
- {
- if (e.PropertyName == nameof(Shell.Title))
- window?.Handler?.UpdateValue(nameof(ITitledElement.Title));
- }
+ void ShellPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == nameof(Shell.Title))
+ Handler?.UpdateValue(nameof(ITitledElement.Title));
}
bool IWindow.BackButtonClicked()
diff --git a/src/Controls/src/Core/HandlerImpl/Window/Window.cs b/src/Controls/src/Core/HandlerImpl/Window/Window.cs
index dd61c7b4f7bc..7f5a6493dee3 100644
--- a/src/Controls/src/Core/HandlerImpl/Window/Window.cs
+++ b/src/Controls/src/Core/HandlerImpl/Window/Window.cs
@@ -5,11 +5,22 @@ namespace Microsoft.Maui.Controls
{
public partial class Window
{
- public static IPropertyMapper ControlsWindowMapper = new PropertyMapper(WindowHandler.Mapper);
+ public static IPropertyMapper ControlsWindowMapper =
+ new PropertyMapper(WindowHandler.Mapper);
+
+ // ControlsWindowMapper incorrectly typed to WindowHandler
+ static IPropertyMapper Mapper =
+ new PropertyMapper(ControlsWindowMapper)
+ {
+#if ANDROID
+ // This property is also on the Application Mapper since that's where the attached property exists
+ [PlatformConfiguration.AndroidSpecific.Application.WindowSoftInputModeAdjustProperty.PropertyName] = MapWindowSoftInputModeAdjust,
+#endif
+ };
internal static void RemapForControls()
{
- WindowHandler.Mapper = ControlsWindowMapper;
+ WindowHandler.Mapper = Mapper;
}
}
}
diff --git a/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs b/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs
index 5b8092385ab8..de36772d2e04 100644
--- a/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs
@@ -1,7 +1,6 @@
#nullable enable
using System;
-using System.Collections.Generic;
using Microsoft.Maui.Controls.Handlers;
using Microsoft.Maui.Controls.Handlers.Items;
using Microsoft.Maui.Graphics;
@@ -34,6 +33,8 @@ public class ShellView : ViewGroup, IAppearanceObserver, IFlyoutBehaviorObserver
ShellItemHandler? _currentItemHandler;
+ WrapperView? _backdropView;
+
bool _isOpen;
protected Shell? Element { get; set; }
@@ -44,7 +45,9 @@ public class ShellView : ViewGroup, IAppearanceObserver, IFlyoutBehaviorObserver
protected bool HeaderOnMenu => _headerBehavior == FlyoutHeaderBehavior.Scroll || _headerBehavior == FlyoutHeaderBehavior.CollapseOnScroll;
- protected NColor DefaultBackgroundCorlor = NColor.White;
+ public readonly NColor DefaultBackgroundColor = NColor.White;
+
+ public readonly NColor DefaultBackdropColor = new NColor(0.1f, 0.1f, 0.1f, 0.5f);
public event EventHandler? Toggled;
@@ -123,7 +126,7 @@ public void UpdateFlyout(IView? flyout)
public void UpdateBackgroundColor(GColor? color)
{
- _navigationView.BackgroundColor = color?.ToNUIColor() ?? DefaultBackgroundCorlor;
+ _navigationView.BackgroundColor = color?.ToNUIColor() ?? DefaultBackgroundColor;
}
public void UpdateCurrentItem(ShellItem newItem, bool animate = true)
@@ -200,6 +203,19 @@ public void UpdateItems()
public void UpdateFlyoutBackDrop(Brush backdrop)
{
+ if (_backdropView == null)
+ {
+ _backdropView = new WrapperView()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ BackgroundColor = DefaultBackdropColor
+ };
+ _navigationDrawer.Backdrop = _backdropView;
+ }
+
+ if (!backdrop.IsEmpty)
+ _backdropView.UpdateBackground(backdrop);
}
public void SetToolbar(MauiToolbar toolbar)
diff --git a/src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs b/src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs
index 6add340c3bb6..94c0bd619de8 100644
--- a/src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs
+++ b/src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs
@@ -9,9 +9,11 @@
using Android.Widget;
using AndroidX.AppCompat.Widget;
using Microsoft.Maui.Controls.Internals;
+using static Android.Views.ViewGroup;
using AButton = Android.Widget.Button;
using AppCompatActivity = AndroidX.AppCompat.App.AppCompatActivity;
using AppCompatAlertDialog = AndroidX.AppCompat.App.AlertDialog;
+using AProgressBar = Android.Widget.ProgressBar;
using AView = Android.Views.View;
using AWindow = Android.Views.Window;
@@ -58,7 +60,6 @@ internal void ResetBusyCount(Activity context)
internal sealed class AlertRequestHelper : IDisposable
{
int _busyCount;
- bool? _supportsProgress;
internal AlertRequestHelper(Activity context, IMauiContext mauiContext)
{
@@ -93,12 +94,6 @@ public void ResetBusyCount()
void OnPageBusy(IView sender, bool enabled)
{
- // Verify that the page making the request is part of this activity
- if (!PageIsInThisContext(sender))
- {
- return;
- }
-
_busyCount = Math.Max(0, enabled ? _busyCount + 1 : _busyCount - 1);
UpdateProgressBarVisibility(_busyCount > 0);
@@ -289,38 +284,50 @@ void OnPromptRequested(IView sender, PromptArguments arguments)
void UpdateProgressBarVisibility(bool isBusy)
{
- if (!SupportsProgress)
+ int progressLayoutId = 16908999;
+
+ AView root = Activity?.Window?.DecorView?.RootView;
+
+ if (root?.FindViewById(Activity.Resources.GetIdentifier("content", "id", "android")) is not ViewGroup content)
+ {
return;
-#pragma warning disable 612, 618
-#pragma warning disable CA1416 // Validate platform compatibility
-#pragma warning disable CA1422 // Validate platform compatibility
- Activity.SetProgressBarIndeterminate(true);
- Activity.SetProgressBarIndeterminateVisibility(isBusy);
-#pragma warning restore CA1422 // Validate platform compatibility
-#pragma warning restore CA1416 // Validate platform compatibility
-#pragma warning restore 612, 618
- }
+ }
- internal bool SupportsProgress
- {
- get
+ if (isBusy)
{
- if (_supportsProgress.HasValue)
- return _supportsProgress.Value;
+ var progressLayout = new FrameLayout(Activity.ApplicationContext)
+ {
+ Id = progressLayoutId,
+ LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
+ };
- int progressCircularId = Activity.Resources.GetIdentifier("progress_circular", "id", "android");
+ var progressBar = new AProgressBar(Activity.ApplicationContext)
+ {
+ Indeterminate = true,
+ LayoutParameters = new FrameLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
+ {
+ Gravity = GravityFlags.Center
+ }
+ };
- if (progressCircularId > 0)
- _supportsProgress = Activity.FindViewById(progressCircularId) != null;
- else
- _supportsProgress = true;
+ progressLayout.AddView(progressBar);
- return _supportsProgress.Value;
+ content.AddView(progressLayout);
+ }
+ else
+ {
+ var viewToRemove = content.FindViewById(progressLayoutId);
+ content.RemoveView(viewToRemove);
}
}
bool PageIsInThisContext(IView page)
{
+ if(page.Handler == null)
+ {
+ return false;
+ }
+
var platformView = page.ToPlatform();
if (platformView.Context == null)
diff --git a/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs
index c1940fdbe5ec..d3accf33ac2b 100644
--- a/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs
@@ -1,5 +1,6 @@
using Android.App;
using Android.Content;
+using Android.Media;
using Android.Views;
using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
using AApplication = Android.App.Application;
@@ -10,32 +11,24 @@ public static class ApplicationExtensions
{
public static void UpdateWindowSoftInputModeAdjust(this AApplication platformView, Application application)
{
- var adjust = SoftInput.AdjustPan;
-
- if (Application.Current != null)
+ if (application is IApplication app)
{
- WindowSoftInputModeAdjust elementValue = Application.Current.OnThisPlatform().GetWindowSoftInputModeAdjust();
-
- switch (elementValue)
- {
- case WindowSoftInputModeAdjust.Resize:
- adjust = SoftInput.AdjustResize;
- break;
- case WindowSoftInputModeAdjust.Unspecified:
- adjust = SoftInput.AdjustUnspecified;
- break;
- default:
- adjust = SoftInput.AdjustPan;
- break;
- }
+ foreach (var window in app.Windows)
+ window?.Handler?.UpdateValue(PlatformConfiguration.AndroidSpecific.Application.WindowSoftInputModeAdjustProperty.PropertyName);
}
+ }
- IMauiContext mauiContext = application.FindMauiContext(true);
- Context context = mauiContext?.Context;
- Activity activity = context.GetActivity();
-
- activity?.Window?.SetSoftInputMode(adjust);
-
+ internal static SoftInput ToPlatform(this WindowSoftInputModeAdjust windowSoftInputModeAdjust)
+ {
+ switch (windowSoftInputModeAdjust)
+ {
+ case WindowSoftInputModeAdjust.Resize:
+ return SoftInput.AdjustResize;
+ case WindowSoftInputModeAdjust.Unspecified:
+ return SoftInput.AdjustUnspecified;
+ default:
+ return SoftInput.AdjustPan;
+ }
}
}
}
diff --git a/src/Controls/src/Core/Platform/GestureManager/GestureManager.iOS.cs b/src/Controls/src/Core/Platform/GestureManager/GestureManager.iOS.cs
index 2ff21287886a..fc3686c8adf1 100644
--- a/src/Controls/src/Core/Platform/GestureManager/GestureManager.iOS.cs
+++ b/src/Controls/src/Core/Platform/GestureManager/GestureManager.iOS.cs
@@ -223,7 +223,8 @@ static void ProcessRecognizerHandlerTap(
}
var pointerGestureRecognizer = recognizer as PointerGestureRecognizer;
- if (pointerGestureRecognizer != null)
+
+ if (pointerGestureRecognizer != null && OperatingSystem.IsIOSVersionAtLeast(13))
{
var uiRecognizer = CreatePointerRecognizer(r =>
{
@@ -405,6 +406,8 @@ UISwipeGestureRecognizer CreateSwipeRecognizer(SwipeDirection direction, Action<
return result;
}
+ [SupportedOSPlatform("ios13.0")]
+ [SupportedOSPlatform("maccatalyst13.0")]
CustomHoverGestureRecognizer CreatePointerRecognizer(Action action)
{
var result = new CustomHoverGestureRecognizer(action);
diff --git a/src/Controls/src/Core/Platform/Tizen/Extensions/FormattedStringExtensions.cs b/src/Controls/src/Core/Platform/Tizen/Extensions/FormattedStringExtensions.cs
new file mode 100644
index 000000000000..df002b71bab9
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Tizen/Extensions/FormattedStringExtensions.cs
@@ -0,0 +1,73 @@
+using Microsoft.Maui.Controls.Internals;
+using TFormattedString = Tizen.UIExtensions.Common.FormattedString;
+using TSpan = Tizen.UIExtensions.Common.Span;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public static class FormattedStringExtensions
+ {
+ public static TFormattedString ToFormattedString(this Label label)
+ => ToFormattedText(
+ label.FormattedText,
+ label.TextColor,
+ label.RequireFontManager(),
+ label.ToFont(),
+ label.TextTransform,
+ label.TextDecorations);
+
+ internal static TFormattedString ToFormattedText(
+ this FormattedString formattedString,
+ Graphics.Color defaultColor,
+ IFontManager fontManager,
+ Font? defaultFont = null,
+ TextTransform defaultTextTransform = TextTransform.Default,
+ TextDecorations defaultTextDecorations = TextDecorations.None)
+ {
+ if (formattedString == null)
+ return new TFormattedString();
+
+ var defaultFontSize = defaultFont?.Size ?? fontManager.DefaultFontSize;
+ var formattedText = new TFormattedString();
+
+ for (int i = 0; i < formattedString.Spans.Count; i++)
+ {
+ Span span = formattedString.Spans[i];
+ var transform = span.TextTransform != TextTransform.Default ? span.TextTransform : defaultTextTransform;
+ var text = TextTransformUtilites.GetTransformedText(span.Text, transform);
+
+ if (text == null)
+ continue;
+
+ var nativeSpan = new TSpan() { Text = text };
+ var textColor = span.TextColor ?? defaultColor;
+
+ if (textColor is not null)
+ nativeSpan.ForegroundColor = textColor.ToPlatform();
+
+ if (span.BackgroundColor is not null)
+ nativeSpan.BackgroundColor = span.BackgroundColor.ToPlatform();
+
+ var font = span.ToFont(defaultFontSize);
+ if (font.IsDefault && defaultFont.HasValue)
+ font = defaultFont.Value;
+
+ if (!font.IsDefault)
+ {
+ nativeSpan.FontSize = font.Size.ToScaledPoint();
+ nativeSpan.FontFamily = fontManager.GetFontFamily(span.FontFamily);
+ }
+
+ nativeSpan.LineHeight = span.LineHeight;
+
+ var textDecorations = span.IsSet(Span.TextDecorationsProperty)
+ ? span.TextDecorations
+ : defaultTextDecorations;
+ if (textDecorations.HasFlag(TextDecorations.Strikethrough) || textDecorations.HasFlag(TextDecorations.Underline))
+ nativeSpan.TextDecorations = span.TextDecorations.ToPlatform();
+
+ formattedText.Spans.Add(nativeSpan);
+ }
+ return formattedText;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Tizen/Extensions/TextExtensions.cs b/src/Controls/src/Core/Platform/Tizen/Extensions/TextExtensions.cs
index 5287e935abdd..d11622758855 100644
--- a/src/Controls/src/Core/Platform/Tizen/Extensions/TextExtensions.cs
+++ b/src/Controls/src/Core/Platform/Tizen/Extensions/TextExtensions.cs
@@ -1,11 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.Maui.Platform;
-using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Internals;
+using Tizen.UIExtensions.NUI;
using TEntry = Tizen.UIExtensions.NUI.Entry;
using TEditor = Tizen.UIExtensions.NUI.Editor;
using TLabel = Tizen.UIExtensions.NUI.Label;
+using TFormattedString = Tizen.UIExtensions.Common.FormattedString;
+using TSpan = Tizen.UIExtensions.Common.Span;
namespace Microsoft.Maui.Controls.Platform
{
@@ -32,7 +31,27 @@ public static void UpdateText(this TEditor editor, InputView inputView)
public static void UpdateText(this TLabel platformLabel, Label label)
{
- platformLabel.Text = TextTransformUtilites.GetTransformedText(label.Text, label.TextTransform);
+ switch (label.TextType)
+ {
+ case TextType.Text:
+ if (label.FormattedText != null)
+ platformLabel.FormattedText = label.ToFormattedString();
+ else
+ platformLabel.Text = TextTransformUtilites.GetTransformedText(label.Text, label.TextTransform);
+ break;
+ case TextType.Html:
+ platformLabel.UpdateTextHtml(label);
+ break;
+ }
+ }
+
+ static void UpdateTextHtml(this TLabel platformLabel, Label label)
+ {
+ var formattedText = new TFormattedString();
+ var htmlSpan = new TSpan() { Text = label.Text };
+ formattedText.Spans.Add(htmlSpan);
+ platformLabel.EnableMarkup = true;
+ platformLabel.Text = formattedText.ToMarkupText();
}
}
}
diff --git a/src/Controls/src/Core/Platform/iOS/CustomHoverGestureRecognizer.cs b/src/Controls/src/Core/Platform/iOS/CustomHoverGestureRecognizer.cs
index ac79e586793f..505b4c660b5b 100644
--- a/src/Controls/src/Core/Platform/iOS/CustomHoverGestureRecognizer.cs
+++ b/src/Controls/src/Core/Platform/iOS/CustomHoverGestureRecognizer.cs
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
using UIKit;
@@ -6,21 +7,19 @@
namespace Microsoft.Maui.Controls.Platform.iOS;
+[SupportedOSPlatform("ios13.0")]
+[SupportedOSPlatform("maccatalyst13.0")]
internal class CustomHoverGestureRecognizer : UIHoverGestureRecognizer
{
NSObject _target;
-
-#pragma warning disable CA1416
+
public CustomHoverGestureRecognizer(NSObject target, Selector action) : base(target, action)
{
_target = target;
}
-#pragma warning restore CA1416
-#pragma warning disable CA1416
internal CustomHoverGestureRecognizer(Action action)
: this(new Callback(action), Selector.FromHandle(Selector.GetHandle("target:"))!) { }
-#pragma warning restore CA1416
[Register("__UIHoverGestureRecognizer")]
class Callback : Token
diff --git a/src/Controls/src/Core/Platform/iOS/ModalWrapper.cs b/src/Controls/src/Core/Platform/iOS/ModalWrapper.cs
index 5b2bac4eb04d..2e76359d59a8 100644
--- a/src/Controls/src/Core/Platform/iOS/ModalWrapper.cs
+++ b/src/Controls/src/Core/Platform/iOS/ModalWrapper.cs
@@ -34,7 +34,7 @@ internal ModalWrapper(IPlatformViewHandler modal)
{
Color modalBkgndColor = ((Page)_modal.VirtualView).BackgroundColor;
- if (modalBkgndColor?.Alpha > 0)
+ if (modalBkgndColor?.Alpha > 0 || modalBkgndColor == Colors.Transparent)
result = UIKit.UIModalPresentationStyle.OverFullScreen;
}
diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt
index 3f3639ddcd0f..3abacff3a94c 100644
--- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt
@@ -127,4 +127,5 @@ static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsof
static readonly Microsoft.Maui.Controls.TapGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty!
*REMOVED*Microsoft.Maui.Controls.TapGestureRecognizer.Tapped -> System.EventHandler?
Microsoft.Maui.Controls.ILayoutManagerFactory
-~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
\ No newline at end of file
+~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
index bebbb751f7cd..83eb67e2885b 100644
--- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
@@ -122,4 +122,5 @@ virtual Microsoft.Maui.Controls.TappedEventArgs.GetPosition(Microsoft.Maui.Contr
static readonly Microsoft.Maui.Controls.TapGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty!
*REMOVED*Microsoft.Maui.Controls.TapGestureRecognizer.Tapped -> System.EventHandler?
Microsoft.Maui.Controls.ILayoutManagerFactory
-~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
\ No newline at end of file
+~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
index bebbb751f7cd..83eb67e2885b 100644
--- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
@@ -122,4 +122,5 @@ virtual Microsoft.Maui.Controls.TappedEventArgs.GetPosition(Microsoft.Maui.Contr
static readonly Microsoft.Maui.Controls.TapGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty!
*REMOVED*Microsoft.Maui.Controls.TapGestureRecognizer.Tapped -> System.EventHandler?
Microsoft.Maui.Controls.ILayoutManagerFactory
-~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
\ No newline at end of file
+~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
index 54cca6314bac..27848fc263d1 100644
--- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
@@ -1642,6 +1642,7 @@ Microsoft.Maui.Controls.Platform.ElementChangedEventArgs.ElementChange
Microsoft.Maui.Controls.Platform.ElementChangedEventArgs.NewElement.get -> TElement?
Microsoft.Maui.Controls.Platform.ElementChangedEventArgs.OldElement.get -> TElement?
Microsoft.Maui.Controls.Platform.FontExtensions
+Microsoft.Maui.Controls.Platform.FormattedStringExtensions
Microsoft.Maui.Controls.Platform.GestureHandler
Microsoft.Maui.Controls.Platform.GestureHandler.Attach(Microsoft.Maui.IViewHandler! handler) -> void
Microsoft.Maui.Controls.Platform.GestureHandler.Detach() -> void
@@ -1718,7 +1719,6 @@ Microsoft.Maui.Controls.Platform.ShellSectionView.MauiContext.set -> void
Microsoft.Maui.Controls.Platform.ShellSectionView.ShellSection.get -> Microsoft.Maui.Controls.ShellSection!
Microsoft.Maui.Controls.Platform.ShellSectionView.ShellSectionView(Microsoft.Maui.Controls.ShellSection! section, Microsoft.Maui.IMauiContext! context) -> void
Microsoft.Maui.Controls.Platform.ShellView
-Microsoft.Maui.Controls.Platform.ShellView.DefaultBackgroundCorlor -> Tizen.NUI.Color!
Microsoft.Maui.Controls.Platform.ShellView.Element.get -> Microsoft.Maui.Controls.Shell?
Microsoft.Maui.Controls.Platform.ShellView.Element.set -> void
Microsoft.Maui.Controls.Platform.ShellView.HeaderOnMenu.get -> bool
@@ -3235,6 +3235,8 @@ override sealed Microsoft.Maui.Controls.PlatformBehavior.O
override sealed Microsoft.Maui.Controls.PlatformBehavior.OnAttachedTo(TView! bindable) -> void
override sealed Microsoft.Maui.Controls.PlatformBehavior.OnDetachingFrom(Microsoft.Maui.Controls.BindableObject! bindable) -> void
override sealed Microsoft.Maui.Controls.PlatformBehavior.OnDetachingFrom(TView! bindable) -> void
+readonly Microsoft.Maui.Controls.Platform.ShellView.DefaultBackdropColor -> Tizen.NUI.Color!
+readonly Microsoft.Maui.Controls.Platform.ShellView.DefaultBackgroundColor -> Tizen.NUI.Color!
static Microsoft.Maui.Controls.AbsoluteLayout.AutoSize -> double
static Microsoft.Maui.Controls.Application.AccentColor.get -> Microsoft.Maui.Graphics.Color?
static Microsoft.Maui.Controls.Application.AccentColor.set -> void
@@ -5888,6 +5890,7 @@ virtual Microsoft.Maui.Controls.Window.OnStopped() -> void
~static Microsoft.Maui.Controls.Platform.ButtonExtensions.UpdateText(this Tizen.UIExtensions.NUI.Button platformButton, Microsoft.Maui.Controls.Button button) -> void
~static Microsoft.Maui.Controls.Platform.CollectionViewExtensions.ToLayoutManager(this Microsoft.Maui.Controls.IItemsLayout layout, Microsoft.Maui.Controls.ItemSizingStrategy sizing = Microsoft.Maui.Controls.ItemSizingStrategy.MeasureFirstItem) -> Tizen.UIExtensions.NUI.ICollectionViewLayoutManager
~static Microsoft.Maui.Controls.Platform.FontExtensions.ToNativeFontFamily(this string self, Microsoft.Maui.IFontManager fontManager) -> string
+~static Microsoft.Maui.Controls.Platform.FormattedStringExtensions.ToFormattedString(this Microsoft.Maui.Controls.Label label) -> Tizen.UIExtensions.Common.FormattedString
~static Microsoft.Maui.Controls.Platform.ImageExtensions.LoadImage(this Tizen.NUI.BaseComponents.ImageView image, Microsoft.Maui.Controls.ImageSource source) -> System.Threading.Tasks.Task
~static Microsoft.Maui.Controls.Platform.ImageExtensions.LoadImageAsync(this Tizen.NUI.BaseComponents.ImageView image, Microsoft.Maui.Controls.FileImageSource imageSource) -> System.Threading.Tasks.Task
~static Microsoft.Maui.Controls.Platform.ImageExtensions.LoadImageAsync(this Tizen.NUI.BaseComponents.ImageView image, Microsoft.Maui.Controls.StreamImageSource imageSource) -> System.Threading.Tasks.Task
@@ -7448,3 +7451,4 @@ static Microsoft.Maui.Controls.Toolbar.MapToolbarItems(Microsoft.Maui.Handlers.T
~static Microsoft.Maui.Controls.Layout.MapInputTransparent(Microsoft.Maui.Handlers.LayoutHandler handler, Microsoft.Maui.Controls.Layout layout) -> void
~static Microsoft.Maui.Controls.RadioButton.MapContent(Microsoft.Maui.Handlers.RadioButtonHandler handler, Microsoft.Maui.Controls.RadioButton radioButton) -> void
~static Microsoft.Maui.Controls.SearchBar.MapText(Microsoft.Maui.Handlers.SearchBarHandler handler, Microsoft.Maui.Controls.SearchBar searchBar) -> void
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt
index 12325419571a..323ded66065c 100644
--- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt
@@ -136,3 +136,4 @@ static Microsoft.Maui.Controls.Toolbar.MapTitleIcon(Microsoft.Maui.Handlers.IToo
static Microsoft.Maui.Controls.Toolbar.MapTitleView(Microsoft.Maui.Handlers.IToolbarHandler! arg1, Microsoft.Maui.Controls.Toolbar! arg2) -> void
static Microsoft.Maui.Controls.Toolbar.MapToolbarItems(Microsoft.Maui.Handlers.IToolbarHandler! arg1, Microsoft.Maui.Controls.Toolbar! arg2) -> void
*REMOVED*~override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.OnCreateAutomationPeer() -> Microsoft.UI.Xaml.Automation.Peers.AutomationPeer
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt
index 209c67a13396..fd37102cbc92 100644
--- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt
@@ -109,4 +109,5 @@ static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Micros
static readonly Microsoft.Maui.Controls.TapGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty!
*REMOVED*Microsoft.Maui.Controls.TapGestureRecognizer.Tapped -> System.EventHandler?
Microsoft.Maui.Controls.ILayoutManagerFactory
-~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
\ No newline at end of file
+~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
index 209c67a13396..fd37102cbc92 100644
--- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
+++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
@@ -109,4 +109,5 @@ static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Micros
static readonly Microsoft.Maui.Controls.TapGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty!
*REMOVED*Microsoft.Maui.Controls.TapGestureRecognizer.Tapped -> System.EventHandler?
Microsoft.Maui.Controls.ILayoutManagerFactory
-~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
\ No newline at end of file
+~Microsoft.Maui.Controls.ILayoutManagerFactory.CreateLayoutManager(Microsoft.Maui.Controls.Layout layout) -> Microsoft.Maui.Layouts.ILayoutManager
+*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Controls/src/Core/Shell/Shell.cs b/src/Controls/src/Core/Shell/Shell.cs
index dae028092bd9..4a46880a85e0 100644
--- a/src/Controls/src/Core/Shell/Shell.cs
+++ b/src/Controls/src/Core/Shell/Shell.cs
@@ -69,7 +69,7 @@ static void OnSearchHandlerPropertyChanged(BindableObject bindable, object oldVa
}
public static readonly BindableProperty FlyoutItemIsVisibleProperty =
- BindableProperty.CreateAttached(nameof(IsVisible), typeof(bool), typeof(Shell), true, propertyChanged: OnFlyoutItemIsVisibleChanged);
+ BindableProperty.CreateAttached("FlyoutItemIsVisible", typeof(bool), typeof(Shell), true, propertyChanged: OnFlyoutItemIsVisibleChanged);
public static bool GetFlyoutItemIsVisible(BindableObject obj) => (bool)obj.GetValue(FlyoutItemIsVisibleProperty);
public static void SetFlyoutItemIsVisible(BindableObject obj, bool isVisible) => obj.SetValue(FlyoutItemIsVisibleProperty, isVisible);
diff --git a/src/Controls/src/SourceGen/Controls.SourceGen.csproj b/src/Controls/src/SourceGen/Controls.SourceGen.csproj
index d36290f53ac5..a4d7b6ffee5d 100644
--- a/src/Controls/src/SourceGen/Controls.SourceGen.csproj
+++ b/src/Controls/src/SourceGen/Controls.SourceGen.csproj
@@ -36,7 +36,7 @@
-
+
diff --git a/src/Controls/tests/Core.UnitTests/TestClasses/TestApp.cs b/src/Controls/tests/Core.UnitTests/TestClasses/TestApp.cs
index e72f07e7bc13..0062cd42de54 100644
--- a/src/Controls/tests/Core.UnitTests/TestClasses/TestApp.cs
+++ b/src/Controls/tests/Core.UnitTests/TestClasses/TestApp.cs
@@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
{
public class TestApp : Application
{
- ContentPage _withPage;
+ Page _withPage;
TestWindow _window;
public TestApp() : base(false)
@@ -29,7 +29,7 @@ protected override Window CreateWindow(IActivationState activationState)
return _window ?? new TestWindow(_withPage ?? new ContentPage());
}
- public TestWindow CreateWindow(ContentPage withPage)
+ public TestWindow CreateWindow(Page withPage)
{
_withPage = withPage;
return (TestWindow)(this as IApplication).CreateWindow(null);
diff --git a/src/Controls/tests/Core.UnitTests/WindowsTests.cs b/src/Controls/tests/Core.UnitTests/WindowsTests.cs
index af8b90f563fc..71cff9390bc0 100644
--- a/src/Controls/tests/Core.UnitTests/WindowsTests.cs
+++ b/src/Controls/tests/Core.UnitTests/WindowsTests.cs
@@ -447,6 +447,54 @@ public void DefaultBoundsArePassedToCoreCorrectly()
Assert.Equal(double.NaN, coreWindow.MaximumHeight);
}
+ [Fact]
+ public void ShellTitleChangePropagatesToWindow()
+ {
+ var app = new TestApp();
+ var shell = new ShellTestBase.TestShell() { Title = "test" };
+ var window = app.CreateWindow();
+ bool fired = false;
+ window.Page = shell;
+ window.Handler = new WindowHandlerStub(new PropertyMapper()
+ {
+ [nameof(IWindow.Title)] = (_, _) => fired = true
+ });
+
+ // reset after setting handler
+ fired = false;
+ shell.Title = "new title";
+
+
+ Assert.Equal(shell.Title, (window as IWindow).Title);
+ Assert.True(fired);
+ }
+
+ [Fact]
+ public void PreviousShellDisconnectsFromWindowPropertyChanged()
+ {
+ var app = new TestApp();
+ var oldShell = new Shell() { Title = "Old Shell" };
+ var window = app.CreateWindow(oldShell);
+ bool fired = false;
+
+ window.Handler = new WindowHandlerStub(new PropertyMapper()
+ {
+ [nameof(IWindow.Title)] = (_, _) =>
+ {
+ fired = true;
+ }
+ });
+
+ window.Page = new Shell() { Title = "test" };
+
+ // reset after setting handler
+ fired = false;
+
+ oldShell.Title = "new title";
+ Assert.Equal("test", (window as IWindow).Title);
+ Assert.False(fired);
+ }
+
[Theory]
[InlineData(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN)]
[InlineData(-1, -1, -1, -1, -1, -1, double.NaN, double.NaN)]
diff --git a/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Windows.cs b/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Windows.cs
index a1f924b7a404..8e3628e7cd9a 100644
--- a/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Windows.cs
+++ b/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Windows.cs
@@ -1,20 +1,20 @@
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Automation.Peers;
-using NativeAutomationProperties = Microsoft.UI.Xaml.Automation.AutomationProperties;
-using WNavigationViewItem = Microsoft.UI.Xaml.Controls.NavigationViewItem;
-using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement;
-using WWindow = Microsoft.UI.Xaml.Window;
-using Microsoft.Maui;
-using Microsoft.Maui.Controls;
-using Microsoft.Maui.Platform;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
-using System;
using Microsoft.Extensions.DependencyInjection;
-using System.Collections.Generic;
-using WAppBarButton = Microsoft.UI.Xaml.Controls.AppBarButton;
-using Xunit;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Platform;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
+using Xunit;
+using NativeAutomationProperties = Microsoft.UI.Xaml.Automation.AutomationProperties;
+using WAppBarButton = Microsoft.UI.Xaml.Controls.AppBarButton;
+using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement;
+using WNavigationViewItem = Microsoft.UI.Xaml.Controls.NavigationViewItem;
+using WWindow = Microsoft.UI.Xaml.Window;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.cs b/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.cs
index 31a6a12a29d7..0a5d471618d7 100644
--- a/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.cs
+++ b/src/Controls/tests/DeviceTests/ControlsHandlerTestBase.cs
@@ -36,7 +36,7 @@ public partial class ControlsHandlerTestBase : HandlerTestBase, IDisposable
protected override MauiAppBuilder ConfigureBuilder(MauiAppBuilder mauiAppBuilder)
{
- mauiAppBuilder.Services.TryAddSingleton((_) => new ApplicationStub());
+ mauiAppBuilder.Services.AddSingleton((_) => new ApplicationStub());
return mauiAppBuilder.ConfigureTestBuilder();
}
@@ -67,7 +67,7 @@ protected THandler CreateHandler(IElement view)
return CreateHandler(view, MauiContext);
}
- protected async Task CreateHandlerAsync(IElement view)
+ protected async Task CreateHandlerAsync(IElement view)
where THandler : IElementHandler, new() =>
await InvokeOnMainThreadAsync(() => CreateHandler(view));
diff --git a/src/Controls/tests/DeviceTests/Elements/Application/ApplicationTests.Android.cs b/src/Controls/tests/DeviceTests/Elements/Application/ApplicationTests.Android.cs
new file mode 100644
index 000000000000..d58987641014
--- /dev/null
+++ b/src/Controls/tests/DeviceTests/Elements/Application/ApplicationTests.Android.cs
@@ -0,0 +1,163 @@
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
+using Microsoft.Maui.Platform;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Xunit;
+using ASoftInput = Android.Views.SoftInput;
+using AApplication = Android.App.Application;
+using AActivity = Android.App.Activity;
+
+namespace Microsoft.Maui.DeviceTests
+{
+ [Category(TestCategory.Application)]
+ public partial class ApplicationTests : ControlsHandlerTestBase
+ {
+ [Category(TestCategory.Application)]
+ public class SoftInputModeTests : ControlsHandlerTestBase
+ {
+ [Fact]
+ public async Task SoftInputModeDefaultsToAdjustPan()
+ {
+ await InvokeOnMainThreadAsync(() =>
+ {
+ Assert.Equal(ASoftInput.AdjustPan, GetSoftInput());
+ });
+ }
+
+ [Fact]
+ public async Task SoftInputModeSetOnApplicationPropagatesToWindowHandlers()
+ {
+ EnsureHandlerCreated((builder) =>
+ {
+ builder.Services.AddSingleton((_) => new SoftInputModeApplication());
+ builder.ConfigureMauiHandlers(handler =>
+ {
+ handler.AddHandler();
+ handler.AddHandler();
+ });
+ });
+
+ await InvokeOnMainThreadAsync(() =>
+ {
+ var handlers = new List();
+
+ try
+ {
+ // Setup application stub
+ var app = MauiContext.Services.GetService() as SoftInputModeApplication;
+ app.Handler = app.ToHandler(MauiContext);
+
+ handlers.Add(app.Handler);
+
+ // Setup window
+ var windowHandler = (SoftInputWindowHandlerStub)app.Window.ToHandler(MauiContext);
+ app.Window.Handler = windowHandler;
+
+ handlers.Insert(0, app.Window.Handler);
+
+ // Validate that the Soft Input initializes to AdjustPan
+ Assert.Equal(ASoftInput.AdjustPan, windowHandler.LastASoftInputSet);
+
+ // Set to Resize
+ Controls.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(
+ app,
+ Controls.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);
+
+ // Validate the mapper on the window handler is called with correct value
+ Assert.Equal(ASoftInput.AdjustResize, windowHandler.LastASoftInputSet);
+
+ // Set to Pan
+ Controls.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(
+ app,
+ Controls.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Pan);
+
+ // Validate the mapper on the window handler is called with correct value
+ Assert.Equal(ASoftInput.AdjustPan, windowHandler.LastASoftInputSet);
+ }
+ finally
+ {
+ foreach (var handler in handlers)
+ {
+ handler.DisconnectHandler();
+ }
+ }
+ });
+ }
+
+ ASoftInput GetSoftInput() =>
+ GetSoftInput(MauiContext.Context.GetActivity());
+
+ ASoftInput GetSoftInput(AActivity aActivity) =>
+ aActivity.Window.Attributes.SoftInputMode;
+
+ class SoftInputApplicationHandlerStub : ApplicationHandler
+ {
+ public SoftInputApplicationHandlerStub() : base(Application.ControlsApplicationMapper)
+ {
+ }
+
+ protected override AApplication CreatePlatformElement()
+ {
+ return new AApplication();
+ }
+ }
+
+ class SoftInputModeApplication : Application, IApplication
+ {
+ public SoftInputModeWindow Window { get; } = new SoftInputModeWindow();
+
+ public SoftInputModeApplication() : base(false)
+ {
+ Window.Parent = this;
+ }
+
+ IReadOnlyList IApplication.Windows
+ {
+ get
+ {
+ return new List() { Window };
+ }
+ }
+ }
+
+ class SoftInputModeWindow : Window
+ {
+
+ }
+
+ class SoftInputWindowHandlerStub : ElementHandler, IWindowHandler
+ {
+ public ASoftInput LastASoftInputSet { get; private set; } = ASoftInput.AdjustUnspecified;
+
+ public static IPropertyMapper StubMapper =
+ new PropertyMapper()
+ {
+ [Controls.PlatformConfiguration.AndroidSpecific.Application.WindowSoftInputModeAdjustProperty.PropertyName] = MapWindowSoftInputModeAdjust
+ };
+
+ public static void MapWindowSoftInputModeAdjust(SoftInputWindowHandlerStub arg1, IWindow arg2)
+ {
+ if (arg2.Parent is Application app)
+ {
+ var setting = Controls.PlatformConfiguration.AndroidSpecific.Application.GetWindowSoftInputModeAdjust(app);
+ arg1.LastASoftInputSet = setting.ToPlatform();
+ }
+ }
+
+ public SoftInputWindowHandlerStub() : base(StubMapper, null)
+ {
+
+ }
+
+ protected override AActivity CreatePlatformElement()
+ {
+ return new AActivity();
+ }
+ }
+ }
+ }
+}
diff --git a/src/Controls/tests/DeviceTests/Elements/Application/ApplicationTests.cs b/src/Controls/tests/DeviceTests/Elements/Application/ApplicationTests.cs
new file mode 100644
index 000000000000..3859f5de499a
--- /dev/null
+++ b/src/Controls/tests/DeviceTests/Elements/Application/ApplicationTests.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Microsoft.Maui.DeviceTests
+{
+ public partial class ApplicationTests : ControlsHandlerTestBase
+ {
+ }
+}
diff --git a/src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs b/src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs
index 9eef876ba639..d1d1830cc11d 100644
--- a/src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs
+++ b/src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs
@@ -1,10 +1,10 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
+using AndroidX.AppCompat.Widget;
+using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
-using Xunit;
using Microsoft.Maui.Handlers;
-using Microsoft.Maui.Controls;
-using AndroidX.AppCompat.Widget;
-using System;
+using Xunit;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs
index e018a2c71cb6..4bb311e94a9c 100644
--- a/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs
@@ -1,10 +1,10 @@
-using System.Threading.Tasks;
+using System.Linq;
+using System.Threading.Tasks;
using Microsoft.Maui.Controls;
-using Microsoft.Maui.Platform;
+using Microsoft.Maui.DeviceTests.Stubs;
using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Platform;
using Xunit;
-using System.Linq;
-using Microsoft.Maui.DeviceTests.Stubs;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs
index b80e9ab01aae..9e07c74b7824 100644
--- a/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs
+++ b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs
@@ -2,16 +2,16 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
-using Microsoft.Extensions.DependencyInjection;
using Xunit;
-using Microsoft.Maui.Hosting;
-using Microsoft.Maui.Handlers;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.DeviceTests.Stubs;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/FlyoutPage/FlyoutPageTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/FlyoutPage/FlyoutPageTests.Windows.cs
index 5f5a3019086e..fa4d6b0eedd8 100644
--- a/src/Controls/tests/DeviceTests/Elements/FlyoutPage/FlyoutPageTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/FlyoutPage/FlyoutPageTests.Windows.cs
@@ -3,19 +3,19 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
-using Microsoft.Extensions.DependencyInjection;
+using Microsoft.UI.Xaml.Controls;
using Xunit;
-using WPanel = Microsoft.UI.Xaml.Controls.Panel;
using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement;
+using WPanel = Microsoft.UI.Xaml.Controls.Panel;
using WWindow = Microsoft.UI.Xaml.Window;
-using Microsoft.Maui.Hosting;
-using Microsoft.Maui.Handlers;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.Maui.DeviceTests.Stubs;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/Frame/FrameTests.iOS.cs b/src/Controls/tests/DeviceTests/Elements/Frame/FrameTests.iOS.cs
index a42c70c15704..96976c61a850 100644
--- a/src/Controls/tests/DeviceTests/Elements/Frame/FrameTests.iOS.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Frame/FrameTests.iOS.cs
@@ -36,7 +36,7 @@ await InvokeOnMainThreadAsync(() =>
// so on iOS we just return the shadow that was hard coded into the renderer
var expectedShadow = new Shadow() { Radius = 5, Opacity = 0.8f, Offset = new Point(0, 0), Brush = Brush.Black };
- if(platformView.Element is IView element)
+ if (platformView.Element is IView element)
{
var platformShadow = element.Shadow;
await AssertionExtensions.Wait(() => platformShadow != null);
@@ -45,7 +45,42 @@ await InvokeOnMainThreadAsync(() =>
Assert.Equal(platformShadow.Opacity, expectedShadow.Opacity);
Assert.Equal(platformShadow.Offset, expectedShadow.Offset);
}
- }));
+ }));
+ }
+
+ [Theory(DisplayName = "Frame's Content Clips to Bounds Properly")]
+ [InlineData(true)]
+ [InlineData(false)]
+ [InlineData(null)]
+ public async Task FrameClipsCorrectly(bool? isClipped)
+ {
+ SetupBuilder();
+
+ var frame = new Frame()
+ {
+ HeightRequest = 300,
+ WidthRequest = 300,
+ CornerRadius = 80,
+ Content = new Frame
+ {
+ HeightRequest = 400,
+ WidthRequest = 400,
+ BackgroundColor = Colors.Blue,
+ }
+ };
+
+ if (isClipped is bool clipped)
+ frame.IsClippedToBounds = clipped!;
+
+ await InvokeOnMainThreadAsync(() =>
+ frame.ToPlatform(MauiContext).AttachAndRun(() =>
+ {
+ var handler = frame.ToHandler(MauiContext);
+ if (isClipped == false)
+ Assert.False(handler.PlatformView.ClipsToBounds);
+ else
+ Assert.True(handler.PlatformView.ClipsToBounds);
+ }));
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Controls/tests/DeviceTests/Elements/Image/ImageTests.cs b/src/Controls/tests/DeviceTests/Elements/Image/ImageTests.cs
index ff00b3beeead..34109c05d40e 100644
--- a/src/Controls/tests/DeviceTests/Elements/Image/ImageTests.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Image/ImageTests.cs
@@ -3,11 +3,11 @@
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers.Compatibility;
+using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
using Xunit;
-using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/ListView/ListViewTests.Android.cs b/src/Controls/tests/DeviceTests/Elements/ListView/ListViewTests.Android.cs
index 66910896e4df..d68e66934773 100644
--- a/src/Controls/tests/DeviceTests/Elements/ListView/ListViewTests.Android.cs
+++ b/src/Controls/tests/DeviceTests/Elements/ListView/ListViewTests.Android.cs
@@ -3,12 +3,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Microsoft.Maui.Platform;
+using Android.Views;
using Microsoft.Maui.Controls;
-using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.Handlers.Compatibility;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Platform;
using Xunit;
-using Android.Views;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.Windows.cs
index 9904e75d1d9d..19f602dff9c5 100644
--- a/src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.Windows.cs
@@ -3,18 +3,18 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
-using Microsoft.Extensions.DependencyInjection;
using Xunit;
-using WPanel = Microsoft.UI.Xaml.Controls.Panel;
+using WAppBarButton = Microsoft.UI.Xaml.Controls.AppBarButton;
using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement;
+using WPanel = Microsoft.UI.Xaml.Controls.Panel;
using WWindow = Microsoft.UI.Xaml.Window;
-using Microsoft.Maui.Hosting;
-using Microsoft.Maui.Handlers;
-using WAppBarButton = Microsoft.UI.Xaml.Controls.AppBarButton;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/Page/PageTests.cs b/src/Controls/tests/DeviceTests/Elements/Page/PageTests.cs
index 2ee0e0415a2c..9e37f9244d57 100644
--- a/src/Controls/tests/DeviceTests/Elements/Page/PageTests.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Page/PageTests.cs
@@ -64,7 +64,7 @@ await CreateHandlerAndAddToWindow(page, async (handler) =>
});
}
- [Theory("Page Background Updates Correctly With BackgroundColor Prooperty")]
+ [Theory("Page Background Updates Correctly With BackgroundColor Property")]
[InlineData("#FF0000")]
[InlineData("#00FF00")]
[InlineData("#0000FF")]
@@ -82,6 +82,20 @@ await CreateHandlerAndAddToWindow(page, async (handler) =>
await handler.PlatformView.AssertContainsColor(color);
});
}
+
+ [Fact("No issues using Page IsBusy property")]
+ public async Task UsingIsBusyNoCrash()
+ {
+ var page = new ContentPage();
+ page.IsBusy = true;
+
+ await CreateHandlerAndAddToWindow(page, (handler) =>
+ {
+ // Validate that no exceptions are thrown
+ ((IElementHandler)handler).DisconnectHandler();
+ return Task.CompletedTask;
+ });
+ }
}
}
#endif
\ No newline at end of file
diff --git a/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Android.cs b/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Android.cs
index 54cf309250f3..d7a24e0fe2f1 100644
--- a/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Android.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Android.cs
@@ -1,11 +1,11 @@
-using System.Collections.Generic;
-using System;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
-using Xunit;
using Microsoft.Maui.Platform;
+using Xunit;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Windows.cs
index 8cd903f9b5d2..97cfbda607ed 100644
--- a/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.Windows.cs
@@ -1,12 +1,12 @@
-using System.Collections.Generic;
-using System;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
-using Xunit;
-using Microsoft.UI.Xaml.Controls;
using Microsoft.Maui.Platform;
+using Microsoft.UI.Xaml.Controls;
+using Xunit;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.iOS.cs b/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.iOS.cs
index 68d99790030a..4be49a2c3ffa 100644
--- a/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.iOS.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Picker/PickerTests.iOS.cs
@@ -1,11 +1,11 @@
-using System.Collections.Generic;
-using System;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
-using Xunit;
using Microsoft.Maui.Platform;
+using Xunit;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/ScrollView/ScrollViewTests.iOS.cs b/src/Controls/tests/DeviceTests/Elements/ScrollView/ScrollViewTests.iOS.cs
new file mode 100644
index 000000000000..c75211eed227
--- /dev/null
+++ b/src/Controls/tests/DeviceTests/Elements/ScrollView/ScrollViewTests.iOS.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
+using Xunit;
+
+namespace Microsoft.Maui.DeviceTests
+{
+ public partial class ScrollViewTests
+ {
+ [Fact]
+ public async Task ScrollViewContentSizeSet()
+ {
+ EnsureHandlerCreated(builder => { builder.ConfigureMauiHandlers(handlers => { handlers.AddHandler(); }); });
+
+ var scrollView = new ScrollView();
+ var entry = new Entry() { Text = "In a ScrollView", HeightRequest = 10000 };
+ scrollView.Content = entry;
+
+ var scrollViewHandler = await InvokeOnMainThreadAsync(() =>
+ {
+ return CreateHandlerAsync(scrollView);
+ });
+
+ await InvokeOnMainThreadAsync(async () => {
+ await scrollViewHandler.PlatformView.AttachAndRun(() =>
+ {
+ Assert.Equal(10000, scrollViewHandler.PlatformView.ContentSize.Height);
+ });
+ });
+ }
+ }
+}
diff --git a/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs b/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs
index 70f9a87f1d57..fb47d65c0b0b 100644
--- a/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs
@@ -5,20 +5,20 @@
using System.Threading.Tasks;
using Android.Views;
using AndroidX.AppCompat.Widget;
+using AndroidX.CoordinatorLayout.Widget;
+using AndroidX.Core.View;
using AndroidX.DrawerLayout.Widget;
using Google.Android.Material.AppBar;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers.Compatibility;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.Platform.Compatibility;
+using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
-using Microsoft.Maui.Controls.Platform;
using Xunit;
-using AView = Android.Views.View;
-using AndroidX.CoordinatorLayout.Widget;
-using AndroidX.Core.View;
using static Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer;
-using Microsoft.Maui.DeviceTests.Stubs;
-using Microsoft.Maui.Handlers;
+using AView = Android.Views.View;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs
index de3492ffef0d..9d31c2e51c14 100644
--- a/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs
@@ -448,10 +448,11 @@ public async Task EmptyShellHasNoTopMargin()
var mainPage = new ContentPage();
var shell = new Shell() { CurrentItem = mainPage };
- await CreateHandlerAndAddToWindow(shell, (handler) =>
+ await CreateHandlerAndAddToWindow(shell, async (handler) =>
{
- var position = mainPage.ToPlatform().GetLocationOnScreen();
+ Assert.True(await AssertionExtensions.Wait(() => mainPage.ToPlatform().GetLocationOnScreen().Value.Y > 0));
var appTitleBarHeight = GetWindowRootView(handler).AppTitleBarActualHeight;
+ var position = mainPage.ToPlatform().GetLocationOnScreen();
Assert.True(Math.Abs(position.Value.Y - appTitleBarHeight) < 1);
});
@@ -555,7 +556,7 @@ public async Task SelectingTabUpdatesSelectedFlyoutItem()
shell.FlyoutBehavior = FlyoutBehavior.Locked;
});
- await CreateHandlerAndAddToWindow(shell, (handler) =>
+ await CreateHandlerAndAddToWindow(shell, async (handler) =>
{
var flyoutItems = shell.FlyoutItems.Cast>().ToList();
var rootView = handler.PlatformView as MauiNavigationView;
@@ -572,6 +573,9 @@ await CreateHandlerAndAddToWindow(shell, (handler) =>
tabbedView.SelectedItem = platformTabItems[1].MenuItemsSource[1];
+ // Wait for the selected item to propagate to the rootview
+ await AssertionExtensions.Wait(() => (rootView.SelectedItem as NavigationViewItemViewModel).Data == flyoutItems[0][1]);
+
// Verify that the flyout item updates
Assert.Equal((rootView.SelectedItem as NavigationViewItemViewModel).Data, flyoutItems[0][1]);
});
diff --git a/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.Windows.cs
index a0072446dbc5..9d218215a3f0 100644
--- a/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.Windows.cs
@@ -2,18 +2,18 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
-using Microsoft.Extensions.DependencyInjection;
using Xunit;
using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement;
using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush;
-using Microsoft.Maui.Hosting;
-using Microsoft.Maui.Handlers;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.DeviceTests.Stubs;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.cs b/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.cs
index db17e331feb4..56ad089dd78c 100644
--- a/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.cs
+++ b/src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.cs
@@ -2,17 +2,17 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.Controls.Handlers.Compatibility;
+using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
-using Microsoft.Extensions.DependencyInjection;
using Xunit;
-using Microsoft.Maui.Hosting;
-using Microsoft.Maui.Handlers;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.DeviceTests.Stubs;
-using Microsoft.Maui.Controls.Handlers.Compatibility;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Controls/tests/DeviceTests/Elements/Window/WindowTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/Window/WindowTests.Windows.cs
index 96b9f96401d2..399ae76b6656 100644
--- a/src/Controls/tests/DeviceTests/Elements/Window/WindowTests.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Elements/Window/WindowTests.Windows.cs
@@ -1,13 +1,13 @@
-using System.Threading.Tasks;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
using Microsoft.Maui.Controls;
-using Microsoft.Maui.Platform;
+using Microsoft.Maui.DeviceTests.Stubs;
+using Microsoft.Maui.Graphics.Win2D;
using Microsoft.Maui.Handlers;
-using WPanel = Microsoft.UI.Xaml.Controls.Panel;
+using Microsoft.Maui.Platform;
using Xunit;
-using System.Linq;
-using Microsoft.Maui.Graphics.Win2D;
-using System;
-using Microsoft.Maui.DeviceTests.Stubs;
+using WPanel = Microsoft.UI.Xaml.Controls.Panel;
namespace Microsoft.Maui.DeviceTests
{
@@ -80,7 +80,10 @@ public async Task HeaderCorrectlyOffsetFromAppTitleBar()
await CreateHandlerAndAddToWindow(mainPage, async (handler) =>
{
var mauiToolBar = GetPlatformToolbar(handler);
- await AssertionExtensions.Wait(() => mauiToolBar.GetLocationOnScreen().Value.Y > 0);
+
+ Assert.NotNull(mauiToolBar);
+ Assert.True(await AssertionExtensions.Wait(() => mauiToolBar.GetLocationOnScreen().Value.Y > 0));
+
var position = mauiToolBar.GetLocationOnScreen();
var appTitleBarHeight = GetWindowRootView(handler).AppTitleBarActualHeight;
@@ -113,7 +116,10 @@ await CreateHandlerAndAddToWindow(window, async (handler) =>
if (nextRootPage is NavigationPage || nextRootPage is Shell)
{
var mauiToolBar = GetPlatformToolbar(handler);
- await AssertionExtensions.Wait(() => mauiToolBar.GetLocationOnScreen().Value.Y > 0);
+
+ Assert.NotNull(mauiToolBar);
+ Assert.True(await AssertionExtensions.Wait(() => mauiToolBar.GetLocationOnScreen().Value.Y > 0));
+
var position = mauiToolBar.GetLocationOnScreen();
var appTitleBarHeight = GetWindowRootView(handler).AppTitleBarActualHeight;
diff --git a/src/Controls/tests/DeviceTests/MauiProgram.cs b/src/Controls/tests/DeviceTests/MauiProgram.cs
index 2a8d8289bd3c..d22625138e6b 100644
--- a/src/Controls/tests/DeviceTests/MauiProgram.cs
+++ b/src/Controls/tests/DeviceTests/MauiProgram.cs
@@ -14,7 +14,7 @@ public static class MauiProgram
public static Microsoft.UI.Xaml.Window CurrentWindow => MauiProgramDefaults.DefaultWindow;
#endif
- public static IApplication DefaultTestApp { get; private set; }
+ public static IApplication DefaultTestApp => MauiProgramDefaults.DefaultTestApp;
public static MauiApp CreateMauiApp() =>
MauiProgramDefaults.CreateMauiApp(new List()
diff --git a/src/Controls/tests/DeviceTests/Stubs/WindowHandlerStub.Windows.cs b/src/Controls/tests/DeviceTests/Stubs/WindowHandlerStub.Windows.cs
index f5f359e172c6..afd4e94cc836 100644
--- a/src/Controls/tests/DeviceTests/Stubs/WindowHandlerStub.Windows.cs
+++ b/src/Controls/tests/DeviceTests/Stubs/WindowHandlerStub.Windows.cs
@@ -1,9 +1,9 @@
using System;
+using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
+using Microsoft.UI.Xaml;
using WPanel = Microsoft.UI.Xaml.Controls.Panel;
using WWindow = Microsoft.UI.Xaml.Window;
-using Microsoft.Maui.Handlers;
-using Microsoft.UI.Xaml;
namespace Microsoft.Maui.DeviceTests.Stubs
{
diff --git a/src/Controls/tests/DeviceTests/TestCategory.cs b/src/Controls/tests/DeviceTests/TestCategory.cs
index dfedc804224e..bf5600d80992 100644
--- a/src/Controls/tests/DeviceTests/TestCategory.cs
+++ b/src/Controls/tests/DeviceTests/TestCategory.cs
@@ -2,6 +2,7 @@
{
public static class TestCategory
{
+ public const string Application = "Application";
public const string Behavior = "Behavior";
public const string Button = "Button";
public const string CheckBox = "CheckBox";
diff --git a/src/Controls/tests/Xaml.UnitTests/NativeViewsAndBindings.xaml b/src/Controls/tests/Xaml.UnitTests/NativeViewsAndBindings.xaml
new file mode 100644
index 000000000000..b34aca870731
--- /dev/null
+++ b/src/Controls/tests/Xaml.UnitTests/NativeViewsAndBindings.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Controls/tests/Xaml.UnitTests/NativeViewsAndBindings.xaml.cs b/src/Controls/tests/Xaml.UnitTests/NativeViewsAndBindings.xaml.cs
new file mode 100644
index 000000000000..b74fff2bdb70
--- /dev/null
+++ b/src/Controls/tests/Xaml.UnitTests/NativeViewsAndBindings.xaml.cs
@@ -0,0 +1,319 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using Microsoft.Maui.ApplicationModel;
+using Microsoft.Maui.Controls.Xaml.Internals;
+using NUnit.Framework;
+using NUnit.Framework.Internal;
+using static System.String;
+
+namespace Microsoft.Maui.Controls.Xaml.UnitTests;
+
+public class MockNativeView
+{
+ public string Foo { get; set; }
+ public int Bar { get; set; }
+ public string Baz { get; set; }
+ public IList SubViews { get; set; } = new List();
+}
+
+public class MockNativeViewWrapper : View
+{
+ public MockNativeView NativeView { get; }
+
+ public MockNativeViewWrapper(MockNativeView nativeView)
+ {
+ nativeView.TransferbindablePropertiesToWrapper(this);
+ NativeView = nativeView;
+ }
+
+ protected override void OnBindingContextChanged()
+ {
+ NativeView.SetBindingContext(BindingContext, nv => nv.SubViews);
+ base.OnBindingContextChanged();
+ }
+}
+
+public static class MockNativeViewExtensions
+{
+ public static void SetBindingContext(this MockNativeView target, object bindingContext, Func> getChild = null) => NativeBindingHelpers.SetBindingContext(target, bindingContext, getChild);
+ public static void TransferbindablePropertiesToWrapper(this MockNativeView target, MockNativeViewWrapper wrapper) => NativeBindingHelpers.TransferBindablePropertiesToWrapper(target, wrapper);
+ public static void SetBinding(this MockNativeView target, string targetProperty, BindingBase binding) => NativeBindingHelpers.SetBinding(target, targetProperty, binding);
+ public static void SetBinding(this MockNativeView target, BindableProperty targetProperty, BindingBase binding) => NativeBindingHelpers.SetBinding(target, targetProperty, binding);
+ public static void SetValue(this MockNativeView target, BindableProperty targetProperty, object value) => NativeBindingHelpers.SetValue(target, targetProperty, value);
+}
+
+public static class NativeBindingHelpers
+{
+ public static void SetBinding(TNativeView target, string targetProperty, BindingBase bindingBase, string updateSourceEventName = null) where TNativeView : class
+ {
+ var binding = bindingBase as Binding;
+ //This will allow setting bindings from Xaml by reusing the MarkupExtension
+ if (IsNullOrEmpty(updateSourceEventName) && binding != null && !IsNullOrEmpty(binding.UpdateSourceEventName))
+ updateSourceEventName = binding.UpdateSourceEventName;
+ INotifyPropertyChanged eventWrapper = null;
+ if (!IsNullOrEmpty(updateSourceEventName))
+ eventWrapper = new EventWrapper(target, targetProperty, updateSourceEventName);
+
+ SetBinding(target, targetProperty, bindingBase, eventWrapper);
+ }
+
+ public static void SetBinding(TNativeView target, string targetProperty, BindingBase bindingBase, INotifyPropertyChanged propertyChanged) where TNativeView : class
+ {
+ if (target == null)
+ throw new ArgumentNullException(nameof(target));
+ if (IsNullOrEmpty(targetProperty))
+ throw new ArgumentNullException(nameof(targetProperty));
+
+ var binding = bindingBase as Binding;
+ var proxy = BindableObjectProxy.BindableObjectProxies.GetValue(target, (TNativeView key) => new BindableObjectProxy(key));
+ BindableProperty bindableProperty = null;
+ propertyChanged ??= target as INotifyPropertyChanged;
+ var propertyType = target.GetType().GetProperty(targetProperty)?.PropertyType;
+ var defaultValue = target.GetType().GetProperty(targetProperty)?.GetMethod.Invoke(target, new object[] { });
+ bindableProperty = CreateBindableProperty(targetProperty, propertyType, defaultValue);
+ if (binding != null && binding.Mode != BindingMode.OneWay && propertyChanged != null)
+ propertyChanged.PropertyChanged += (sender, e) =>
+ {
+ if (e.PropertyName != targetProperty)
+ return;
+ SetValueFromNative(sender as TNativeView, targetProperty, bindableProperty);
+ //we need to keep the listener around he same time we have the proxy
+ proxy.NativeINPCListener = propertyChanged;
+ };
+
+ if (binding != null && binding.Mode != BindingMode.OneWay)
+ SetValueFromNative(target, targetProperty, bindableProperty);
+
+ proxy.SetBinding(bindableProperty, bindingBase);
+ }
+
+ static BindableProperty CreateBindableProperty(string targetProperty, Type propertyType = null, object defaultValue = null) where TNativeView : class
+ {
+ propertyType ??= typeof(object);
+ defaultValue ??= (propertyType.IsValueType ? Activator.CreateInstance(propertyType) : null);
+ return BindableProperty.Create(
+ targetProperty,
+ propertyType,
+ typeof(BindableObjectProxy),
+ defaultValue: defaultValue,
+ defaultBindingMode: BindingMode.Default,
+ propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ TNativeView nativeView;
+ if ((bindable as BindableObjectProxy).TargetReference.TryGetTarget(out nativeView))
+ SetNativeValue(nativeView, targetProperty, newValue);
+ }
+ );
+ }
+
+ static void SetNativeValue(TNativeView target, string targetProperty, object newValue) where TNativeView : class
+ {
+ var mi = target.GetType().GetProperty(targetProperty)?.SetMethod;
+ if (mi == null)
+ throw new InvalidOperationException(Format("Native Binding on {0}.{1} failed due to missing or inaccessible property", target.GetType(), targetProperty));
+ mi.Invoke(target, new[] { newValue });
+ }
+
+ static void SetValueFromNative(TNativeView target, string targetProperty, BindableProperty bindableProperty) where TNativeView : class
+ {
+ BindableObjectProxy proxy;
+ if (!BindableObjectProxy.BindableObjectProxies.TryGetValue(target, out proxy))
+ return;
+ SetValueFromRenderer(proxy, bindableProperty, target.GetType().GetProperty(targetProperty)?.GetMethod.Invoke(target, new object[] { }));
+ }
+
+ static void SetValueFromRenderer(BindableObject bindable, BindableProperty property, object value) => bindable.SetValueCore(property, value);
+
+ public static void SetBinding(TNativeView target, BindableProperty targetProperty, BindingBase binding) where TNativeView : class
+ {
+ if (target == null)
+ throw new ArgumentNullException(nameof(target));
+ if (targetProperty == null)
+ throw new ArgumentNullException(nameof(targetProperty));
+ if (binding == null)
+ throw new ArgumentNullException(nameof(binding));
+
+ var proxy = BindableObjectProxy.BindableObjectProxies.GetValue(target, (TNativeView key) => new BindableObjectProxy(key));
+ proxy.BindingsBackpack.Add(new KeyValuePair(targetProperty, binding));
+ }
+
+ public static void SetValue(TNativeView target, BindableProperty targetProperty, object value) where TNativeView : class
+ {
+ if (target == null)
+ throw new ArgumentNullException(nameof(target));
+ if (targetProperty == null)
+ throw new ArgumentNullException(nameof(targetProperty));
+
+ var proxy = BindableObjectProxy.BindableObjectProxies.GetValue(target, (TNativeView key) => new BindableObjectProxy(key));
+ proxy.ValuesBackpack.Add(new KeyValuePair(targetProperty, value));
+ }
+
+ public static void SetBindingContext(TNativeView target, object bindingContext, Func> getChild = null) where TNativeView : class
+ {
+ if (target == null)
+ throw new ArgumentNullException(nameof(target));
+
+ var proxy = BindableObjectProxy.BindableObjectProxies.GetValue(target, (TNativeView key) => new BindableObjectProxy(key));
+ proxy.BindingContext = bindingContext;
+ if (getChild == null)
+ return;
+ var children = getChild(target);
+ if (children == null)
+ return;
+ foreach (var child in children)
+ if (child != null)
+ SetBindingContext(child, bindingContext, getChild);
+ }
+
+ public static void TransferBindablePropertiesToWrapper(TNativeView nativeView, TNativeWrapper wrapper)
+ where TNativeView : class
+ where TNativeWrapper : View
+ {
+ if (BindableObjectProxy.BindableObjectProxies.TryGetValue(nativeView, out BindableObjectProxy proxy))
+ proxy.TransferAttachedPropertiesTo(wrapper);
+ }
+
+ class EventWrapper : INotifyPropertyChanged
+ {
+ string TargetProperty { get; set; }
+ static readonly MethodInfo handlerinfo = typeof(EventWrapper).GetRuntimeMethods().Single(mi => mi.Name == "OnPropertyChanged" && mi.IsPublic == false);
+
+ public EventWrapper(object target, string targetProperty, string updateSourceEventName)
+ {
+ TargetProperty = targetProperty;
+ Delegate handlerDelegate;
+ EventInfo updateSourceEvent;
+ try
+ {
+ updateSourceEvent = target.GetType().GetRuntimeEvent(updateSourceEventName);
+ handlerDelegate = handlerinfo.CreateDelegate(updateSourceEvent.EventHandlerType, this);
+ }
+ catch (Exception)
+ {
+ throw new ArgumentException(Format("No declared or accessible event {0} on {1}", updateSourceEventName, target.GetType()), nameof(updateSourceEventName));
+ }
+ if (updateSourceEvent != null && handlerDelegate != null)
+ updateSourceEvent.AddEventHandler(target, handlerDelegate);
+ }
+
+ void OnPropertyChanged(object sender, EventArgs e) => PropertyChanged?.Invoke(sender, new PropertyChangedEventArgs(TargetProperty));
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+
+ class BindableObjectProxy : BindableObject where TNativeView : class
+ {
+ public static ConditionalWeakTable> BindableObjectProxies { get; } = new ConditionalWeakTable>();
+ public WeakReference TargetReference { get; set; }
+ public IList> BindingsBackpack { get; } = new List>();
+ public IList> ValuesBackpack { get; } = new List>();
+ public INotifyPropertyChanged NativeINPCListener;
+
+ public BindableObjectProxy(TNativeView target)
+ {
+ TargetReference = new WeakReference(target);
+ }
+
+ public void TransferAttachedPropertiesTo(View wrapper)
+ {
+ foreach (var kvp in BindingsBackpack)
+ wrapper.SetBinding(kvp.Key, kvp.Value);
+ foreach (var kvp in ValuesBackpack)
+ wrapper.SetValue(kvp.Key, kvp.Value);
+ }
+ }
+}
+
+class MockNativeValueConverterService : INativeValueConverterService
+{
+ public bool ConvertTo(object value, Type toType, out object nativeValue)
+ {
+ nativeValue = null;
+ if (typeof(MockNativeView).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View)))
+ {
+ nativeValue = new MockNativeViewWrapper((MockNativeView)value);
+ return true;
+ }
+ return false;
+ }
+}
+
+class MockNativeBindingService : INativeBindingService
+{
+ public bool TrySetBinding(object target, string propertyName, BindingBase binding)
+ {
+ var view = target as MockNativeView;
+ if (view == null)
+ return false;
+ view.SetBinding(propertyName, binding);
+ return true;
+
+ }
+
+ public bool TrySetBinding(object target, BindableProperty property, BindingBase binding)
+ {
+ var view = target as MockNativeView;
+ if (view == null)
+ return false;
+ view.SetBinding(property, binding);
+ return true;
+ }
+
+ public bool TrySetValue(object target, BindableProperty property, object value)
+ {
+ var view = target as MockNativeView;
+ if (view == null)
+ return false;
+ view.SetValue(property, value);
+ return true;
+ }
+}
+
+[XamlCompilation(XamlCompilationOptions.Skip)]
+public partial class NativeViewsAndBindings : ContentPage
+{
+
+ public NativeViewsAndBindings() => InitializeComponent();
+ public NativeViewsAndBindings(bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Test
+ {
+ [SetUp]
+ public void Setup()
+ {
+ AppInfo.SetCurrent(new Core.UnitTests.MockAppInfo());
+ DependencyService.Register();
+ DependencyService.Register();
+ }
+
+ [TearDown] public void TearDown() => AppInfo.SetCurrent(null);
+
+ [Test]
+ public void NativeInContentView([Values(false)]bool useCompiledXaml)
+ {
+ var layout = new NativeViewsAndBindings(useCompiledXaml);
+ layout.BindingContext = new
+ {
+ Baz = "Bound Value",
+ VerticalOption = LayoutOptions.EndAndExpand
+ };
+ var nativeView = layout.view0 as MockNativeView;
+
+ var wrapper = layout.stack.Children.First();
+ Assert.That(wrapper, Is.TypeOf());
+ Assert.That(((MockNativeViewWrapper)wrapper).NativeView, Is.EqualTo(nativeView));
+
+ Assert.AreEqual("foo", nativeView.Foo);
+ Assert.AreEqual(42, nativeView.Bar);
+ Assert.AreEqual("Bound Value", nativeView.Baz);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/tests/Xaml.UnitTests/WarnOnObsolete.xaml.cs b/src/Controls/tests/Xaml.UnitTests/WarnOnObsolete.xaml.cs
index 71cc919f38bc..10a37a1a6cd5 100644
--- a/src/Controls/tests/Xaml.UnitTests/WarnOnObsolete.xaml.cs
+++ b/src/Controls/tests/Xaml.UnitTests/WarnOnObsolete.xaml.cs
@@ -1,10 +1,8 @@
using System;
-
using Microsoft.Maui.ApplicationModel;
+using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Core.UnitTests;
using Microsoft.Maui.Devices;
-using Microsoft.Maui.Controls;
-
using NUnit.Framework;
namespace Microsoft.Maui.Controls.Xaml.UnitTests
diff --git a/src/Core/maps/src/Handlers/Map/MapHandler.iOS.cs b/src/Core/maps/src/Handlers/Map/MapHandler.iOS.cs
index 96235552c7e6..7fa40cfc68b0 100644
--- a/src/Core/maps/src/Handlers/Map/MapHandler.iOS.cs
+++ b/src/Core/maps/src/Handlers/Map/MapHandler.iOS.cs
@@ -81,6 +81,7 @@ public static void MapPins(IMapHandler handler, IMap map)
public static void MapElements(IMapHandler handler, IMap map)
{
+ handler.PlatformView.ClearMapElements();
handler.PlatformView.AddElements((IList)map.Elements);
}
diff --git a/src/Core/maps/src/Platform/iOS/MauiMKMapView.cs b/src/Core/maps/src/Platform/iOS/MauiMKMapView.cs
index 1d09d3227125..037e6bfbd204 100644
--- a/src/Core/maps/src/Platform/iOS/MauiMKMapView.cs
+++ b/src/Core/maps/src/Platform/iOS/MauiMKMapView.cs
@@ -114,6 +114,19 @@ internal void AddPins(IList pins)
}
}
+ internal void ClearMapElements()
+ {
+ var elements = Overlays;
+
+ if (elements == null)
+ return;
+
+ foreach (IMKOverlay overlay in elements)
+ {
+ RemoveOverlay(overlay);
+ }
+ }
+
internal void AddElements(IList elements)
{
foreach (IMapElement element in elements)
@@ -159,7 +172,11 @@ void Startup()
{
RegionChanged += MkMapViewOnRegionChanged;
DidSelectAnnotationView += MkMapViewOnAnnotationViewSelected;
- AddGestureRecognizer(_mapClickedGestureRecognizer = new UITapGestureRecognizer(OnMapClicked));
+
+ AddGestureRecognizer(_mapClickedGestureRecognizer = new UITapGestureRecognizer(OnMapClicked)
+ {
+ ShouldReceiveTouch = OnShouldReceiveMapTouch
+ });
}
void Cleanup()
@@ -181,9 +198,11 @@ void MkMapViewOnAnnotationViewSelected(object? sender, MKAnnotationViewEventArgs
if (pin == null)
return;
+
// SendMarkerClick() returns the value of PinClickedEventArgs.HideInfoWindow
// Hide the info window by deselecting the annotation
bool deselect = pin.SendMarkerClick();
+
if (deselect)
DeselectAnnotation(annotation, false);
}
@@ -279,12 +298,22 @@ void OnCalloutClicked(IMKAnnotation annotation)
return mapElement?.ToHandler(handler?.MauiContext!).PlatformView as T;
}
+ bool OnShouldReceiveMapTouch(UIGestureRecognizer recognizer, UITouch touch)
+ {
+ if (touch.View is MKAnnotationView)
+ return false;
+
+ return true;
+ }
+
static void OnMapClicked(UITapGestureRecognizer recognizer)
{
if (recognizer.View is not MauiMKMapView mauiMkMapView)
return;
+
var tapPoint = recognizer.LocationInView(mauiMkMapView);
var tapGPS = mauiMkMapView.ConvertPoint(tapPoint, mauiMkMapView);
+
if (mauiMkMapView._handlerRef.TryGetTarget(out IMapHandler? handler))
handler?.VirtualView.Clicked(new Devices.Sensors.Location(tapGPS.Latitude, tapGPS.Longitude));
}
diff --git a/src/Core/src/Animations/Animation.cs b/src/Core/src/Animations/Animation.cs
index 9c2ea3f87d04..9ebfe3a13757 100644
--- a/src/Core/src/Animations/Animation.cs
+++ b/src/Core/src/Animations/Animation.cs
@@ -240,10 +240,8 @@ public virtual void Update(double percent)
Step?.Invoke(Progress);
HasFinished = percent == 1;
}
- catch (Exception ex)
+ catch (Exception)
{
- //TODO log exception
- Console.WriteLine(ex);
HasFinished = true;
}
}
diff --git a/src/Core/src/Animations/LerpingAnimation.cs b/src/Core/src/Animations/LerpingAnimation.cs
index 77867815b8cd..7dd0e0d3eee8 100644
--- a/src/Core/src/Animations/LerpingAnimation.cs
+++ b/src/Core/src/Animations/LerpingAnimation.cs
@@ -97,10 +97,8 @@ public override void Update(double percent)
if (Lerp != null! && StartValue != null && EndValue != null)
CurrentValue = Lerp.Calculate?.Invoke(StartValue, EndValue, Progress);
}
- catch (Exception ex)
+ catch (Exception)
{
- //TODO log exception
- Console.WriteLine(ex);
HasFinished = true;
}
}
diff --git a/src/Core/src/Fonts/EmbeddedFontLoader.Tizen.cs b/src/Core/src/Fonts/EmbeddedFontLoader.Tizen.cs
index 1f86f029b76c..ea8b0cc65f14 100644
--- a/src/Core/src/Fonts/EmbeddedFontLoader.Tizen.cs
+++ b/src/Core/src/Fonts/EmbeddedFontLoader.Tizen.cs
@@ -19,6 +19,13 @@ public partial class EmbeddedFontLoader : IEmbeddedFontLoader
///
public string? LoadFont(EmbeddedFont font)
{
+ var fontResourcePath = IOPath.Combine(TApplication.Current.DirectoryInfo.Resource, _fontCacheFolderName);
+ var fontResourceFilePath = IOPath.Combine(fontResourcePath, font.FontName!);
+ if (File.Exists(fontResourceFilePath))
+ {
+ return IOPath.GetFileNameWithoutExtension(fontResourceFilePath);
+ }
+
if (FontCacheDirectory == null)
{
FontCacheDirectory = Directory.CreateDirectory(IOPath.Combine(TApplication.Current.DirectoryInfo.Data, _fontCacheFolderName));
@@ -28,7 +35,10 @@ public partial class EmbeddedFontLoader : IEmbeddedFontLoader
var filePath = IOPath.Combine(FontCacheDirectory.FullName, font.FontName!);
var name = IOPath.GetFileNameWithoutExtension(filePath);
if (File.Exists(filePath))
+ {
return name;
+ }
+
try
{
using (var fileStream = File.Create(filePath))
@@ -38,6 +48,8 @@ public partial class EmbeddedFontLoader : IEmbeddedFontLoader
font.ResourceStream.CopyTo(fileStream);
}
+ Tizen.NUI.FontClient.Instance.AddCustomFontDirectory(FontCacheDirectory.FullName);
+
return name;
}
catch (Exception ex)
diff --git a/src/Core/src/Fonts/FontManager.Tizen.cs b/src/Core/src/Fonts/FontManager.Tizen.cs
index df6bd444b2dd..9daf1050b111 100644
--- a/src/Core/src/Fonts/FontManager.Tizen.cs
+++ b/src/Core/src/Fonts/FontManager.Tizen.cs
@@ -51,8 +51,7 @@ public string GetFont(Font font)
if (index != -1)
{
string font = cleansedFont.Substring(0, index);
- string style = cleansedFont.Substring(index + 1);
- return $"{font}:style={style}";
+ return $"{font}";
}
else
{
@@ -79,8 +78,7 @@ string GetNativeFontFamily((string? family, float size, FontSlant slant) fontKey
if (index != -1)
{
string font = cleansedFont.Substring(0, index);
- string style = cleansedFont.Substring(index + 1);
- return $"{font}:style={style}";
+ return $"{font}";
}
else
{
@@ -115,4 +113,4 @@ string GetNativeFontFamily((string? family, float size, FontSlant slant) fontKey
return fontFile.PostScriptName;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Core/src/Graphics/ShapeDrawable.cs b/src/Core/src/Graphics/ShapeDrawable.cs
index d1e74a70e82f..43a8f21c16a3 100644
--- a/src/Core/src/Graphics/ShapeDrawable.cs
+++ b/src/Core/src/Graphics/ShapeDrawable.cs
@@ -100,10 +100,7 @@ void DrawFillPath(ICanvas canvas, RectF dirtyRect, PathF path)
{
if (ShapeView == null || ShapeView.Shape == null)
return;
-
- if (!path.Closed)
- return;
-
+
canvas.SaveState();
canvas.FillColor = Colors.Transparent;
diff --git a/src/Core/src/Handlers/Button/ButtonHandler.Android.cs b/src/Core/src/Handlers/Button/ButtonHandler.Android.cs
index 6189c0bd618b..122659311709 100644
--- a/src/Core/src/Handlers/Button/ButtonHandler.Android.cs
+++ b/src/Core/src/Handlers/Button/ButtonHandler.Android.cs
@@ -124,58 +124,12 @@ void OnSetImageSource(Drawable? obj)
PlatformView.Icon = obj;
}
- bool NeedsExactMeasure()
- {
- if (VirtualView.VerticalLayoutAlignment != Primitives.LayoutAlignment.Fill
- && VirtualView.HorizontalLayoutAlignment != Primitives.LayoutAlignment.Fill)
- {
- // Layout Alignments of Start, Center, and End will be laying out the TextView at its measured size,
- // so we won't need another pass with MeasureSpecMode.Exactly
- return false;
- }
-
- if (VirtualView.Width >= 0 && VirtualView.Height >= 0)
- {
- // If the Width and Height are both explicit, then we've already done MeasureSpecMode.Exactly in
- // both dimensions; no need to do it again
- return false;
- }
-
- // We're going to need a second measurement pass so TextView can properly handle alignments
- return true;
- }
-
public override void PlatformArrange(Rect frame)
{
- var platformView = this.ToPlatform();
-
- if (platformView == null || Context == null)
- {
- return;
- }
-
- if (frame.Width < 0 || frame.Height < 0)
- {
- return;
- }
-
- // Depending on our layout situation, the TextView may need an additional measurement pass at the final size
- // in order to properly handle any TextAlignment properties.
- if (NeedsExactMeasure())
- {
- platformView.Measure(MakeMeasureSpecExact(frame.Width), MakeMeasureSpecExact(frame.Height));
- }
-
+ this.PrepareForTextViewArrange(frame);
base.PlatformArrange(frame);
}
- int MakeMeasureSpecExact(double size)
- {
- // Convert to a platform size to create the spec for measuring
- var deviceSize = (int)Context!.ToPixels(size);
- return MeasureSpecMode.Exactly.MakeMeasureSpec(deviceSize);
- }
-
bool OnTouch(IButton? button, AView? v, MotionEvent? e)
{
switch (e?.ActionMasked)
diff --git a/src/Core/src/Handlers/Editor/EditorHandler.Android.cs b/src/Core/src/Handlers/Editor/EditorHandler.Android.cs
index f33450c4389a..fc969a7cf682 100644
--- a/src/Core/src/Handlers/Editor/EditorHandler.Android.cs
+++ b/src/Core/src/Handlers/Editor/EditorHandler.Android.cs
@@ -2,6 +2,7 @@
using Android.Views;
using Android.Views.InputMethods;
using AndroidX.AppCompat.Widget;
+using Microsoft.Maui.Graphics;
using static Android.Views.View;
namespace Microsoft.Maui.Handlers
@@ -80,7 +81,7 @@ public static void MapPlaceholderColor(IEditorHandler handler, IEditor editor)
public static void MapCharacterSpacing(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateCharacterSpacing(editor);
- public static void MapMaxLength(IEditorHandler handler, IEditor editor) =>
+ public static void MapMaxLength(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateMaxLength(editor);
public static void MapIsReadOnly(IEditorHandler handler, IEditor editor) =>
@@ -92,7 +93,7 @@ public static void MapIsTextPredictionEnabled(IEditorHandler handler, IEditor ed
public static void MapFont(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateFont(editor, handler.GetRequiredService());
- public static void MapHorizontalTextAlignment(IEditorHandler handler, IEditor editor) =>
+ public static void MapHorizontalTextAlignment(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateHorizontalTextAlignment(editor);
public static void MapVerticalTextAlignment(IEditorHandler handler, IEditor editor) =>
@@ -131,5 +132,11 @@ private void OnSelectionChanged(object? sender, EventArgs e)
if (VirtualView.SelectionLength != selectedTextLength)
VirtualView.SelectionLength = selectedTextLength;
}
+
+ public override void PlatformArrange(Rect frame)
+ {
+ this.PrepareForTextViewArrange(frame);
+ base.PlatformArrange(frame);
+ }
}
}
\ No newline at end of file
diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Android.cs b/src/Core/src/Handlers/Entry/EntryHandler.Android.cs
index e0a1261cf187..1e24af5728a1 100644
--- a/src/Core/src/Handlers/Entry/EntryHandler.Android.cs
+++ b/src/Core/src/Handlers/Entry/EntryHandler.Android.cs
@@ -169,7 +169,7 @@ void OnEditorAction(object? sender, EditorActionEventArgs e)
}
}
- e.Handled = true;
+ e.Handled = false;
}
private void OnSelectionChanged(object? sender, EventArgs e)
diff --git a/src/Core/src/Handlers/Label/LabelHandler.Android.cs b/src/Core/src/Handlers/Label/LabelHandler.Android.cs
index 108f61bc3ce4..ac4f3fd7d229 100644
--- a/src/Core/src/Handlers/Label/LabelHandler.Android.cs
+++ b/src/Core/src/Handlers/Label/LabelHandler.Android.cs
@@ -11,25 +11,7 @@ protected override AppCompatTextView CreatePlatformView()
public override void PlatformArrange(Rect frame)
{
- var platformView = this.ToPlatform();
-
- if (platformView == null || Context == null)
- {
- return;
- }
-
- if (frame.Width < 0 || frame.Height < 0)
- {
- return;
- }
-
- // Depending on our layout situation, the TextView may need an additional measurement pass at the final size
- // in order to properly handle any TextAlignment properties.
- if (NeedsExactMeasure())
- {
- platformView.Measure(MakeMeasureSpecExact(frame.Width), MakeMeasureSpecExact(frame.Height));
- }
-
+ this.PrepareForTextViewArrange(frame);
base.PlatformArrange(frame);
}
@@ -84,33 +66,5 @@ public static void MapLineHeight(ILabelHandler handler, ILabel label)
{
handler.PlatformView?.UpdateLineHeight(label);
}
-
- bool NeedsExactMeasure()
- {
- if (VirtualView.VerticalLayoutAlignment != Primitives.LayoutAlignment.Fill
- && VirtualView.HorizontalLayoutAlignment != Primitives.LayoutAlignment.Fill)
- {
- // Layout Alignments of Start, Center, and End will be laying out the TextView at its measured size,
- // so we won't need another pass with MeasureSpecMode.Exactly
- return false;
- }
-
- if (VirtualView.Width >= 0 && VirtualView.Height >= 0)
- {
- // If the Width and Height are both explicit, then we've already done MeasureSpecMode.Exactly in
- // both dimensions; no need to do it again
- return false;
- }
-
- // We're going to need a second measurement pass so TextView can properly handle alignments
- return true;
- }
-
- int MakeMeasureSpecExact(double size)
- {
- // Convert to a native size to create the spec for measuring
- var deviceSize = (int)Context!.ToPixels(size);
- return MeasureSpecMode.Exactly.MakeMeasureSpec(deviceSize);
- }
}
}
\ No newline at end of file
diff --git a/src/Core/src/Handlers/Layout/LayoutHandler.Tizen.cs b/src/Core/src/Handlers/Layout/LayoutHandler.Tizen.cs
index 3142938681b0..c42463ca5c86 100644
--- a/src/Core/src/Handlers/Layout/LayoutHandler.Tizen.cs
+++ b/src/Core/src/Handlers/Layout/LayoutHandler.Tizen.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using NView = Tizen.NUI.BaseComponents.View;
@@ -6,6 +7,8 @@ namespace Microsoft.Maui.Handlers
{
public partial class LayoutHandler : ViewHandler
{
+ List _children = new List();
+
public override bool NeedsContainer =>
VirtualView?.Background != null ||
VirtualView?.Clip != null ||
@@ -39,10 +42,12 @@ public override void SetVirtualView(IView view)
PlatformView.CrossPlatformArrange = VirtualView.CrossPlatformArrange;
PlatformView.Children.Clear();
+ _children.Clear();
foreach (var child in VirtualView.OrderByZIndex())
{
PlatformView.Children.Add(child.ToPlatform(MauiContext));
+ _children.Add(child);
}
}
@@ -54,6 +59,7 @@ public void Add(IView child)
var targetIndex = VirtualView.GetLayoutHandlerIndex(child);
PlatformView.Children.Insert(targetIndex, child.ToPlatform(MauiContext));
+ _children.Insert(targetIndex, child);
EnsureZIndexOrder(child);
PlatformView.SetNeedMeasureUpdate();
}
@@ -66,6 +72,7 @@ public void Remove(IView child)
if (child.Handler is IPlatformViewHandler thandler && child?.ToPlatform() is NView childView)
{
PlatformView.Children.Remove(childView);
+ _children.Remove(child);
thandler.Dispose();
}
PlatformView.MarkChanged();
@@ -83,6 +90,13 @@ public void Clear()
{
child.Dispose();
}
+
+ foreach (var child in _children)
+ {
+ (child.Handler as IPlatformViewHandler)?.Dispose();
+ }
+ _children.Clear();
+
PlatformView.SetNeedMeasureUpdate();
}
@@ -94,6 +108,7 @@ public void Insert(int index, IView child)
var targetIndex = VirtualView.GetLayoutHandlerIndex(child);
PlatformView.Children.Insert(targetIndex, child.ToPlatform(MauiContext));
+ _children.Insert(targetIndex, child);
EnsureZIndexOrder(child);
PlatformView.SetNeedMeasureUpdate();
}
@@ -107,9 +122,13 @@ public void Update(int index, IView child)
var toBeRemoved = PlatformView.Children[index];
PlatformView.Children.RemoveAt(index);
toBeRemoved.Dispose();
+ var childToBeRemoved = _children[index];
+ _children.RemoveAt(index);
+ (childToBeRemoved as IPlatformViewHandler)?.Dispose();
var targetIndex = VirtualView.GetLayoutHandlerIndex(child);
PlatformView.Children.Insert(targetIndex, child.ToPlatform(MauiContext));
+ _children.Insert(targetIndex, child);
EnsureZIndexOrder(child);
PlatformView.SetNeedMeasureUpdate();
}
diff --git a/src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs b/src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
index 4a6a43da577b..b9cb7c873f56 100644
--- a/src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
+++ b/src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
@@ -150,21 +150,21 @@ static void InsertContentView(UIScrollView platformScrollView, IScrollView scrol
Tag = ContentPanelTag
};
- contentContainer.CrossPlatformArrange = ArrangeScrollViewContent(scrollView.CrossPlatformArrange, contentContainer);
+ contentContainer.CrossPlatformArrange = ArrangeScrollViewContent(scrollView.CrossPlatformArrange, contentContainer, platformScrollView);
platformScrollView.ClearSubviews();
contentContainer.AddSubview(platformContent);
platformScrollView.AddSubview(contentContainer);
}
- static Func ArrangeScrollViewContent(Func internalArrange, ContentView container)
+ static Func ArrangeScrollViewContent(Func internalArrange, ContentView container, UIScrollView platformScrollView)
{
return (rect) =>
{
if (container.Superview is UIScrollView scrollView)
{
// Ensure the container is at least the size of the UIScrollView itself, so that the
- // cross-platform layout logic makes sense and the contents don't arrange out side the
+ // cross-platform layout logic makes sense and the contents don't arrange outside the
// container. (Everything will look correct if they do, but hit testing won't work properly.)
var scrollViewBounds = scrollView.Bounds;
@@ -176,7 +176,9 @@ static Func ArrangeScrollViewContent(Func internalArrang
container.Center = new CGPoint(container.Bounds.GetMidX(), container.Bounds.GetMidY());
}
- return internalArrange(rect);
+ var contentSize = internalArrange(rect);
+ platformScrollView.ContentSize = contentSize;
+ return contentSize;
};
}
@@ -223,7 +225,7 @@ public override Size GetDesiredSize(double widthConstraint, double heightConstra
var virtualView = VirtualView;
var platformView = PlatformView;
- if (platformView == null || virtualView == null || virtualView.PresentedContent == null)
+ if (platformView == null || virtualView == null)
{
return new Size(widthConstraint, heightConstraint);
}
diff --git a/src/Core/src/Handlers/Stepper/StepperHandler.Android.cs b/src/Core/src/Handlers/Stepper/StepperHandler.Android.cs
index 6c802184f6b6..b570adbdabc0 100644
--- a/src/Core/src/Handlers/Stepper/StepperHandler.Android.cs
+++ b/src/Core/src/Handlers/Stepper/StepperHandler.Android.cs
@@ -36,6 +36,11 @@ protected override MauiStepper CreatePlatformView()
return stepperLayout;
}
+ public static void MapIsEnabled(IStepperHandler handler, IStepper stepper)
+ {
+ handler.PlatformView?.UpdateIsEnabled(stepper);
+ }
+
public static void MapMinimum(IStepperHandler handler, IStepper stepper)
{
handler.PlatformView?.UpdateMinimum(stepper);
diff --git a/src/Core/src/Handlers/Stepper/StepperHandler.cs b/src/Core/src/Handlers/Stepper/StepperHandler.cs
index 33f301cffd0e..ca0616e456f0 100644
--- a/src/Core/src/Handlers/Stepper/StepperHandler.cs
+++ b/src/Core/src/Handlers/Stepper/StepperHandler.cs
@@ -20,7 +20,9 @@ public partial class StepperHandler : IStepperHandler
[nameof(IStepper.Maximum)] = MapMaximum,
[nameof(IStepper.Minimum)] = MapMinimum,
[nameof(IStepper.Value)] = MapValue,
-#if WINDOWS
+#if ANDROID
+ [nameof(IStepper.IsEnabled)] = MapIsEnabled,
+#elif WINDOWS
[nameof(IStepper.Background)] = MapBackground,
#endif
};
diff --git a/src/Core/src/Handlers/ViewHandlerExtensions.Android.cs b/src/Core/src/Handlers/ViewHandlerExtensions.Android.cs
index e3a172e40bdd..7922d1681d0f 100644
--- a/src/Core/src/Handlers/ViewHandlerExtensions.Android.cs
+++ b/src/Core/src/Handlers/ViewHandlerExtensions.Android.cs
@@ -1,4 +1,6 @@
using System;
+using System.Runtime.CompilerServices;
+using Android.Content;
using Android.Views;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Platform;
@@ -132,5 +134,62 @@ internal static void PlatformArrangeHandler(this IViewHandler viewHandler, Rect
viewHandler.Invoke(nameof(IView.Frame), frame);
}
+
+ internal static void PrepareForTextViewArrange(this IViewHandler handler, Rect frame)
+ {
+ if (frame.Width < 0 || frame.Height < 0)
+ {
+ return;
+ }
+
+ var platformView = handler.ToPlatform();
+ var context = platformView?.Context;
+
+ if (platformView == null || context == null)
+ {
+ return;
+ }
+
+ var virtualView = handler.VirtualView;
+ if (virtualView == null)
+ {
+ return;
+ }
+
+ // Depending on our layout situation, the TextView may need an additional measurement pass at the final size
+ // in order to properly handle any TextAlignment properties and some internal bookkeeping
+ if (virtualView.NeedsExactMeasure())
+ {
+ platformView.Measure(context.MakeMeasureSpecExact(frame.Width), context.MakeMeasureSpecExact(frame.Height));
+ }
+ }
+
+ internal static bool NeedsExactMeasure(this IView virtualView)
+ {
+ if (virtualView.VerticalLayoutAlignment != Primitives.LayoutAlignment.Fill
+ && virtualView.HorizontalLayoutAlignment != Primitives.LayoutAlignment.Fill)
+ {
+ // Layout Alignments of Start, Center, and End will be laying out the TextView at its measured size,
+ // so we won't need another pass with MeasureSpecMode.Exactly
+ return false;
+ }
+
+ if (virtualView.Width >= 0 && virtualView.Height >= 0)
+ {
+ // If the Width and Height are both explicit, then we've already done MeasureSpecMode.Exactly in
+ // both dimensions; no need to do it again
+ return false;
+ }
+
+ // We're going to need a second measurement pass so TextView can properly handle alignments
+ return true;
+ }
+
+ internal static int MakeMeasureSpecExact(this Context context, double size)
+ {
+ // Convert to a native size to create the spec for measuring
+ var deviceSize = (int)context!.ToPixels(size);
+ return MeasureSpecMode.Exactly.MakeMeasureSpec(deviceSize);
+ }
}
}
diff --git a/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs b/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs
index 64e9898bf712..f0fd53dbecae 100644
--- a/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs
+++ b/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs
@@ -511,7 +511,7 @@ bool LoadFile(string url)
}
catch (Exception)
{
- Console.WriteLine($"Could not load {url} as local file");
+ MauiContext?.CreateLogger()?.LogWarning("Could not load {url} as local file", url);
}
return false;
diff --git a/src/Core/src/Layouts/LayoutExtensions.cs b/src/Core/src/Layouts/LayoutExtensions.cs
index ce34b3b4358f..da4dfde2433b 100644
--- a/src/Core/src/Layouts/LayoutExtensions.cs
+++ b/src/Core/src/Layouts/LayoutExtensions.cs
@@ -188,5 +188,38 @@ public static Size AdjustForFill(this Size size, Rect bounds, IView view)
return size;
}
+
+ ///
+ /// Arranges content which can exceed the bounds of the IContentView.
+ ///
+ ///
+ /// Useful for arranging content where the IContentView provides a viewport to a portion of the content (e.g,
+ /// the content of an IScrollView).
+ ///
+ ///
+ ///
+ /// The Size of the arranged content
+ public static Size ArrangeContentUnbounded(this IContentView contentView, Rect bounds)
+ {
+ var presentedContent = contentView.PresentedContent;
+
+ if (presentedContent == null)
+ {
+ return bounds.Size;
+ }
+
+ var padding = contentView.Padding;
+
+ // Normally we'd just want the content to be arranged within the ContentView's Frame,
+ // but in this case the content may exceed the size of the Frame.
+ // So in each dimension, we assume the larger of the two values.
+
+ bounds.Width = Math.Max(bounds.Width, presentedContent.DesiredSize.Width + padding.HorizontalThickness);
+ bounds.Height = Math.Max(bounds.Height, presentedContent.DesiredSize.Height + padding.VerticalThickness);
+
+ contentView.ArrangeContent(bounds);
+
+ return bounds.Size;
+ }
}
}
diff --git a/src/Controls/src/Core/Platform/Android/KeyboardManager.cs b/src/Core/src/Platform/Android/KeyboardManager.cs
similarity index 81%
rename from src/Controls/src/Core/Platform/Android/KeyboardManager.cs
rename to src/Core/src/Platform/Android/KeyboardManager.cs
index 7c353d255636..d25fda42006e 100644
--- a/src/Controls/src/Core/Platform/Android/KeyboardManager.cs
+++ b/src/Core/src/Platform/Android/KeyboardManager.cs
@@ -2,25 +2,27 @@
using Android.App;
using Android.Content;
using Android.OS;
+using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
+using AndroidX.Core.View;
using AView = Android.Views.View;
-namespace Microsoft.Maui.Controls.Platform
+namespace Microsoft.Maui.Platform
{
internal static class KeyboardManager
{
internal static void HideKeyboard(this AView inputView, bool overrideValidation = false)
{
- if (inputView == null)
+ if (inputView?.Context == null)
throw new ArgumentNullException(nameof(inputView) + " must be set before the keyboard can be hidden.");
- using (var inputMethodManager = (InputMethodManager)inputView.Context.GetSystemService(Context.InputMethodService))
+ using (var inputMethodManager = (InputMethodManager)inputView.Context.GetSystemService(Context.InputMethodService)!)
{
if (!overrideValidation && !(inputView is EditText || inputView is TextView || inputView is SearchView))
throw new ArgumentException("inputView should be of type EditText, SearchView, or TextView");
- IBinder windowToken = inputView.WindowToken;
+ var windowToken = inputView.WindowToken;
if (windowToken != null && inputMethodManager != null)
inputMethodManager.HideSoftInputFromWindow(windowToken, HideSoftInputFlags.None);
}
@@ -28,10 +30,10 @@ internal static void HideKeyboard(this AView inputView, bool overrideValidation
internal static void ShowKeyboard(this TextView inputView)
{
- if (inputView == null)
+ if (inputView?.Context == null)
throw new ArgumentNullException(nameof(inputView) + " must be set before the keyboard can be shown.");
- using (var inputMethodManager = (InputMethodManager)inputView.Context.GetSystemService(Context.InputMethodService))
+ using (var inputMethodManager = (InputMethodManager)inputView.Context.GetSystemService(Context.InputMethodService)!)
{
// The zero value for the second parameter comes from
// https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#showSoftInput(android.view.View,%20int)
@@ -42,7 +44,7 @@ internal static void ShowKeyboard(this TextView inputView)
internal static void ShowKeyboard(this SearchView searchView)
{
- if (searchView == null)
+ if (searchView?.Context == null || searchView?.Resources == null)
{
throw new ArgumentNullException(nameof(searchView));
}
@@ -64,7 +66,7 @@ internal static void ShowKeyboard(this SearchView searchView)
return;
}
- using (var inputMethodManager = (InputMethodManager)searchView.Context.GetSystemService(Context.InputMethodService))
+ using (var inputMethodManager = (InputMethodManager)searchView.Context.GetSystemService(Context.InputMethodService)!)
{
// The zero value for the second parameter comes from
// https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#showSoftInput(android.view.View,%20int)
@@ -102,5 +104,15 @@ void ShowKeyboard()
view.Post(ShowKeyboard);
}
+
+ public static bool IsSoftKeyboardVisible(this AView view)
+ {
+ var insets = ViewCompat.GetRootWindowInsets(view);
+ if (insets == null)
+ return false;
+
+ var result = insets.IsVisible(WindowInsetsCompat.Type.Ime());
+ return result;
+ }
}
}
\ No newline at end of file
diff --git a/src/Core/src/Platform/Android/WindowExtensions.cs b/src/Core/src/Platform/Android/WindowExtensions.cs
index 6b392030e5ab..f7aa040a8edd 100644
--- a/src/Core/src/Platform/Android/WindowExtensions.cs
+++ b/src/Core/src/Platform/Android/WindowExtensions.cs
@@ -1,5 +1,7 @@
using Android.App;
+using Android.Content;
using Android.Content.Res;
+using Android.Views;
using Microsoft.Maui.Devices;
using Microsoft.Maui.Platform;
@@ -20,5 +22,15 @@ internal static DisplayOrientation GetOrientation(this IWindow? window)
_ => DisplayOrientation.Unknown
};
}
+
+ internal static void UpdateWindowSoftInputModeAdjust(this IWindow platformView, SoftInput inputMode)
+ {
+ var activity = platformView?.Handler?.PlatformView as Activity ??
+ platformView?.Handler?.MauiContext?.GetPlatformWindow();
+
+ activity?
+ .Window?
+ .SetSoftInputMode(inputMode);
+ }
}
}
diff --git a/src/Core/src/Platform/Tizen/MauiApplication.cs b/src/Core/src/Platform/Tizen/MauiApplication.cs
index e1473d8492d9..84c5a0232a82 100644
--- a/src/Core/src/Platform/Tizen/MauiApplication.cs
+++ b/src/Core/src/Platform/Tizen/MauiApplication.cs
@@ -4,12 +4,16 @@
using Microsoft.Maui.LifecycleEvents;
using Tizen.Applications;
using Tizen.NUI;
+using IOPath = System.IO.Path;
+using TApplication = Tizen.Applications.Application;
using NView = Tizen.NUI.BaseComponents.View;
namespace Microsoft.Maui
{
public abstract class MauiApplication : NUIApplication, IPlatformApplication
{
+ const string _fontCacheFolderName = "fonts";
+
internal Func? _handleBackButtonPressed;
IMauiContext _applicationContext = null!;
@@ -28,6 +32,9 @@ protected override void OnPreCreate()
FocusManager.Instance.EnableDefaultAlgorithm(true);
NView.SetDefaultGrabTouchAfterLeave(true);
+ var fontResourcePath = IOPath.Combine(TApplication.Current.DirectoryInfo.Resource, _fontCacheFolderName);
+ FontClient.Instance.AddCustomFontDirectory(fontResourcePath);
+
var mauiApp = CreateMauiApp();
var rootContext = new MauiContext(mauiApp.Services);
diff --git a/src/Core/src/Properties/AssemblyInfo.cs b/src/Core/src/Properties/AssemblyInfo.cs
index 86013117cfdb..ee97638bb931 100644
--- a/src/Core/src/Properties/AssemblyInfo.cs
+++ b/src/Core/src/Properties/AssemblyInfo.cs
@@ -34,4 +34,5 @@
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Markup.UnitTests")]
[assembly: InternalsVisibleTo("Reloadify-emit")]
[assembly: InternalsVisibleTo("Microsoft.Maui.TestUtils.DeviceTests.Runners")]
+[assembly: InternalsVisibleTo("Microsoft.Maui.TestUtils.DeviceTests")]
[assembly: InternalsVisibleTo("Microsoft.Maui.DeviceTests.Shared")]
\ No newline at end of file
diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
index 311b9b9a7e54..acf7618aba29 100644
--- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
@@ -112,6 +112,7 @@ Microsoft.Maui.IWindow.MinimumHeight.get -> double
Microsoft.Maui.IWindow.MinimumWidth.get -> double
Microsoft.Maui.IWindow.X.get -> double
Microsoft.Maui.IWindow.Y.get -> double
+override Microsoft.Maui.Handlers.EditorHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect frame) -> void
override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object!
override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object!
override Microsoft.Maui.Handlers.EditorHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void
@@ -141,12 +142,14 @@ static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPrope
static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void
static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper!
static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper!
+static Microsoft.Maui.Handlers.StepperHandler.MapIsEnabled(Microsoft.Maui.Handlers.IStepperHandler! handler, Microsoft.Maui.IStepper! stepper) -> void
static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void
static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void
static Microsoft.Maui.Handlers.WindowHandler.MapHeight(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
static Microsoft.Maui.Handlers.WindowHandler.MapWidth(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
static Microsoft.Maui.Handlers.WindowHandler.MapX(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
static Microsoft.Maui.Platform.SwitchExtensions.GetDefaultSwitchThumbDrawable(this AndroidX.AppCompat.Widget.SwitchCompat! aSwitch) -> Android.Graphics.Drawables.Drawable?
static Microsoft.Maui.Platform.SwitchExtensions.GetDefaultSwitchTrackDrawable(this AndroidX.AppCompat.Widget.SwitchCompat! aSwitch) -> Android.Graphics.Drawables.Drawable?
static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this Android.Views.View! view, Microsoft.Maui.ToolTip? tooltip) -> void
diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
index 64ee29a45043..81d6723d28a4 100644
--- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
@@ -143,6 +143,7 @@ override Microsoft.Maui.Platform.LayoutView.UserInteractionEnabled.set -> void
*REMOVED*override Microsoft.Maui.Handlers.LabelHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect rect) -> void
*REMOVED*override Microsoft.Maui.Handlers.ScrollViewHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect frame) -> void
static Microsoft.Maui.Handlers.EditorHandler.MapIsEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
static Microsoft.Maui.Platform.TextViewExtensions.UpdateIsEnabled(this UIKit.UITextView! textView, Microsoft.Maui.IEditor! editor) -> void
override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptAlertPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void
override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void
diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
index 5a2eceae9b51..e7d42e5add7a 100644
--- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
@@ -143,6 +143,7 @@ override Microsoft.Maui.Platform.LayoutView.UserInteractionEnabled.set -> void
*REMOVED*override Microsoft.Maui.Handlers.LabelHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect rect) -> void
*REMOVED*override Microsoft.Maui.Handlers.ScrollViewHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect frame) -> void
static Microsoft.Maui.Handlers.EditorHandler.MapIsEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
static Microsoft.Maui.Platform.TextViewExtensions.UpdateIsEnabled(this UIKit.UITextView! textView, Microsoft.Maui.IEditor! editor) -> void
override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptAlertPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void
override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void
diff --git a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
index e2cec92b8367..16805db45ee5 100644
--- a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
@@ -2994,4 +2994,5 @@ static Microsoft.Maui.Handlers.SwipeItemMenuItemHandler.CommandMapper -> Microso
*REMOVED*Microsoft.Maui.Handlers.SwitchHandler.SwitchHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
*REMOVED*Microsoft.Maui.Handlers.ImageButtonHandler.ImageButtonHandler(Microsoft.Maui.IPropertyMapper! mapper) -> void
*REMOVED*Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
-*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
\ No newline at end of file
+*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
index abf1f58b6883..e31078c93b8b 100644
--- a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
@@ -139,6 +139,7 @@ static Microsoft.Maui.Handlers.WindowHandler.MapMinimumWidth(Microsoft.Maui.Hand
static Microsoft.Maui.Handlers.WindowHandler.MapWidth(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
static Microsoft.Maui.Handlers.WindowHandler.MapX(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this Microsoft.UI.Xaml.FrameworkElement! platformView, Microsoft.Maui.ToolTip? tooltip) -> void
static Microsoft.Maui.Platform.WindowExtensions.UpdateHeight(this Microsoft.UI.Xaml.Window! platformWindow, Microsoft.Maui.IWindow! window) -> void
static Microsoft.Maui.Platform.WindowExtensions.UpdateMaximumHeight(this Microsoft.UI.Xaml.Window! platformWindow, Microsoft.Maui.IWindow! window) -> void
diff --git a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt
index 79cac39a9f51..d8092b70fe1c 100644
--- a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt
@@ -184,4 +184,5 @@ static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindo
*REMOVED*Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void
Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper) -> void
Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper, Microsoft.Maui.CommandMapper? commandMapper) -> void
-*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
\ No newline at end of file
+*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt
index 3c78ee2a19e7..47eaf54e94cb 100644
--- a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt
@@ -184,4 +184,5 @@ static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindo
*REMOVED*Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void
Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper) -> void
Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper, Microsoft.Maui.CommandMapper? commandMapper) -> void
-*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
\ No newline at end of file
+*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
\ No newline at end of file
diff --git a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
index 91806ff0d416..c8ca2fabd379 100644
--- a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
@@ -184,4 +184,5 @@ static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindo
*REMOVED*Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void
Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper) -> void
Microsoft.Maui.Handlers.ContentViewHandler.ContentViewHandler(Microsoft.Maui.IPropertyMapper? mapper, Microsoft.Maui.CommandMapper? commandMapper) -> void
-*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
\ No newline at end of file
+*REMOVED*Microsoft.Maui.Handlers.ButtonHandler.ButtonHandler(Microsoft.Maui.IPropertyMapper? mapper = null) -> void
+static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size
diff --git a/src/Core/tests/DeviceTests.Shared/HandlerTests/HandlerTestBase.cs b/src/Core/tests/DeviceTests.Shared/HandlerTests/HandlerTestBase.cs
index adc8dab2005c..0a34569777d8 100644
--- a/src/Core/tests/DeviceTests.Shared/HandlerTests/HandlerTestBase.cs
+++ b/src/Core/tests/DeviceTests.Shared/HandlerTests/HandlerTestBase.cs
@@ -30,13 +30,14 @@ public void EnsureHandlerCreated(Action additionalCreationAction
_isCreated = true;
- var appBuilder = ConfigureBuilder(MauiApp.CreateBuilder());
+ var appBuilder = MauiApp.CreateBuilder();
- additionalCreationActions?.Invoke(appBuilder);
+ appBuilder.Services.AddSingleton(svc => TestDispatcher.Provider);
+ appBuilder.Services.AddScoped(svc => TestDispatcher.Current);
+ appBuilder.Services.AddSingleton((_) => new CoreApplicationStub());
- appBuilder.Services.TryAddSingleton(svc => TestDispatcher.Provider);
- appBuilder.Services.TryAddScoped(svc => TestDispatcher.Current);
- appBuilder.Services.TryAddSingleton((_) => new ApplicationStub());
+ appBuilder = ConfigureBuilder(appBuilder);
+ additionalCreationActions?.Invoke(appBuilder);
_mauiApp = appBuilder.Build();
_servicesProvider = _mauiApp.Services;
@@ -106,11 +107,9 @@ protected void InitializeViewHandler(IElement element, IElementHandler handler,
var w = size.Width;
var h = size.Height;
- if (double.IsPositiveInfinity(w))
- w = view.Width;
-
- if (double.IsPositiveInfinity(h))
- h = view.Height;
+ // No measure method should be returning infinite values
+ Assert.False(double.IsPositiveInfinity(w));
+ Assert.False(double.IsPositiveInfinity(h));
#else
// Windows cannot measure without the view being loaded
diff --git a/src/Core/tests/DeviceTests.Shared/Stubs/ApplicationStub.cs b/src/Core/tests/DeviceTests.Shared/Stubs/CoreApplicationStub.cs
similarity index 93%
rename from src/Core/tests/DeviceTests.Shared/Stubs/ApplicationStub.cs
rename to src/Core/tests/DeviceTests.Shared/Stubs/CoreApplicationStub.cs
index 14bf22301315..955cf3ba55b9 100644
--- a/src/Core/tests/DeviceTests.Shared/Stubs/ApplicationStub.cs
+++ b/src/Core/tests/DeviceTests.Shared/Stubs/CoreApplicationStub.cs
@@ -2,7 +2,7 @@
namespace Microsoft.Maui.DeviceTests.Stubs
{
- class ApplicationStub : IApplication
+ class CoreApplicationStub : IApplication
{
readonly List _windows = new List();
diff --git a/src/Core/tests/DeviceTests/Handlers/Button/ButtonHandlerTests.Android.cs b/src/Core/tests/DeviceTests/Handlers/Button/ButtonHandlerTests.Android.cs
index 203ac2fcae1a..206e1d1a83a1 100644
--- a/src/Core/tests/DeviceTests/Handlers/Button/ButtonHandlerTests.Android.cs
+++ b/src/Core/tests/DeviceTests/Handlers/Button/ButtonHandlerTests.Android.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Threading.Tasks;
using Android.Text;
using AndroidX.AppCompat.Widget;
@@ -77,6 +77,31 @@ public async Task CharacterSpacingInitializesCorrectly()
Assert.Equal(expectedValue, values.PlatformViewValue, EmCoefficientPrecision);
}
+ [Theory]
+ [InlineData("red.png", "#FF0000")]
+ [InlineData("green.png", "#00FF00")]
+ public async Task ImageSourceUpdatesCorrectly(string filename, string colorHex)
+ {
+ var image = new ButtonStub
+ {
+ ImageSource = new FileImageSourceStub("black.png"),
+ };
+
+ // Update the Button Icon
+ image.ImageSource = new FileImageSourceStub(filename);
+
+ await InvokeOnMainThreadAsync(async () =>
+ {
+ var handler = CreateHandler(image);
+
+ bool imageLoaded = await Wait(() => ImageSourceLoaded(handler));
+
+ Assert.True(imageLoaded);
+ var expectedColor = Color.FromArgb(colorHex);
+ await handler.PlatformView.AssertContainsColor(expectedColor);
+ });
+ }
+
AppCompatButton GetNativeButton(ButtonHandler buttonHandler) =>
buttonHandler.PlatformView;
diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs
index c762034be590..97045f148093 100644
--- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs
+++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs
@@ -4,6 +4,7 @@
using Microsoft.Maui.DeviceTests.Stubs;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Xunit;
namespace Microsoft.Maui.DeviceTests
@@ -494,6 +495,95 @@ await ValidateUnrelatedPropertyUnaffected(
() => entry.CharacterSpacing = newSize);
}
+#if ANDROID
+ [Fact]
+ public async Task NextMovesToNextEntrySuccessfully()
+ {
+ EnsureHandlerCreated(builder =>
+ {
+ builder.ConfigureMauiHandlers(handler =>
+ {
+ handler.AddHandler();
+ handler.AddHandler();
+ });
+ });
+
+ var layout = new VerticalStackLayoutStub();
+
+ var entry1 = new EntryStub
+ {
+ Text = "Entry 1",
+ ReturnType = ReturnType.Next
+ };
+
+ var entry2 = new EntryStub
+ {
+ Text = "Entry 2",
+ ReturnType = ReturnType.Next
+ };
+
+ layout.Add(entry1);
+ layout.Add(entry2);
+
+ layout.Width = 100;
+ layout.Height = 150;
+
+ await InvokeOnMainThreadAsync(async () =>
+ {
+ var contentViewHandler = CreateHandler(layout);
+ await contentViewHandler.PlatformView.AttachAndRun(async () =>
+ {
+ await entry1.SendKeyboardReturnType(ReturnType.Next);
+ await entry2.WaitForFocused();
+ Assert.True(entry2.IsFocused);
+ });
+ });
+ }
+
+ [Fact]
+ public async Task DoneClosesKeyboard()
+ {
+ EnsureHandlerCreated(builder =>
+ {
+ builder.ConfigureMauiHandlers(handler =>
+ {
+ handler.AddHandler();
+ handler.AddHandler();
+ });
+ });
+
+ var layout = new VerticalStackLayoutStub();
+
+ var entry1 = new EntryStub
+ {
+ Text = "Entry 1",
+ ReturnType = ReturnType.Done
+ };
+
+ var entry2 = new EntryStub
+ {
+ Text = "Entry 2",
+ ReturnType = ReturnType.Done
+ };
+
+ layout.Add(entry1);
+ layout.Add(entry2);
+
+ layout.Width = 100;
+ layout.Height = 150;
+
+ await InvokeOnMainThreadAsync(async () =>
+ {
+ var handler = CreateHandler(layout);
+ await handler.PlatformView.AttachAndRun(async () =>
+ {
+ await entry1.SendKeyboardReturnType(ReturnType.Done);
+ await entry1.WaitForKeyboardToHide();
+ });
+ });
+ }
+#endif
+
[Category(TestCategory.Entry)]
public class EntryTextStyleTests : TextStyleHandlerTests
{
diff --git a/src/Core/tests/DeviceTests/Handlers/Layout/LayoutHandlerTests.Windows.cs b/src/Core/tests/DeviceTests/Handlers/Layout/LayoutHandlerTests.Windows.cs
index 8cca2c630d00..670f89c2604a 100644
--- a/src/Core/tests/DeviceTests/Handlers/Layout/LayoutHandlerTests.Windows.cs
+++ b/src/Core/tests/DeviceTests/Handlers/Layout/LayoutHandlerTests.Windows.cs
@@ -1,9 +1,9 @@
-using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Xunit;
-using System.Collections.Generic;
-using System.Linq;
using LayoutPanel = Microsoft.Maui.Platform.LayoutPanel;
namespace Microsoft.Maui.DeviceTests.Handlers.Layout
diff --git a/src/Core/tests/DeviceTests/Handlers/ScrollView/ScrollViewHandlerTests.iOS.cs b/src/Core/tests/DeviceTests/Handlers/ScrollView/ScrollViewHandlerTests.iOS.cs
index 136280b5f659..a0f81c4d203d 100644
--- a/src/Core/tests/DeviceTests/Handlers/ScrollView/ScrollViewHandlerTests.iOS.cs
+++ b/src/Core/tests/DeviceTests/Handlers/ScrollView/ScrollViewHandlerTests.iOS.cs
@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Microsoft.Maui.Controls;
using Microsoft.Maui.DeviceTests.Stubs;
using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
using ObjCRuntime;
using UIKit;
@@ -16,14 +18,11 @@ public partial class ScrollViewHandlerTests : CoreHandlerTestBase { builder.ConfigureMauiHandlers(handlers => { handlers.AddHandler(); }); });
+
bool result = await InvokeOnMainThreadAsync(() =>
{
-
var entry = new EntryStub() { Text = "In a ScrollView" };
- var entryHandler = Activator.CreateInstance();
- entryHandler.SetMauiContext(MauiContext);
- entryHandler.SetVirtualView(entry);
- entry.Handler = entryHandler;
var scrollView = new ScrollViewStub()
{
@@ -34,8 +33,8 @@ public async Task ContentInitializesCorrectly()
foreach (var platformView in scrollViewHandler.PlatformView.Subviews)
{
- // ScrollView on iOS uses an intermediate ContentView to handle conetent measurement/arrangement
- if (platformView is ContentView contentView)
+ // ScrollView on iOS uses an intermediate ContentView to handle content measurement/arrangement
+ if (platformView is Microsoft.Maui.Platform.ContentView contentView)
{
foreach (var content in contentView.Subviews)
{
@@ -52,5 +51,34 @@ public async Task ContentInitializesCorrectly()
Assert.True(result, $"Expected (but did not find) a {nameof(MauiTextField)} in the Subviews array");
}
+
+ [Fact]
+ public async Task ScrollViewContentSizeSet()
+ {
+ EnsureHandlerCreated(builder => { builder.ConfigureMauiHandlers(handlers => { handlers.AddHandler(); }); });
+
+ var scrollView = new ScrollViewStub();
+ var entry = new EntryStub() { Text = "In a ScrollView" };
+ scrollView.Content = entry;
+
+ var scrollViewHandler = await InvokeOnMainThreadAsync(() =>
+ {
+ var handler = CreateHandler(scrollView);
+
+ // Setting an arbitrary value so we can verify that the handler is setting
+ // the UIScrollView's ContentSize property during AttachAndRun
+ handler.PlatformView.ContentSize = new CoreGraphics.CGSize(100, 100);
+ return handler;
+ });
+
+ await InvokeOnMainThreadAsync(async () => {
+ await scrollViewHandler.PlatformView.AttachAndRun(() =>
+ {
+ // Verify that the ContentSize values have been modified
+ Assert.NotEqual(100, scrollViewHandler.PlatformView.ContentSize.Height);
+ Assert.NotEqual(100, scrollViewHandler.PlatformView.ContentSize.Width);
+ });
+ });
+ }
}
}
diff --git a/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs b/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs
index 20368c813373..4b16d664952d 100644
--- a/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs
+++ b/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs
@@ -117,5 +117,26 @@ public async Task PolygonInitializesCorrectly()
await ValidateNativeFill(polygon, Colors.Lime);
}
+
+ [Theory(DisplayName = "Polyline Background Initializes Correctly")]
+ [InlineData(0xFF0000)]
+ [InlineData(0x00FF00)]
+ [InlineData(0x0000FF)]
+ public async Task PolylineBackgroundInitializesCorrectly(uint color)
+ {
+ var expected = Color.FromUint(color);
+
+ var polyline = new ShapeViewStub()
+ {
+ Shape = new PolylineShapeStub { Points = new PointCollectionStub() { new Point(10, 10), new Point(100, 50), new Point(50, 90) } },
+ Stroke = new SolidPaintStub(Colors.Green),
+ Background = new SolidPaintStub(expected),
+ StrokeThickness = 4,
+ Height = 50,
+ Width = 100
+ };
+
+ await ValidateHasColor(polyline, expected);
+ }
}
}
diff --git a/src/Core/tests/DeviceTests/Handlers/Stepper/StepperHandlerTests.Android.cs b/src/Core/tests/DeviceTests/Handlers/Stepper/StepperHandlerTests.Android.cs
index d780b5f21169..6569cbaf3776 100644
--- a/src/Core/tests/DeviceTests/Handlers/Stepper/StepperHandlerTests.Android.cs
+++ b/src/Core/tests/DeviceTests/Handlers/Stepper/StepperHandlerTests.Android.cs
@@ -1,13 +1,25 @@
using System;
using System.Threading.Tasks;
using Android.Widget;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Handlers;
+using Microsoft.Maui.DeviceTests.Stubs;
namespace Microsoft.Maui.DeviceTests
{
public partial class StepperHandlerTests
{
+ [Fact(DisplayName = "IsEnabled Initializes Correctly")]
+ public async Task IsEnabledInitializesCorrectly()
+ {
+ var stepper = new StepperStub()
+ {
+ Minimum = 0,
+ Maximum = 50,
+ IsEnabled = false
+ };
+
+ await ValidatePropertyInitValue(stepper, () => stepper.IsEnabled, GetNativeIsEnabled, stepper.IsEnabled);
+ }
+
LinearLayout GetNativeStepper(StepperHandler stepperHandler) =>
stepperHandler.PlatformView;
@@ -44,6 +56,16 @@ double GetNativeMinimum(StepperHandler stepperHandler)
return 0;
}
+ bool GetNativeIsEnabled(StepperHandler stepperHandler)
+ {
+ var platformView = GetNativeStepper(stepperHandler);
+
+ var minimumButton = platformView.GetChildAt(0);
+ var maximumButton = platformView.GetChildAt(1);
+
+ return minimumButton.Enabled && maximumButton.Enabled;
+ }
+
Task ValidateHasColor(IStepper stepper, Color color, Action action = null)
{
return InvokeOnMainThreadAsync(() =>
diff --git a/src/Core/tests/DeviceTests/Services/ImageSource/BaseImageSourceServiceTests.cs b/src/Core/tests/DeviceTests/Services/ImageSource/BaseImageSourceServiceTests.cs
index d56d30902cd1..9f5f1785acb5 100644
--- a/src/Core/tests/DeviceTests/Services/ImageSource/BaseImageSourceServiceTests.cs
+++ b/src/Core/tests/DeviceTests/Services/ImageSource/BaseImageSourceServiceTests.cs
@@ -1,5 +1,5 @@
-using System.Threading.Tasks;
using System.Threading;
+using System.Threading.Tasks;
namespace Microsoft.Maui.DeviceTests
{
diff --git a/src/Core/tests/DeviceTests/Stubs/LayoutStub.cs b/src/Core/tests/DeviceTests/Stubs/LayoutStub.cs
index df8be84fe999..b11d956bc509 100644
--- a/src/Core/tests/DeviceTests/Stubs/LayoutStub.cs
+++ b/src/Core/tests/DeviceTests/Stubs/LayoutStub.cs
@@ -77,7 +77,9 @@ public Size CrossPlatformArrange(Rect bounds)
public int Count => _children.Count;
public bool IsReadOnly => _children.IsReadOnly;
- ILayoutManager LayoutManager => _layoutManager ??= new LayoutManagerStub();
+ ILayoutManager LayoutManager => _layoutManager ??= CreateLayoutManager();
+
+ protected virtual ILayoutManager CreateLayoutManager() => new LayoutManagerStub();
public bool IgnoreSafeArea => false;
diff --git a/src/Core/tests/DeviceTests/Stubs/ScrollViewStub.cs b/src/Core/tests/DeviceTests/Stubs/ScrollViewStub.cs
index 765699b762ff..c436b5becfb8 100644
--- a/src/Core/tests/DeviceTests/Stubs/ScrollViewStub.cs
+++ b/src/Core/tests/DeviceTests/Stubs/ScrollViewStub.cs
@@ -1,6 +1,4 @@
-using Microsoft.Maui.Graphics;
-
-namespace Microsoft.Maui.DeviceTests.Stubs
+namespace Microsoft.Maui.DeviceTests.Stubs
{
public partial class ScrollViewStub : StubBase, IScrollView
{
diff --git a/src/Core/tests/DeviceTests/Stubs/StubBase.cs b/src/Core/tests/DeviceTests/Stubs/StubBase.cs
index ec1426bfc7d1..ba09c7da4bce 100644
--- a/src/Core/tests/DeviceTests/Stubs/StubBase.cs
+++ b/src/Core/tests/DeviceTests/Stubs/StubBase.cs
@@ -95,6 +95,11 @@ public Size Arrange(Rect bounds)
{
Frame = bounds;
DesiredSize = bounds.Size;
+
+ // If this view is attached to the visual tree then let's arrange it
+ if (IsLoaded)
+ Handler?.PlatformArrange(Frame);
+
return DesiredSize;
}
@@ -130,7 +135,8 @@ public Size Measure(double widthConstraint, double heightConstraint)
{
if (Handler != null)
{
- return Handler.GetDesiredSize(widthConstraint, heightConstraint);
+ DesiredSize = Handler.GetDesiredSize(widthConstraint, heightConstraint);
+ return DesiredSize;
}
return new Size(widthConstraint, heightConstraint);
@@ -139,5 +145,14 @@ public Size Measure(double widthConstraint, double heightConstraint)
IReadOnlyList IVisualTreeElement.GetVisualChildren() => this.Children.Cast().ToList().AsReadOnly();
IVisualTreeElement IVisualTreeElement.GetVisualParent() => this.Parent as IVisualTreeElement;
+
+
+ public bool IsLoaded
+ {
+ get
+ {
+ return (Handler as IPlatformViewHandler)?.PlatformView?.IsLoaded() == true;
+ }
+ }
}
}
diff --git a/src/Core/tests/DeviceTests/Stubs/VerticalStackLayoutStub.cs b/src/Core/tests/DeviceTests/Stubs/VerticalStackLayoutStub.cs
new file mode 100644
index 000000000000..dd150c8b7437
--- /dev/null
+++ b/src/Core/tests/DeviceTests/Stubs/VerticalStackLayoutStub.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Maui.Layouts;
+
+namespace Microsoft.Maui.DeviceTests.Stubs
+{
+ public class VerticalStackLayoutStub : LayoutStub, IStackLayout
+ {
+ public double Spacing => 0;
+
+ protected override ILayoutManager CreateLayoutManager()
+ {
+ return new VerticalStackLayoutManager(this);
+ }
+ }
+}
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/AppAction.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/AppAction.xml
deleted file mode 100644
index b4e6607a1406..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/AppAction.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- To be added.
- To be added.
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
-
-
-
- To be added.
- To be added.
- To be added.
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/AppActionEventArgs.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/AppActionEventArgs.xml
deleted file mode 100644
index 2d512c63bea7..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/AppActionEventArgs.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- To be added.
- To be added.
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.AppAction
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/AppActions.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/AppActions.xml
deleted file mode 100644
index 96ecaf43afe7..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/AppActions.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- To be added.
- To be added.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Maui.Essentials.AppAction>>
-
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Event
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventHandler<Microsoft.Maui.Essentials.AppActionEventArgs>
-
-
- To be added.
- To be added.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
- To be added.
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
- System.ParamArray
-
-
-
-
-
- To be added.
- To be added.
- To be added.
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/AppInfo.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/AppInfo.xml
deleted file mode 100644
index 165e50a913ee..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/AppInfo.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Represents information about the application.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the application build number.
- The application build number.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the application name.
- The application name.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the application package name or identifier.
- The package name or identifier.
- On Android and iOS, this is the application package name. On UWP, this is the application GUID.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.AppTheme
-
-
- Gets the detected Theme of the system or application.
- The Theme.
- For platforms or platform versions which aren't supported, Unspecified is returned.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Void
-
-
-
- Open the settings menu or page for the application.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Version
-
-
- Gets the application version.
- The application version.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the application version.
- The application version.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/AppTheme.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/AppTheme.xml
deleted file mode 100644
index e829c9e364c4..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/AppTheme.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Application Theme Type
-
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.AppTheme
-
- 2
-
- Dark Theme
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.AppTheme
-
- 1
-
- Light Theme
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.AppTheme
-
- 0
-
- Default, Unknown or Unspecified Theme
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Barometer.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Barometer.xml
deleted file mode 100644
index 5db6a30ec470..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/Barometer.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Monitor changes to the atmospheric pressure.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
- Gets if barometer is actively being monitored.
- If barometer is being monitored.
-
-
-
-
-
-
-
- Event
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventHandler<Microsoft.Maui.Essentials.BarometerChangedEventArgs>
-
-
- Event triggered when barometer reading changes.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Void
-
-
-
-
-
- The speed to listen for changes.
- Start monitoring for changes to the barometer.
- Will throw FeatureNotSupportedException if not supported on device.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Void
-
-
-
- Stop monitoring for changes to the barometer.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BarometerChangedEventArgs.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BarometerChangedEventArgs.xml
deleted file mode 100644
index f255ff163b7b..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BarometerChangedEventArgs.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- The current pressure information from the change event.
-
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
- The current reading
- Public constructor for barometer changed event args.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BarometerData
-
-
- Gets the current barometer pressure data
- Pressure in hPA
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BarometerData.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BarometerData.xml
deleted file mode 100644
index cbff201b0e34..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BarometerData.xml
+++ /dev/null
@@ -1,199 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.ValueType
-
-
-
- System.IEquatable<Microsoft.Maui.Essentials.BarometerData>
-
-
-
-
- System.Runtime.CompilerServices.IsReadOnly
-
-
-
-
- Contains the pressure measured by the user's device.
-
-
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
- The current pressure
- Public constructor for barometer data.
- To be added.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
- Object to compare
- If equal to another object
- If equal
-
-
-
-
-
-
-
- Method
-
- M:System.IEquatable`1.Equals(`0)
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
- Other object to compare
- If equal to another object
- If equal
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Int32
-
-
-
- Get has code for object.
- The hash code.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
-
- Left to compare
- Right to compare
- If equal to another object
- If equal
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
-
- Left to comapre
- Right to comapre
- If not equal to another object
- If not equal
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Double
-
-
- Gets the current pressure in hectopascals.
-
- To be added.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
-
- Outputs the data as a string.
-
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Battery.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Battery.xml
deleted file mode 100644
index 8c0d53807f10..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/Battery.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Methods and properties for battery and charging information of the device.
-
- Platform specific remarks:
- - Android: Battery_Stats permission must be set in manifest.
- - iOS: Simulator will not return battery information, must be run on device
- - UWP: None
-
-
-
-
-
-
-
- Event
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.EventHandler<Microsoft.Maui.Essentials.BatteryInfoChangedEventArgs>
-
-
- Event trigger when battery properties have changed.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Double
-
-
- Gets the current charge level of the device from 0.0 to 1.0.
-
- Level of charge. Returns -1 if no battery exists.
-
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.EnergySaverStatus
-
-
- Gets the current energy saver status of the device.
- The current status of energy saver mode.
-
-
-
-
-
-
-
- Event
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventHandler<Microsoft.Maui.Essentials.EnergySaverStatusChangedEventArgs>
-
-
- Event that is triggered when energy saver status changes.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
-
- Gets the current power source for the device.
-
- Power source, or uknown.
-
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
-
- Gets the charging state of the device if it can be determined.
- Battery state, or unknown.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryInfoChangedEventArgs.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryInfoChangedEventArgs.xml
deleted file mode 100644
index 5d69c5c2098b..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryInfoChangedEventArgs.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- Battery changed information.
- Returns the current information of the battery.
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
-
-
- The current level of the batter.
- The state of the battery
- The source of the battery
- The public constructor.
- To be added.
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Double
-
-
- Gets the current charge level of the device from 0.0 to 1.0.
- Level of charge.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
-
- Gets the current power source for the device.
- Power source, or unknown
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
-
- Gets the charging state of the device if it can be determined.
- Battery state, or unknown.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
-
- Outputs the data as a string.
-
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryPowerSource.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryPowerSource.xml
deleted file mode 100644
index c6f6b2942ffe..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryPowerSource.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- How the device and battery are currently being powered or charged.
-
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
- 2
-
- Power source is an AC Charger.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
- 1
-
- Power source is the battery and not being charge.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
- 0
-
- Power source can not be determined.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
- 3
-
- Power source is a USB port.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryPowerSource
-
- 4
-
- Power source is wireless.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryState.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryState.xml
deleted file mode 100644
index 3f79b950746b..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BatteryState.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- The current state of the battery and if it is being charged or full.
-
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
- 1
-
- Battery is acively being charged by a power source.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
- 2
-
- Battery is not plugged in and discharging.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
- 3
-
- Battery is full.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
- 4
-
- Battery is not charging or discharging, but in an inbetween state.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
- 5
-
- Battery does not exist on the device.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BatteryState
-
- 0
-
- Battery state could not be determined.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Browser.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Browser.xml
deleted file mode 100644
index 67b66f3b85d6..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/Browser.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Provides a way to display a web page inside an app.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
- Uri to launch.
- Open the browser to specified uri.
- Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
- Uri to launch.
- Open the browser to specified uri.
- Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
-
- Uri to launch.
- How to launch the browser.
- Open the browser to specified uri.
- Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
-
- Uri to launch.
- Launch options for the browser.
- Open the browser to specified uri.
- Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
-
- Uri to launch.
- How to launch the browser.
- Open the browser to specified uri.
- Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task<System.Boolean>
-
-
-
-
-
-
- Uri to launch.
- Launch options for the browser.
- Open the browser to specified uri.
- Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchFlags.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchFlags.xml
deleted file mode 100644
index 9c5a2421a692..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchFlags.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
-
- System.Flags
-
-
-
- Additional flags that can be set to control how the browser opens.
-
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserLaunchFlags
-
- 1
-
- On Android to launch the new activity adjacent to the current one if available.
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserLaunchFlags
-
- 0
-
- No additional flags. This is the default.
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserLaunchFlags
-
- 4
-
- On iOS to launch the browser as a form sheet with system preferred browser where supported.
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserLaunchFlags
-
- 2
-
- On iOS to launch the browser as a page sheet with system preferred browser where supported.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchMode.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchMode.xml
deleted file mode 100644
index 2de7a074c114..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchMode.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Launch type of the browser.
- Recommended to use the SystemBrowser as it is the default and falls back to UriLauncher.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BrowserLaunchMode
-
- 1
-
- Use the default external launcher to open the browser outside of the app.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.BrowserLaunchMode
-
- 0
-
- Launch the optimized system browser and stay inside of your application. (Chrome Custom Tabs and SFSafariViewController).
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchOptions.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchOptions.xml
deleted file mode 100644
index 06bb55492020..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserLaunchOptions.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Optional setting to open the browser with.
- These settings do not apply to all operation systems. Check documentation for more information.
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
- Default constructor.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserLaunchFlags
-
-
- Additional launch flags that may or may not take effect based on the device and launch mode.
- To be added.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserLaunchMode
-
-
- Launch type of the browser.
- The launch type.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Nullable<System.Drawing.Color>
-
-
- Preferred color of the controls on the browser.
- Gets the color for controls.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Nullable<System.Drawing.Color>
-
-
- Preferred color of the background toolbar.
- Gets the toolbar color.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserTitleMode
-
-
- Preferred mode for the title display.
- Gets the title display mode.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserTitleMode.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserTitleMode.xml
deleted file mode 100644
index 6041f8b1f094..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/BrowserTitleMode.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Mode for the title.
-
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserTitleMode
-
- 0
-
- Uses the system default showing it.
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserTitleMode
-
- 2
-
-
- Hide the title.
-
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.BrowserTitleMode
-
- 1
-
- Show the title.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Clipboard.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Clipboard.xml
deleted file mode 100644
index cf31e29b8559..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/Clipboard.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Provides a way to work with text on the device clipboard.
-
-
-
-
-
-
-
- Event
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventHandler<System.EventArgs>
-
-
- Fires when the clipboard content changes.
-
-
-
-
-
-
-
- Method
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Threading.Tasks.Task<System.String>
-
-
-
- Returns any text that is on the clipboard.
- Returns text that is on the clipboard, or null if there is none.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Boolean
-
-
- Gets a value indicating whether there is any text on the clipboard.
-
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task
-
-
-
-
-
- The text to put on the clipboard.
- Sets the contents of the clipboard to be the specified text.
- Returns text that is on the clipboard, or null if there is none.
- This method returns immediately and does not guarentee that the text is on the clipboard by the time this method returns
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/ConnectionProfile.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/ConnectionProfile.xml
deleted file mode 100644
index b355c1303156..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/ConnectionProfile.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Describes the type of connection the device is using.
-
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.ConnectionProfile
-
- 1
-
- The bluetooth data connection.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.ConnectionProfile
-
- 2
-
- The mobile/cellular data connection.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.ConnectionProfile
-
- 3
-
- The ethernet data connection.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.ConnectionProfile
-
- 0
-
- Other unknown type of connection.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.ConnectionProfile
-
- 4
-
- The WiFi data connection.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Connectivity.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Connectivity.xml
deleted file mode 100644
index 4e434a42b57b..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/Connectivity.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Connectivity and networking helpers.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Collections.Generic.IEnumerable<Microsoft.Maui.Essentials.ConnectionProfile>
-
-
- Gets the active connectivity types for the device.
- List of all connection profiles.
-
- Can throw PermissionException on Android if ACCESS_NETWORK_STATE is not set in manifest.
-
-
-
-
-
-
-
- Event
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.EventHandler<Microsoft.Maui.Essentials.ConnectivityChangedEventArgs>
-
-
-
- Event that is triggered when a network access or profile has changed.
-
-
- Can throw PermissionException on Android if ACCESS_NETWORK_STATE is not set in manifest.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
-
- Gets the current state of network access. Does not guarantee full access to the internet.
- The current network access state.
-
- Can throw PermissionException on Android if ACCESS_NETWORK_STATE is not set in manifest.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/ConnectivityChangedEventArgs.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/ConnectivityChangedEventArgs.xml
deleted file mode 100644
index d478c9d23708..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/ConnectivityChangedEventArgs.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- The current connectivity information from the change event.
-
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
-
- The current access of the network
- The connection profiles of the events changing
- Public constructor
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Collections.Generic.IEnumerable<Microsoft.Maui.Essentials.ConnectionProfile>
-
-
- Gets the active connectivity types for the device.
- List of all connection profiles.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
-
- Gets the current state of network access. Does not guarantee full access to the internet.
- The current network access state.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
-
- The string representation of the event.
-
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml
deleted file mode 100644
index 8108620ce158..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- API class for working with contacts on the device.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Maui.ApplicationModel.Communication.Contact>>
-
-
-
-
-
- A token for cancelling the operation
- Gets a collection of all the contacts on the device.
- Returns a collection of contacts on the device.
-
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Threading.Tasks.Task<Microsoft.Maui.ApplicationModel.Communication.Contact>
-
-
-
- Starts file picker for selecting a single contact.
- Returns a single contact, or null if the user cancelled the operation.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceDisplay.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceDisplay.xml
deleted file mode 100644
index da140d69dab3..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceDisplay.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Represents information about the device screen.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
- Gets or sets if the screen shold be kept on.
- If the screen keep on is set.
-
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.DisplayInfo
-
-
- Gets the main screens display info.
- The main screen display info.
-
-
-
-
-
-
-
- Event
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventHandler<Microsoft.Maui.Essentials.DisplayInfoChangedEventArgs>
-
-
- Event that is triggered when the main display info changes.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceInfo.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceInfo.xml
deleted file mode 100644
index 04f92dd4a6ff..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceInfo.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
- Represents information about the device.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.DeviceType
-
-
- Gets the type of device the application is running on.
- The device type.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.DeviceIdiom
-
-
- Gets the idiom of the device.
- The idiom.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the manufacturer of the device.
- Device manufacturer.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the model of the device.
- Device model.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the name of the device.
- The name of the device (often specified by the user).
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.DevicePlatform
-
-
- Gets the platform or operating system of the device.
- The platform of device.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.Version
-
-
- Gets the version of the operating system.
- The device operating system.
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- System.String
-
-
- Gets the version of the operating system.
- The version of the operating system.
-
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceType.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceType.xml
deleted file mode 100644
index 135bddf8d8e0..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/DeviceType.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Various types of devices.
-
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.DeviceType
-
- 1
-
- The device is a physical device, such as an iPhone, Android tablet or Windows desktop.
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.DeviceType
-
- 0
-
- An unknown device type.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.DeviceType
-
- 2
-
- The device is virtual, such as the iOS simulators, Android emulators or Windows emulators.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/DisplayInfoChangedEventArgs.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/DisplayInfoChangedEventArgs.xml
deleted file mode 100644
index e4c1d61a919c..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/DisplayInfoChangedEventArgs.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- Main display information event arguments.
-
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
- The display info for the event
- Main constructor for event args.
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.DisplayInfo
-
-
- Gets the current display info for the main display.
- The current display info.
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/EnergySaverStatus.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/EnergySaverStatus.xml
deleted file mode 100644
index 2d7361108990..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/EnergySaverStatus.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Status of energy saver on the device.
-
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.EnergySaverStatus
-
- 2
-
- Energy save is off
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.EnergySaverStatus
-
- 1
-
- Energy saver is on
-
-
-
-
-
-
- Field
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.EnergySaverStatus
-
- 0
-
- Status of energy saver is unknown.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/EnergySaverStatusChangedEventArgs.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/EnergySaverStatusChangedEventArgs.xml
deleted file mode 100644
index eee79eeabcdf..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/EnergySaverStatusChangedEventArgs.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- Event arguments when the energy saver status changes.
- To be added.
-
-
-
-
-
-
- Constructor
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
-
-
-
- The current status of the event.
- Public constructor for event arguments
- To be added.
-
-
-
-
-
-
- Property
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- Microsoft.Maui.Essentials.EnergySaverStatus
-
-
- Gets the current status of energy saver mode
- The current statu of the energy saver mode.
- To be added.
-
-
-
-
-
-
- Method
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.String
-
-
-
- A string representation of the event arguments.
- A string representation of the event arguments.
- To be added.
-
-
-
-
diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/NetworkAccess.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/NetworkAccess.xml
deleted file mode 100644
index 3a0b75b7f8f6..000000000000
--- a/src/Essentials/docs/Microsoft.Maui.Essentials/NetworkAccess.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
- Microsoft.Maui.Essentials
- 1.0.0.0
-
-
- System.Enum
-
-
- Various states of the connection to the internet.
-
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
- 3
-
- Limited internet access.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
- 4
-
- Local and Internet access.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
- 2
-
- Local network access only.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
- 1
-
- No connectivity.
-
-
-
-
-
-
- Field
-
- 1.0.0.0
- Microsoft.Maui.Essentials
-
-
- Microsoft.Maui.Essentials.NetworkAccess
-
- 0
-
- The state of the connectivity is not known.
-
-
-
-
diff --git a/src/Essentials/docs/en/Xamarin.Essentials/Accelerometer.xml b/src/Essentials/docs/en/Xamarin.Essentials/Accelerometer.xml
deleted file mode 100644
index f5ce665b3a5e..000000000000
--- a/src/Essentials/docs/en/Xamarin.Essentials/Accelerometer.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Object
-
-
-
-
- Accelerometer data of the acceleration of the device in three dimensional space.
-
-
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Xamarin.Essentials
-
-
- System.Boolean
-
-
- Gets if accelerometer is being monitored.
- If monitoring.
-
-
-
-
-
-
-
- Event
-
- 1.0.0.0
- Xamarin.Essentials
-
-
- System.EventHandler<Xamarin.Essentials.AccelerometerChangedEventArgs>
-
-
- Event triggered when reading of sensor changes.
-
-
-
-
-
-
-
- Event
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.EventHandler
-
-
- Event triggered when a shake has been detected on the device.
-
-
-
-
-
-
-
- Method
-
- 1.0.0.0
- Xamarin.Essentials
-
-
- System.Void
-
-
-
-
-
-
- Speed to monitor the sensor.
-
- Start monitoring for changes to accelerometer.
- Will throw FeatureNotSupportedException if not supported on device. Will throw ArgumentNullException if handler is null.
-
-
-
-
-
-
- Method
-
- 1.0.0.0
- Xamarin.Essentials
-
-
- System.Void
-
-
-
- Stop monitoring for changes to accelerometer.
-
-
-
-
-
diff --git a/src/Essentials/docs/en/Xamarin.Essentials/AccelerometerChangedEventArgs.xml b/src/Essentials/docs/en/Xamarin.Essentials/AccelerometerChangedEventArgs.xml
deleted file mode 100644
index 85a35a3296d2..000000000000
--- a/src/Essentials/docs/en/Xamarin.Essentials/AccelerometerChangedEventArgs.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.EventArgs
-
-
-
- Event arguments containing the current reading.
-
-
-
-
-
-
-
- Constructor
-
- Xamarin.Essentials
- 1.0.0.0
-
-
-
-
-
- The accelerometer data reading.
- Public constructor that takes in a reading for event arguments.
- To be added.
-
-
-
-
-
-
- Property
-
- 1.0.0.0
- Xamarin.Essentials
-
-
- Xamarin.Essentials.AccelerometerData
-
-
- The current values of accelerometer.
- The reading.
-
-
-
-
-
diff --git a/src/Essentials/docs/en/Xamarin.Essentials/AccelerometerData.xml b/src/Essentials/docs/en/Xamarin.Essentials/AccelerometerData.xml
deleted file mode 100644
index 18a79394a8b8..000000000000
--- a/src/Essentials/docs/en/Xamarin.Essentials/AccelerometerData.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-
-
-
-
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.ValueType
-
-
-
- System.IEquatable<Xamarin.Essentials.AccelerometerData>
-
-
-
-
- System.Runtime.CompilerServices.IsReadOnly
-
-
-
- Data representing the devies' three accelerometers.
-
-
-
-
-
-
-
- Constructor
-
- Xamarin.Essentials
- 1.0.0.0
-
-
-
-
-
-
-
- X data
- Y data
- Z data
- Public constructor for accelerometer data.
- To be added.
-
-
-
-
-
-
- Constructor
-
- Xamarin.Essentials
- 1.0.0.0
-
-
-
-
-
-
-
- X data
- Y data
- X data
- Public constructor for accelerometer data.
- To be added.
-
-
-
-
-
-
- Property
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Numerics.Vector3
-
-
- Gets the acceleration vector in G's (gravitational force).
-
-
-
-
-
-
-
-
- Method
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
- Object to compare
- If equal to another object
- If equal
-
-
-
-
-
-
-
- Method
-
- M:System.IEquatable`1.Equals(`0)
-
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
- Other AccelerometerData to compare with.
- Compares the underlying Vector3 instances.
- True if they are equal, otherwise false.
-
-
-
-
-
-
-
- Method
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Int32
-
-
-
- Get the hash code for object.
- The hash code
-
-
-
-
-
-
-
- Method
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
-
- Left to compare
- Right to compare
- Equality operator for equals
- If equal
-
-
-
-
-
-
-
- Method
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.Boolean
-
-
-
-
-
-
- Left to check
- Right to check
- Inequality check
- If not equal
-
-
-
-
-
-
-
- Method
-
- Xamarin.Essentials
- 1.0.0.0
-
-
- System.String
-
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
diff --git a/src/Essentials/src/Accelerometer/Accelerometer.netstandard.tvos.macos.cs b/src/Essentials/src/Accelerometer/Accelerometer.netstandard.tvos.macos.cs
index 62ea0bfe1e63..10d80d30e007 100644
--- a/src/Essentials/src/Accelerometer/Accelerometer.netstandard.tvos.macos.cs
+++ b/src/Essentials/src/Accelerometer/Accelerometer.netstandard.tvos.macos.cs
@@ -2,7 +2,6 @@
namespace Microsoft.Maui.Devices.Sensors
{
- ///
partial class AccelerometerImplementation
{
public bool IsSupported =>
diff --git a/src/Essentials/src/Accelerometer/Accelerometer.shared.cs b/src/Essentials/src/Accelerometer/Accelerometer.shared.cs
index b9d31fbdcbef..c381ca8939c0 100644
--- a/src/Essentials/src/Accelerometer/Accelerometer.shared.cs
+++ b/src/Essentials/src/Accelerometer/Accelerometer.shared.cs
@@ -5,50 +5,97 @@
namespace Microsoft.Maui.Devices.Sensors
{
+ ///
+ /// Accelerometer data of the acceleration of the device in three-dimensional space.
+ ///
public interface IAccelerometer
{
+ ///
+ /// Occurs when the sensor reading changes.
+ ///
event EventHandler? ReadingChanged;
+ ///
+ /// Occurs when the accelerometer detects that the device has been shaken.
+ ///
event EventHandler? ShakeDetected;
+ ///
+ /// Gets a value indicating whether reading the accelerometer is supported on this device.
+ ///
bool IsSupported { get; }
+ ///
+ /// Gets a value indicating whether the accelerometer is being monitored.
+ ///
bool IsMonitoring { get; }
+ ///
+ /// Start monitoring for changes to accelerometer.
+ ///
+ ///
+ /// Will throw if is .
+ /// Will throw if is .
+ /// Speed to monitor the sensor.
void Start(SensorSpeed sensorSpeed);
+ ///
+ /// Stop monitoring for changes to accelerometer.
+ ///
void Stop();
}
- ///
+ ///
+ /// Accelerometer data of the acceleration of the device in three dimensional space.
+ ///
public static class Accelerometer
{
+ ///
+ /// Occurs when the accelerometer reading changes.
+ ///
public static event EventHandler ReadingChanged
{
add => Default.ReadingChanged += value;
remove => Default.ReadingChanged -= value;
}
+ ///
+ /// Occurs when the accelerometer detects that the device has been shaken.
+ ///
public static event EventHandler ShakeDetected
{
add => Default.ShakeDetected += value;
remove => Default.ShakeDetected -= value;
}
+ ///
+ /// Gets a value indicating whether reading the accelerometer is supported on this device.
+ ///
public static bool IsSupported
=> Default.IsSupported;
- ///
+ ///
+ /// Gets a value indicating whether the accelerometer is being monitored.
+ ///
public static bool IsMonitoring => Default.IsMonitoring;
- ///
+ ///
+ /// Start monitoring for changes to accelerometer.
+ ///
+ /// Will throw if not supported on device. Will throw if handler is null.
+ /// Speed to monitor the sensor.
public static void Start(SensorSpeed sensorSpeed) => Default.Start(sensorSpeed);
- ///
+ ///
+ /// Stop monitoring for changes to accelerometer.
+ ///
public static void Stop() => Default.Stop();
static IAccelerometer? defaultImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IAccelerometer Default =>
defaultImplementation ??= new AccelerometerImplementation();
@@ -56,51 +103,89 @@ internal static void SetDefault(IAccelerometer? implementation) =>
defaultImplementation = implementation;
}
- ///
+ ///
+ /// Event arguments containing the current reading of .
+ ///
public class AccelerometerChangedEventArgs : EventArgs
{
- ///
+ ///
+ /// Public constructor that takes in a reading for event arguments.
+ ///
+ /// The accelerometer data reading.
public AccelerometerChangedEventArgs(AccelerometerData reading) => Reading = reading;
- ///
+ ///
+ /// The current values of accelerometer.
+ ///
public AccelerometerData Reading { get; }
}
- ///
+ ///
+ /// Data representing the devices' three accelerometers.
+ ///
public readonly struct AccelerometerData : IEquatable
{
- ///
+ ///
+ /// Public constructor for accelerometer data.
+ ///
+ /// X data
+ /// Y data
+ /// Z data
public AccelerometerData(double x, double y, double z)
: this((float)x, (float)y, (float)z)
{
}
- ///
+ ///
+ /// Public constructor for accelerometer data.
+ ///
+ /// X data
+ /// Y data
+ /// Z data
public AccelerometerData(float x, float y, float z) =>
Acceleration = new Vector3(x, y, z);
- ///
+ ///
+ /// Gets the acceleration vector in G's (gravitational force).
+ ///
public Vector3 Acceleration { get; }
- ///
public override bool Equals(object? obj) =>
(obj is AccelerometerData data) && Equals(data);
- ///
+ ///
+ /// Compares the underlying instances.
+ ///
+ /// object to compare with.
+ /// if they are equal, otherwise .
public bool Equals(AccelerometerData other) =>
Acceleration.Equals(other.Acceleration);
+ ///
+ /// Equality operator for equals.
+ ///
+ /// Left to compare.
+ /// Left to compare.
+ /// if objects are equal, otherwise .
public static bool operator ==(AccelerometerData left, AccelerometerData right) =>
left.Equals(right);
+ ///
+ /// Inequality operator.
+ ///
+ /// Left to compare.
+ /// Left to compare.
+ /// if objects are not equal, otherwise .
public static bool operator !=(AccelerometerData left, AccelerometerData right) =>
!left.Equals(right);
- ///
public override int GetHashCode() =>
Acceleration.GetHashCode();
- ///
+ ///
+ /// Returns a string representation of the current values of .
+ ///
+ /// A string representation of this instance in the format of X: x, Y: y, Z: z.
public override string ToString() =>
$"{nameof(Acceleration.X)}: {Acceleration.X}, " +
$"{nameof(Acceleration.Y)}: {Acceleration.Y}, " +
@@ -117,12 +202,18 @@ partial class AccelerometerImplementation : IAccelerometer
static bool useSyncContext;
+ ///
public event EventHandler? ReadingChanged;
+ ///
public event EventHandler? ShakeDetected;
+ ///
public bool IsMonitoring { get; private set; }
+ ///
+ /// Thrown if returns .
+ /// Thrown if returns .
public void Start(SensorSpeed sensorSpeed)
{
if (!IsSupported)
@@ -145,6 +236,8 @@ public void Start(SensorSpeed sensorSpeed)
}
}
+ ///
+ /// Thrown if returns .
public void Stop()
{
if (!IsSupported)
diff --git a/src/Essentials/src/AppActions/AppActions.netstandard.tvos.watchos.macos.tizen.cs b/src/Essentials/src/AppActions/AppActions.netstandard.tvos.watchos.macos.tizen.cs
index 7b5cf849608d..07ff21eaf2ab 100755
--- a/src/Essentials/src/AppActions/AppActions.netstandard.tvos.watchos.macos.tizen.cs
+++ b/src/Essentials/src/AppActions/AppActions.netstandard.tvos.watchos.macos.tizen.cs
@@ -4,7 +4,6 @@
namespace Microsoft.Maui.ApplicationModel
{
- ///
partial class AppActionsImplementation : IAppActions
{
public bool IsSupported =>
diff --git a/src/Essentials/src/AppActions/AppActions.shared.cs b/src/Essentials/src/AppActions/AppActions.shared.cs
index ebfa6592cae2..fdf6f217c4f0 100755
--- a/src/Essentials/src/AppActions/AppActions.shared.cs
+++ b/src/Essentials/src/AppActions/AppActions.shared.cs
@@ -5,47 +5,107 @@
namespace Microsoft.Maui.ApplicationModel
{
+ ///
+ /// The AppActions API lets you create and respond to app shortcuts from the app icon.
+ ///
public interface IAppActions
{
+ ///
+ /// Gets if app actions are supported on this device.
+ ///
bool IsSupported { get; }
+ ///
+ /// Retrieves all the currently available instances.
+ ///
+ /// A collection of available for this app.
Task> GetAsync();
+ ///
+ /// Sets the app actions that will be available for this app.
+ ///
+ /// A collection of that is to be set for this app.
+ /// A object with the current status of the asynchronous operation.
Task SetAsync(IEnumerable actions);
+ ///
+ /// Event triggered when an app action is activated.
+ ///
event EventHandler? AppActionActivated;
}
+ ///
+ /// Provides abstractions for the platform lifecycle events that are triggered when using App Actions.
+ ///
public interface IPlatformAppActions
{
#if WINDOWS
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// Event arguments containing information about the launch of the application.
+ /// A object with the current status of the asynchronous operation.
Task OnLaunched(UI.Xaml.LaunchActivatedEventArgs e);
#elif IOS || MACCATALYST
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// The instance this action is performed for.
+ /// The shortcut item that was chosen from the app icon.
+ /// The completion handler that is triggered when this action has completed.
void PerformActionForShortcutItem(UIKit.UIApplication application, UIKit.UIApplicationShortcutItem shortcutItem, UIKit.UIOperationHandler completionHandler);
#elif ANDROID
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// The provided to launch this app with.
void OnNewIntent(Android.Content.Intent? intent);
+
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// The provided to resume this app with.
void OnResume(Android.Content.Intent? intent);
#endif
}
- ///
+ ///
+ /// The AppActions API lets you create and respond to app shortcuts from the app icon.
+ ///
public static class AppActions
{
+ ///
+ /// Gets if app actions are supported on this device.
+ ///
public static bool IsSupported
=> Current.IsSupported;
- ///
+ ///
+ /// Retrieves all the currently available instances.
+ ///
+ /// A collection of available for this app.
public static Task> GetAsync()
=> Current.GetAsync();
- ///
+ ///
+ /// Sets the app actions that will be available for this app.
+ ///
+ /// objects that will be set for this app.
+ /// A object with the current status of the asynchronous operation.
public static Task SetAsync(params AppAction[] actions)
=> Current.SetAsync(actions);
- ///
+ ///
+ /// Sets the app actions that will be available for this app.
+ ///
+ /// A collection of that is to be set for this app.
+ /// A object with the current status of the asynchronous operation.
public static Task SetAsync(IEnumerable actions)
=> Current.SetAsync(actions);
+ ///
+ /// Occurs when an app action is activated.
+ ///
public static event EventHandler? OnAppAction
{
add => Current.AppActionActivated += value;
@@ -54,6 +114,9 @@ public static event EventHandler? OnAppAction
static IAppActions? currentImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IAppActions Current =>
currentImplementation ??= new AppActionsImplementation();
@@ -61,6 +124,9 @@ internal static void SetCurrent(IAppActions? implementation) =>
currentImplementation = implementation;
}
+ ///
+ /// Supporting extension methods for the AppActions API.
+ ///
public static partial class AppActionsExtensions
{
static IPlatformAppActions AsPlatform(this IAppActions appActions)
@@ -72,35 +138,74 @@ static IPlatformAppActions AsPlatform(this IAppActions appActions)
}
#if WINDOWS
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// Instance of the object this event is invoked on.
+ /// Event arguments containing information about the launch of the application.
+ /// A object with the current status of the asynchronous operation.
public static Task OnLaunched(this IAppActions appActions, UI.Xaml.LaunchActivatedEventArgs e) =>
appActions.AsPlatform().OnLaunched(e);
#elif IOS || MACCATALYST
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// Instance of the object this event is invoked on.
+ /// The instance this action is performed for.
+ /// The shortcut item that was chosen from the app icon.
+ /// The completion handler that is triggered when this action has completed.
public static void PerformActionForShortcutItem(this IAppActions appActions, UIKit.UIApplication application, UIKit.UIApplicationShortcutItem shortcutItem, UIKit.UIOperationHandler completionHandler) =>
appActions.AsPlatform().PerformActionForShortcutItem(application, shortcutItem, completionHandler);
#elif ANDROID
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// Instance of the object this event is invoked on.
+ /// The provided to launch this app with.
public static void OnNewIntent(this IAppActions appActions, Android.Content.Intent? intent) =>
appActions.AsPlatform().OnNewIntent(intent);
+ ///
+ /// The lifecycle event that is triggered when this app is launched.
+ ///
+ /// Instance of the object this event is invoked on.
+ /// The provided to resume this app with.
public static void OnResume(this IAppActions appActions, Android.Content.Intent? intent) =>
appActions.AsPlatform().OnResume(intent);
#endif
}
- ///
+ ///
+ /// Event arguments containing data that is used when the app started through an .
+ ///
public class AppActionEventArgs : EventArgs
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The that triggered this event.
public AppActionEventArgs(AppAction appAction)
: base() => AppAction = appAction;
- ///
+ ///
+ /// Gets the that triggered this event.
+ ///
public AppAction AppAction { get; }
}
- ///
+ ///
+ /// The class lets you create and respond to app shortcuts from the app icon.
+ ///
public class AppAction
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A unique identifier used to respond to the action tap.
+ /// The visible title to display on the app icon.
+ /// If supported, a sub-title to display under the title.
+ /// An icon that is shown next to the title.
+ /// Thrown when either or is .
public AppAction(string id, string title, string? subtitle = null, string? icon = null)
{
Id = id ?? throw new ArgumentNullException(nameof(id));
@@ -110,13 +215,20 @@ public AppAction(string id, string title, string? subtitle = null, string? icon
Icon = icon;
}
- ///
+ ///
+ /// Gets or sets the visible title to display on the app icon.
+ ///
public string Title { get; set; }
- ///
+ ///
+ /// Gets or sets a sub-title to display under the .
+ ///
+ /// Not supported on all platforms.
public string? Subtitle { get; set; }
- ///
+ ///
+ /// Gets or sets the unique identifier used to respond to the action tap.
+ ///
public string Id { get; set; }
internal string? Icon { get; set; }
diff --git a/src/Essentials/src/AppInfo/AppInfo.netstandard.cs b/src/Essentials/src/AppInfo/AppInfo.netstandard.cs
index 988852093c31..6e73c70dae4e 100644
--- a/src/Essentials/src/AppInfo/AppInfo.netstandard.cs
+++ b/src/Essentials/src/AppInfo/AppInfo.netstandard.cs
@@ -1,6 +1,5 @@
namespace Microsoft.Maui.ApplicationModel
{
- ///
class AppInfoImplementation : IAppInfo
{
public string PackageName => throw ExceptionUtils.NotSupportedOrImplementedException;
diff --git a/src/Essentials/src/AppInfo/AppInfo.shared.cs b/src/Essentials/src/AppInfo/AppInfo.shared.cs
index 0d9d00b0c244..badcde29d1c8 100644
--- a/src/Essentials/src/AppInfo/AppInfo.shared.cs
+++ b/src/Essentials/src/AppInfo/AppInfo.shared.cs
@@ -3,57 +3,118 @@
namespace Microsoft.Maui.ApplicationModel
{
+ ///
+ /// Represents information about the application.
+ ///
public interface IAppInfo
{
+ ///
+ /// Gets the application package name or identifier.
+ ///
+ /// On Android and iOS, this is the application package name. On Windows, this is the application GUID.
string PackageName { get; }
+ ///
+ /// Gets the application name.
+ ///
string Name { get; }
+ ///
+ /// Gets the application version as a string representation.
+ ///
string VersionString { get; }
+ ///
+ /// Gets the application version as a object.
+ ///
Version Version { get; }
+ ///
+ /// Gets the application build number.
+ ///
string BuildString { get; }
+ ///
+ /// Open the settings menu or page for this application.
+ ///
void ShowSettingsUI();
+ ///
+ /// Gets the detected theme of the system or application.
+ ///
+ /// For platforms or platform versions which do not support themes, is returned.
AppTheme RequestedTheme { get; }
+ ///
+ /// Gets the packaging model of this application.
+ ///
+ /// On other platforms than Windows, this will always return .
AppPackagingModel PackagingModel { get; }
+ ///
+ /// Gets the requested layout direction of the system or application.
+ ///
LayoutDirection RequestedLayoutDirection { get; }
}
- ///
+ ///
+ /// Represents information about the application.
+ ///
public static class AppInfo
{
- ///
+ ///
+ /// Gets the application package name or identifier.
+ ///
+ /// On Android and iOS, this is the application package name. On Windows, this is the application GUID.
public static string PackageName => Current.PackageName;
- ///
+ ///
+ /// Gets the application name.
+ ///
public static string Name => Current.Name;
- ///
+ ///
+ /// Gets the application version as a string representation.
+ ///
public static string VersionString => Current.VersionString;
- ///
+ ///
+ /// Gets the application version as a object.
+ ///
public static Version Version => Current.Version;
- ///
+ ///
+ /// Gets the application build number.
+ ///
public static string BuildString => Current.BuildString;
- ///
+ ///
+ /// Open the settings menu or page for this application.
+ ///
public static void ShowSettingsUI() => Current.ShowSettingsUI();
- ///
+ ///
+ /// Gets the detected theme of the system or application.
+ ///
+ /// For platforms or platform versions which do not support themes, is returned.
public static AppTheme RequestedTheme => Current.RequestedTheme;
+ ///
+ /// Gets the packaging model of this application.
+ ///
+ /// On other platforms than Windows, this will always return .
public static AppPackagingModel PackagingModel => Current.PackagingModel;
+ ///
+ /// Gets the requested layout direction of the system or application.
+ ///
public static LayoutDirection RequestedLayoutDirection => Current.RequestedLayoutDirection;
static IAppInfo? currentImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IAppInfo Current =>
currentImplementation ??= new AppInfoImplementation();
@@ -61,9 +122,15 @@ internal static void SetCurrent(IAppInfo? implementation) =>
currentImplementation = implementation;
}
+ ///
+ /// Describes packaging options for a Windows app.
+ ///
public enum AppPackagingModel
{
+ /// The app is packaged and can be distributed through an MSIX or the store.
Packaged,
+
+ /// The app is unpcakged and can be distributed as a collection of executable files.
Unpackaged,
}
}
diff --git a/src/Essentials/src/AppInfo/AppInfo.uwp.cs b/src/Essentials/src/AppInfo/AppInfo.uwp.cs
index fe438daa1894..525df3828d30 100644
--- a/src/Essentials/src/AppInfo/AppInfo.uwp.cs
+++ b/src/Essentials/src/AppInfo/AppInfo.uwp.cs
@@ -17,6 +17,9 @@ class AppInfoImplementation : IAppInfo
readonly ActiveWindowTracker _activeWindowTracker;
+ ///
+ /// Intializes a new object with default values.
+ ///
public AppInfoImplementation()
{
_activeWindowTracker = new(WindowStateManager.Default);
@@ -107,11 +110,25 @@ static class AppInfoUtils
return false;
});
+ ///
+ /// Gets if this app is a packaged app.
+ ///
public static bool IsPackagedApp => _isPackagedAppLazy.Value;
+ ///
+ /// Converts a object to a object.
+ ///
+ /// The to convert.
+ /// A new object with the version information of this app.
public static Version ToVersion(this PackageVersion version) =>
new Version(version.Major, version.Minor, version.Build, version.Revision);
+ ///
+ /// Gets the version information for this app.
+ ///
+ /// The assembly to retrieve the version information for.
+ /// The key that is used to retrieve the version information from the metadata.
+ /// if is or empty, or no version information could be found with the value of .
public static Version GetAppInfoVersionValue(this Assembly assembly, string name)
{
if (assembly.GetAppInfoValue(name) is string value && !string.IsNullOrEmpty(value))
@@ -120,9 +137,21 @@ public static Version GetAppInfoVersionValue(this Assembly assembly, string name
return null;
}
+ ///
+ /// Gets the app info from this apps' metadata.
+ ///
+ /// The assembly to retrieve the app info for.
+ /// The key of the metadata to be retrieved (e.g. PackageName, PublisherName or Name).
+ /// The value that corresponds to the given key in .
public static string GetAppInfoValue(this Assembly assembly, string name) =>
assembly.GetMetadataAttributeValue("Microsoft.Maui.ApplicationModel.AppInfo." + name);
+ ///
+ /// Gets the value for a given key from the assembly metadata.
+ ///
+ /// The assembly to retrieve the information for.
+ /// The key of the metadata to be retrieved (e.g. PackageName, PublisherName or Name).
+ /// The value that corresponds to the given key in .
public static string GetMetadataAttributeValue(this Assembly assembly, string key)
{
foreach (var attr in assembly.GetCustomAttributes())
diff --git a/src/Essentials/src/AppInfo/AppTheme.shared.cs b/src/Essentials/src/AppInfo/AppTheme.shared.cs
index e77f0306feaf..00e1e085f71e 100644
--- a/src/Essentials/src/AppInfo/AppTheme.shared.cs
+++ b/src/Essentials/src/AppInfo/AppTheme.shared.cs
@@ -1,13 +1,17 @@
namespace Microsoft.Maui.ApplicationModel
{
- ///
+ ///
+ /// Enumerates different themes an operating system or application can show.
+ ///
public enum AppTheme
{
- ///
+ /// Default, unknown or unspecified theme.
Unspecified,
- ///
+
+ /// Light theme.
Light,
- ///
+
+ /// Dark theme.
Dark
}
}
diff --git a/src/Essentials/src/AppInfo/LayoutDirection.shared.cs b/src/Essentials/src/AppInfo/LayoutDirection.shared.cs
index 65a08c53a33a..a912ebef6f1c 100644
--- a/src/Essentials/src/AppInfo/LayoutDirection.shared.cs
+++ b/src/Essentials/src/AppInfo/LayoutDirection.shared.cs
@@ -4,10 +4,18 @@
namespace Microsoft.Maui.ApplicationModel
{
+ ///
+ /// Enumerates possible layout directions.
+ ///
public enum LayoutDirection
{
+ /// The requested layout direction is unknown.
Unknown,
+
+ /// The requested layout direction is left-to-right.
LeftToRight,
+
+ /// The requested layout direction is right-to-left.
RightToLeft
}
}
diff --git a/src/Essentials/src/Barometer/Barometer.android.cs b/src/Essentials/src/Barometer/Barometer.android.cs
index b8c6125603c8..e606814c056a 100644
--- a/src/Essentials/src/Barometer/Barometer.android.cs
+++ b/src/Essentials/src/Barometer/Barometer.android.cs
@@ -37,11 +37,18 @@ void PlatformStop()
class BarometerListener : Java.Lang.Object, ISensorEventListener, IDisposable
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The handler that is invoked when a change in the barometer reading is detected.
public BarometerListener(Action changeHandler)
{
ChangeHandler = changeHandler;
}
+ ///
+ /// A reference to the action that invoked when a change in the barometer reading has been detected.
+ ///
public readonly Action ChangeHandler;
void ISensorEventListener.OnAccuracyChanged(Sensor? sensor, SensorStatus accuracy)
diff --git a/src/Essentials/src/Barometer/Barometer.shared.cs b/src/Essentials/src/Barometer/Barometer.shared.cs
index c7a0820d550d..2fe5818b0ab9 100644
--- a/src/Essentials/src/Barometer/Barometer.shared.cs
+++ b/src/Essentials/src/Barometer/Barometer.shared.cs
@@ -4,44 +4,85 @@
namespace Microsoft.Maui.Devices.Sensors
{
+ ///
+ /// Monitor changes to the atmospheric pressure.
+ ///
public interface IBarometer
{
+ ///
+ /// Gets a value indicating whether reading the barometer is supported on this device.
+ ///
bool IsSupported { get; }
+ ///
+ /// Gets a value indicating whether the barometer is actively being monitored.
+ ///
bool IsMonitoring { get; }
+ ///
+ /// Start monitoring for changes to the barometer.
+ ///
+ /// The speed to listen for changes.
void Start(SensorSpeed sensorSpeed);
+ ///
+ /// Occurs when the barometer reading changes.
+ ///
event EventHandler? ReadingChanged;
+ ///
+ /// Stop monitoring for changes to the barometer.
+ ///
void Stop();
}
- ///
+ ///
+ /// Monitor changes to the atmospheric pressure.
+ ///
public static class Barometer
{
+ ///
+ /// Occurs when barometer reading changes.
+ ///
public static event EventHandler ReadingChanged
{
add => Default.ReadingChanged += value;
remove => Default.ReadingChanged -= value;
}
+ ///
+ /// Gets a value indicating whether reading the accelerometer is supported on this device.
+ ///
public static bool IsSupported => Default.IsSupported;
- ///
+ ///
+ /// Gets a value indicating whether the barometer is actively being monitored.
+ ///
public static bool IsMonitoring
=> Default.IsMonitoring;
- ///
+ ///
+ /// Start monitoring for changes to the barometer.
+ ///
+ ///
+ /// Will throw if not supported on device.
+ /// Will throw if is .
+ ///
+ /// The speed to listen for changes.
public static void Start(SensorSpeed sensorSpeed)
=> Default.Start(sensorSpeed);
- ///
+ ///
+ /// Stop monitoring for changes to the barometer.
+ ///
public static void Stop()
=> Default.Stop();
static IBarometer? defaultImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IBarometer Default =>
defaultImplementation ??= new BarometerImplementation();
@@ -49,46 +90,82 @@ internal static void SetDefault(IBarometer? implementation) =>
defaultImplementation = implementation;
}
- ///
+ ///
+ /// Contains the current pressure information from the event.
+ ///
public class BarometerChangedEventArgs : EventArgs
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The barometer data reading.
public BarometerChangedEventArgs(BarometerData reading) =>
Reading = reading;
- ///
+ ///
+ /// The current values of the barometer.
+ ///
public BarometerData Reading { get; }
}
- ///
+ ///
+ /// Contains the pressure measured by the user's device barometer.
+ ///
public readonly struct BarometerData : IEquatable
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The current pressure reading.
public BarometerData(double pressure) =>
PressureInHectopascals = pressure;
- ///
+ ///
+ /// Gets the current pressure in hectopascals.
+ ///
public double PressureInHectopascals { get; }
+ ///
+ /// Equality operator for equals.
+ ///
+ /// Left to compare.
+ /// Left to compare.
+ /// if objects are equal, otherwise .
public static bool operator ==(BarometerData left, BarometerData right) =>
left.Equals(right);
+ ///
+ /// Inequality operator.
+ ///
+ /// Left to compare.
+ /// Left to compare.
+ /// if objects are not equal, otherwise .
public static bool operator !=(BarometerData left, BarometerData right) =>
!left.Equals(right);
- ///
+ ///
+ /// Compares the underlying instances.
+ ///
+ /// Object to compare with.
+ /// if they are equal, otherwise .
public override bool Equals(object? obj) =>
(obj is BarometerData data) && Equals(data);
- ///
+ ///
+ /// Compares the underlying instances.
+ ///
+ /// object to compare with.
+ /// if they are equal, otherwise .
public bool Equals(BarometerData other) =>
PressureInHectopascals.Equals(other.PressureInHectopascals);
- ///
public override int GetHashCode() =>
PressureInHectopascals.GetHashCode();
- ///
+ ///
+ /// Returns a string representation of the current values of .
+ ///
+ /// A string representation of this instance in the format of PressureInHectopascals: {value}.
public override string ToString() => $"{nameof(PressureInHectopascals)}: {PressureInHectopascals}";
}
@@ -114,6 +191,9 @@ void RaiseReadingChanged(BarometerData reading)
ReadingChanged?.Invoke(this, args);
}
+ ///
+ /// Thrown if returns .
+ /// Thrown if returns .
public void Start(SensorSpeed sensorSpeed)
{
if (!IsSupported)
@@ -136,6 +216,8 @@ public void Start(SensorSpeed sensorSpeed)
}
}
+ ///
+ /// Thrown if returns .
public void Stop()
{
if (!IsSupported)
diff --git a/src/Essentials/src/Battery/Battery.netstandard.tvos.cs b/src/Essentials/src/Battery/Battery.netstandard.tvos.cs
index 806797366650..fc8964f420f4 100755
--- a/src/Essentials/src/Battery/Battery.netstandard.tvos.cs
+++ b/src/Essentials/src/Battery/Battery.netstandard.tvos.cs
@@ -2,7 +2,6 @@
namespace Microsoft.Maui.Devices
{
- ///
partial class BatteryImplementation : IBattery
{
void StartBatteryListeners() =>
diff --git a/src/Essentials/src/Battery/Battery.shared.cs b/src/Essentials/src/Battery/Battery.shared.cs
index ee58e81625e9..db0221c85dfb 100755
--- a/src/Essentials/src/Battery/Battery.shared.cs
+++ b/src/Essentials/src/Battery/Battery.shared.cs
@@ -3,44 +3,87 @@
namespace Microsoft.Maui.Devices
{
+ ///
+ /// Methods and properties for battery and charging information of the device.
+ ///
+ ///
+ /// Platform specific remarks:
+ /// - Android: Battery_Stats permission must be set in manifest.
+ /// - iOS: Simulator will not return battery information, must be run on device.
+ /// - Windows: None.
+ ///
public interface IBattery
{
+ ///
+ /// Gets the current charge level of the device from 0.0 to 1.0.
+ ///
+ /// Returns -1 if no battery exists.
double ChargeLevel { get; }
+ ///
+ /// Gets the charging state of the device.
+ ///
BatteryState State { get; }
+ ///
+ /// Gets the current power source for the device.
+ ///
BatteryPowerSource PowerSource { get; }
+ ///
+ /// Gets the current energy saver status of the device.
+ ///
EnergySaverStatus EnergySaverStatus { get; }
+ ///
+ /// Occurs when battery properties change.
+ ///
event EventHandler BatteryInfoChanged;
+ ///
+ /// Occurs when the energy saver status changes.
+ ///
event EventHandler EnergySaverStatusChanged;
}
- ///
+ ///
+ /// Methods and properties for battery and charging information of the device.
+ ///
public static class Battery
{
- ///
+ ///
+ /// Gets the current charge level of the device from 0.0 to 1.0.
+ ///
+ /// Returns -1 if no battery exists.
public static double ChargeLevel => Default.ChargeLevel;
- ///
+ ///
+ /// Gets the charging state of the device.
+ ///
public static BatteryState State => Default.State;
- ///
+ ///
+ /// Gets the current power source for the device.
+ ///
public static BatteryPowerSource PowerSource => Default.PowerSource;
- ///
+ ///
+ /// Gets the current energy saver status of the device.
+ ///
public static EnergySaverStatus EnergySaverStatus => Default.EnergySaverStatus;
- ///
+ ///
+ /// Event trigger when battery properties have changed.
+ ///
public static event EventHandler BatteryInfoChanged
{
add => Default.BatteryInfoChanged += value;
remove => Default.BatteryInfoChanged -= value;
}
- ///
+ ///
+ /// Occurs when the energy saver status changes.
+ ///
public static event EventHandler EnergySaverStatusChanged
{
add => Default.EnergySaverStatusChanged += value;
@@ -49,6 +92,9 @@ public static event EventHandler EnergySaverS
static IBattery? defaultImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ /// s
public static IBattery Default =>
defaultImplementation ??= new BatteryImplementation();
@@ -132,53 +178,77 @@ void OnEnergySaverChanged(EnergySaverStatusChangedEventArgs e)
=> EnergySaverStatusChangedInternal?.Invoke(null, e);
}
- ///
+ ///
+ /// Describes possible states of the battery.
+ ///
public enum BatteryState
{
- ///
+ /// Battery state could not be determined.
Unknown = 0,
- ///
+
+ /// Battery is actively being charged by a power source.
Charging = 1,
- ///
+
+ /// Battery is not plugged in and discharging.
Discharging = 2,
- ///
+
+ /// Battery is full.
Full = 3,
- ///
+
+ /// Battery is not charging or discharging, but in an inbetween state.
NotCharging = 4,
- ///
+
+ /// Battery does not exist on the device.
NotPresent = 5
}
- ///
+ ///
+ /// Enumerates power sources with which the device and battery can be powered or charged.
+ ///
public enum BatteryPowerSource
{
- ///
+ /// Power source can not be determined.
Unknown = 0,
- ///
+
+ /// Power source is the battery and is currently not being charged.
Battery = 1,
- ///
+
+ /// Power source is an AC Charger.
AC = 2,
- ///
+
+ /// Power source is a USB port.
Usb = 3,
- ///
+
+ /// Power source is wireless.
Wireless = 4
}
- ///
+ ///
+ /// Enumerates states that the energy saver van have on the device.
+ ///
public enum EnergySaverStatus
{
- ///
+ /// Status of energy saving is unknown.
Unknown = 0,
- ///
+
+ /// Energy saving is on.
On = 1,
- ///
+
+ /// Energy saving is off.
Off = 2
}
- ///
+ ///
+ /// Event arguments containing the current reading of .
+ ///
public class BatteryInfoChangedEventArgs : EventArgs
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The current level of the battery.
+ /// The state of the battery.
+ /// The source of the battery.
public BatteryInfoChangedEventArgs(double level, BatteryState state, BatteryPowerSource source)
{
ChargeLevel = level;
@@ -186,35 +256,54 @@ public BatteryInfoChangedEventArgs(double level, BatteryState state, BatteryPowe
PowerSource = source;
}
- ///
+ ///
+ /// Gets the current charge level of the device from 0.0 to 1.0.
+ ///
public double ChargeLevel { get; }
- ///
+ ///
+ /// Gets the charging state of the device.
+ ///
public BatteryState State { get; }
- ///
+ ///
+ /// Gets the current power source for the device.
+ ///
public BatteryPowerSource PowerSource { get; }
- ///
+ ///
+ /// Returns a string representation of this instance of .
+ ///
+ /// A string representation of this instance in the format of ChargeLevel: {value}, State: {value}, PowerSource: {value}.
public override string ToString() =>
$"{nameof(ChargeLevel)}: {ChargeLevel.ToString()}, " +
$"{nameof(State)}: {State}, " +
$"{nameof(PowerSource)}: {PowerSource}";
}
- ///
+ ///
+ /// Event arguments when the energy saver status changes.
+ ///
public class EnergySaverStatusChangedEventArgs : EventArgs
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The current status of the event.
public EnergySaverStatusChangedEventArgs(EnergySaverStatus saverStatus)
{
EnergySaverStatus = saverStatus;
}
- ///
+ ///
+ /// Gets the current status of energy saver mode.
+ ///
public EnergySaverStatus EnergySaverStatus { get; }
- ///
+ ///
+ /// Returns a string representation of this instance of .
+ ///
+ /// A string representation of this instance in the format of EnergySaverStatus: {value}.
public override string ToString() =>
$"{nameof(EnergySaverStatus)}: {EnergySaverStatus}";
}
diff --git a/src/Essentials/src/Browser/Browser.netstandard.tvos.watchos.cs b/src/Essentials/src/Browser/Browser.netstandard.tvos.watchos.cs
index 819aaabdd592..33beb4b247bd 100755
--- a/src/Essentials/src/Browser/Browser.netstandard.tvos.watchos.cs
+++ b/src/Essentials/src/Browser/Browser.netstandard.tvos.watchos.cs
@@ -4,7 +4,6 @@
namespace Microsoft.Maui.ApplicationModel
{
- ///
partial class BrowserImplementation : IBrowser
{
public Task OpenAsync(Uri uri, BrowserLaunchOptions options) =>
diff --git a/src/Essentials/src/Browser/Browser.shared.cs b/src/Essentials/src/Browser/Browser.shared.cs
index 1e23bb7856af..8f4e09ba3268 100755
--- a/src/Essentials/src/Browser/Browser.shared.cs
+++ b/src/Essentials/src/Browser/Browser.shared.cs
@@ -4,34 +4,76 @@
namespace Microsoft.Maui.ApplicationModel
{
+ ///
+ /// Provides a way to display a web page inside an app.
+ ///
public interface IBrowser
{
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// Launch options for the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
Task OpenAsync(Uri uri, BrowserLaunchOptions options);
}
- ///
+ ///
+ /// Provides a way to display a web page inside an app.
+ ///
public static class Browser
{
- ///
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(string uri) => Default.OpenAsync(uri);
- ///
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// How to launch the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(string uri, BrowserLaunchMode launchMode) => Default.OpenAsync(uri, launchMode);
- ///
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// Launch options for the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(string uri, BrowserLaunchOptions options) => Default.OpenAsync(uri, options);
- ///
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(Uri uri) => Default.OpenAsync(uri);
- ///
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// How to launch the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(Uri uri, BrowserLaunchMode launchMode) => Default.OpenAsync(uri, launchMode);
- ///
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// URI to open.
+ /// Launch options for the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(Uri uri, BrowserLaunchOptions options) => Default.OpenAsync(uri, options);
static IBrowser? defaultImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IBrowser Default =>
defaultImplementation ??= new BrowserImplementation();
@@ -39,20 +81,56 @@ internal static void SetDefault(IBrowser? implementation) =>
defaultImplementation = implementation;
}
+ ///
+ /// This class contains static extension methods for use with .
+ ///
public static class BrowserExtensions
{
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// The instance to invoke this method on.
+ /// URI to open.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(this IBrowser browser, string uri) =>
browser.OpenAsync(new Uri(uri), new BrowserLaunchOptions());
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// The instance to invoke this method on.
+ /// URI to open.
+ /// How to launch the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(this IBrowser browser, string uri, BrowserLaunchMode launchMode) =>
browser.OpenAsync(new Uri(uri), new BrowserLaunchOptions { LaunchMode = launchMode });
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// The instance to invoke this method on.
+ /// URI to open.
+ /// Launch options for the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(this IBrowser browser, string uri, BrowserLaunchOptions options) =>
browser.OpenAsync(new Uri(uri), options);
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// The instance to invoke this method on.
+ /// URI to open.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(this IBrowser browser, Uri uri) =>
browser.OpenAsync(uri, new BrowserLaunchOptions());
+ ///
+ /// Open the browser to specified URI.
+ ///
+ /// The instance to invoke this method on.
+ /// URI to open.
+ /// How to launch the browser.
+ /// Completed task when browser is launched, but not necessarily closed. Result indicates if launching was successful or not.
public static Task OpenAsync(this IBrowser browser, Uri uri, BrowserLaunchMode launchMode) =>
browser.OpenAsync(uri, new BrowserLaunchOptions { LaunchMode = launchMode });
}
diff --git a/src/Essentials/src/Browser/BrowserLaunchMode.shared.cs b/src/Essentials/src/Browser/BrowserLaunchMode.shared.cs
index c9ca6e257d6c..62a56cc06490 100755
--- a/src/Essentials/src/Browser/BrowserLaunchMode.shared.cs
+++ b/src/Essentials/src/Browser/BrowserLaunchMode.shared.cs
@@ -1,12 +1,16 @@
#nullable enable
namespace Microsoft.Maui.ApplicationModel
{
- ///
+ ///
+ /// Launch type of the browser.
+ ///
+ /// It's recommended to use the as it is the default and gracefully falls back if needed.
public enum BrowserLaunchMode
{
- ///
+ /// Launch the optimized system browser and stay inside of your application. Chrome Custom Tabs on Android and SFSafariViewController on iOS.
SystemPreferred = 0,
- ///
+
+ /// Use the default external launcher to open the browser outside of the app.
External = 1
}
}
diff --git a/src/Essentials/src/Browser/BrowserLaunchOptions.shared.cs b/src/Essentials/src/Browser/BrowserLaunchOptions.shared.cs
index 672d8b4e61ab..44e254fd11b3 100755
--- a/src/Essentials/src/Browser/BrowserLaunchOptions.shared.cs
+++ b/src/Essentials/src/Browser/BrowserLaunchOptions.shared.cs
@@ -4,38 +4,61 @@
namespace Microsoft.Maui.ApplicationModel
{
- ///
+ ///
+ /// Optional setting to open the browser with.
+ ///
+ /// Not all settings apply to all operating systems. Check documentation for more information.
public class BrowserLaunchOptions
{
- ///
+ ///
+ /// Gets or sets the preferred color of the toolbar background of the in-app browser.
+ ///
+ /// This setting only applies to iOS and Android.
public Color? PreferredToolbarColor { get; set; }
- ///
+ ///
+ /// Gets or sets the preferred color of the controls on the in-app browser.
+ ///
+ /// This setting only applies to iOS.
public Color? PreferredControlColor { get; set; }
- ///
+ ///
+ /// Gets or sets how the browser should be launched.
+ ///
+ /// The default value is .
public BrowserLaunchMode LaunchMode { get; set; } = BrowserLaunchMode.SystemPreferred;
- ///
+ ///
+ /// Gets or sets the preferred mode for the title display.
+ ///
+ /// The default value is . This setting only applies to Android.
public BrowserTitleMode TitleMode { get; set; } = BrowserTitleMode.Default;
- ///
+ ///
+ /// Gets or sets additional launch flags that may or may not take effect based on the device and .
+ ///
+ /// The default value is . Not all flags work on all platforms, check the flag descriptions.
public BrowserLaunchFlags Flags { get; set; } = BrowserLaunchFlags.None;
internal bool HasFlag(BrowserLaunchFlags flag) => Flags.HasFlag(flag);
}
- ///
+ ///
+ /// Additional flags that can be set to control how the browser opens.
+ ///
[Flags]
public enum BrowserLaunchFlags
{
- ///
+ /// No additional flags. This is the default.
None = 0,
- ///
+
+ /// Only applicable to Android: launches a new activity adjacent to the current activity if available.
LaunchAdjacent = 1,
- ///
+
+ /// Only applicable to iOS: launches the browser as a page sheet with the system preferred browser where supported.
PresentAsPageSheet = 2,
- ///
+
+ /// Only applicable to iOS: launches the browser as a form sheet with the system preferred browser where supported.
PresentAsFormSheet = 4
}
}
diff --git a/src/Essentials/src/Browser/BrowserTitleMode.shared.cs b/src/Essentials/src/Browser/BrowserTitleMode.shared.cs
index 38febc41d83a..04d322f9703e 100755
--- a/src/Essentials/src/Browser/BrowserTitleMode.shared.cs
+++ b/src/Essentials/src/Browser/BrowserTitleMode.shared.cs
@@ -1,14 +1,19 @@
#nullable enable
namespace Microsoft.Maui.ApplicationModel
{
- ///
+ ///
+ /// Mode for the in-app browser title.
+ ///
+ /// These values only apply to Android.
public enum BrowserTitleMode
{
- ///
+ /// Uses the system default.
Default = 0,
- ///
+
+ /// Show the title.
Show = 1,
- ///
+
+ /// Hide the title.
Hide = 2
}
}
diff --git a/src/Essentials/src/Clipboard/Clipboard.android.cs b/src/Essentials/src/Clipboard/Clipboard.android.cs
index 79b3973447b5..723d39bdbadc 100644
--- a/src/Essentials/src/Clipboard/Clipboard.android.cs
+++ b/src/Essentials/src/Clipboard/Clipboard.android.cs
@@ -45,6 +45,10 @@ class ClipboardChangeListener : Java.Lang.Object, IOnPrimaryClipChangedListener
{
ClipboardImplementation clipboard;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// An instance of that will be used to listen for changes.
public ClipboardChangeListener(ClipboardImplementation clipboard)
{
this.clipboard = clipboard;
diff --git a/src/Essentials/src/Clipboard/Clipboard.ios.cs b/src/Essentials/src/Clipboard/Clipboard.ios.cs
index cd0c6858b212..b9d5f4f22a93 100644
--- a/src/Essentials/src/Clipboard/Clipboard.ios.cs
+++ b/src/Essentials/src/Clipboard/Clipboard.ios.cs
@@ -36,6 +36,10 @@ void StopClipboardListeners()
NSNotificationCenter.DefaultCenter.RemoveObserver(observer);
}
+ ///
+ /// The observer for triggering the event.
+ ///
+ /// The notification that triggered this event.
public void ClipboardChangedObserver(NSNotification notification)
=> OnClipboardContentChanged();
}
diff --git a/src/Essentials/src/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs b/src/Essentials/src/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs
index 0ae65043fb64..be583c4f5245 100644
--- a/src/Essentials/src/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs
+++ b/src/Essentials/src/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs
@@ -3,7 +3,6 @@
namespace Microsoft.Maui.ApplicationModel.DataTransfer
{
- ///
partial class ClipboardImplementation : IClipboard
{
public Task SetTextAsync(string? text)
diff --git a/src/Essentials/src/Clipboard/Clipboard.shared.cs b/src/Essentials/src/Clipboard/Clipboard.shared.cs
index 75193f80f808..41ec68333e7f 100644
--- a/src/Essentials/src/Clipboard/Clipboard.shared.cs
+++ b/src/Essentials/src/Clipboard/Clipboard.shared.cs
@@ -4,33 +4,66 @@
namespace Microsoft.Maui.ApplicationModel.DataTransfer
{
+ ///
+ /// Provides a way to work with text on the device clipboard.
+ ///
public interface IClipboard
{
+ ///
+ /// Gets a value indicating whether there is any text on the clipboard.
+ ///
bool HasText { get; }
+ ///
+ /// Sets the contents of the clipboard to be the specified text.
+ ///
+ /// The text to put on the clipboard.
+ /// Text content that is on the clipboard, or if there is none.
+ /// This method returns immediately and does not guarentee that the text is on the clipboard by the time this method returns.
Task SetTextAsync(string? text);
+ ///
+ /// Returns any text that is on the clipboard.
+ ///
+ /// Text content that is on the clipboard, or if there is none.
Task GetTextAsync();
+ ///
+ /// Occurs when the clipboard content changes.
+ ///
event EventHandler ClipboardContentChanged;
}
- ///
+ ///
+ /// Provides a way to work with text on the device clipboard.
+ ///
public static class Clipboard
{
- ///
+ ///
+ /// Sets the contents of the clipboard to be the specified text.
+ ///
+ /// The text to put on the clipboard.
+ /// Text content that is on the clipboard, or if there is none.
+ /// This method returns immediately and does not guarentee that the text is on the clipboard by the time this method returns.
public static Task SetTextAsync(string? text)
=> Default.SetTextAsync(text ?? string.Empty);
- ///
+ ///
+ /// Gets a value indicating whether there is any text on the clipboard.
+ ///
public static bool HasText
=> Default.HasText;
- ///
+ ///
+ /// Returns any text that is on the clipboard.
+ ///
+ /// Text content that is on the clipboard, or if there is none.
public static Task GetTextAsync()
=> Default.GetTextAsync();
- ///
+ ///
+ /// Occurs when the clipboard content changes.
+ ///
public static event EventHandler ClipboardContentChanged
{
add => Default.ClipboardContentChanged += value;
@@ -39,6 +72,9 @@ public static event EventHandler ClipboardContentChanged
static IClipboard? defaultImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IClipboard Default =>
defaultImplementation ??= new ClipboardImplementation();
diff --git a/src/Essentials/src/Clipboard/Clipboard.uwp.cs b/src/Essentials/src/Clipboard/Clipboard.uwp.cs
index 6b1194e3595d..3282980c59be 100644
--- a/src/Essentials/src/Clipboard/Clipboard.uwp.cs
+++ b/src/Essentials/src/Clipboard/Clipboard.uwp.cs
@@ -34,6 +34,11 @@ void StartClipboardListeners()
void StopClipboardListeners()
=> WindowsClipboard.ContentChanged -= ClipboardChangedEventListener;
+ ///
+ /// The event listener for triggering the event.
+ ///
+ /// The object that initiated the event.
+ /// The value for this event.
public void ClipboardChangedEventListener(object? sender, object val) => OnClipboardContentChanged();
}
}
diff --git a/src/Essentials/src/Connectivity/Connectivity.android.cs b/src/Essentials/src/Connectivity/Connectivity.android.cs
index e3507b9e511d..6ba31960728f 100644
--- a/src/Essentials/src/Connectivity/Connectivity.android.cs
+++ b/src/Essentials/src/Connectivity/Connectivity.android.cs
@@ -11,6 +11,9 @@ namespace Microsoft.Maui.Networking
{
partial class ConnectivityImplementation : IConnectivity
{
+ ///
+ /// Unique identifier for the connectivity changed action on Android.
+ ///
public const string ConnectivityChangedAction = "com.maui.essentials.ESSENTIALS_CONNECTIVITY_CHANGED";
static Intent connectivityIntent = new Intent(ConnectivityChangedAction);
@@ -214,6 +217,7 @@ void ProcessNetworkInfo(NetworkInfo info)
}
catch (Exception e)
{
+ // TODO add Logging here
Debug.WriteLine("Unable to get connected state - do you have ACCESS_NETWORK_STATE permission? - error: {0}", e);
return NetworkAccess.Unknown;
}
@@ -314,10 +318,17 @@ class ConnectivityBroadcastReceiver : BroadcastReceiver
{
Action onChanged;
+ ///
+ /// Initializes a new instance of the class.
+ ///
public ConnectivityBroadcastReceiver()
{
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The action that is triggered whenever the connectivity changes.
public ConnectivityBroadcastReceiver(Action onChanged) =>
this.onChanged = onChanged;
diff --git a/src/Essentials/src/Connectivity/Connectivity.netstandard.watchos.cs b/src/Essentials/src/Connectivity/Connectivity.netstandard.watchos.cs
index c41e3c530ca2..cbbb32c41504 100644
--- a/src/Essentials/src/Connectivity/Connectivity.netstandard.watchos.cs
+++ b/src/Essentials/src/Connectivity/Connectivity.netstandard.watchos.cs
@@ -3,7 +3,6 @@
namespace Microsoft.Maui.Networking
{
- ///
partial class ConnectivityImplementation : IConnectivity
{
public NetworkAccess NetworkAccess =>
diff --git a/src/Essentials/src/Connectivity/Connectivity.shared.cs b/src/Essentials/src/Connectivity/Connectivity.shared.cs
index 4f4887aaf600..7df288876f25 100644
--- a/src/Essentials/src/Connectivity/Connectivity.shared.cs
+++ b/src/Essentials/src/Connectivity/Connectivity.shared.cs
@@ -7,26 +7,52 @@
namespace Microsoft.Maui.Networking
{
+ ///
+ /// The Connectivity API lets you monitor for changes in the device's network conditions, check the current network access, and determine how it is currently connected.
+ ///
public interface IConnectivity
{
+ ///
+ /// Gets the active connectivity types for the device.
+ ///
IEnumerable ConnectionProfiles { get; }
+ ///
+ /// Gets the current state of network access.
+ ///
NetworkAccess NetworkAccess { get; }
+ ///
+ /// Occurs when network access or profile has changed.
+ ///
event EventHandler ConnectivityChanged;
}
#nullable enable
- ///
+ ///
+ /// The Connectivity APIs lets you monitor for changes in the device's network conditions, check the current network access, and how it is currently connected.
+ ///
public static class Connectivity
{
- ///
+ ///
+ /// Gets the current state of network access.
+ ///
+ ///
+ /// Even when is returned, full internet access is not guaranteed.
+ /// Can throw on Android if ACCESS_NETWORK_STATE is not set in manifest.
+ ///
public static NetworkAccess NetworkAccess => Current.NetworkAccess;
- ///
+ ///
+ /// Gets the active connectivity types for the device.
+ ///
+ /// Can throw on Android if ACCESS_NETWORK_STATE is not set in manifest.
public static IEnumerable ConnectionProfiles => Current.ConnectionProfiles.Distinct();
- ///
+ ///
+ /// Occurs when network access or profile has changed.
+ ///
+ /// Can throw on Android if ACCESS_NETWORK_STATE is not set in manifest.
public static event EventHandler ConnectivityChanged
{
add => Current.ConnectivityChanged += value;
@@ -35,6 +61,9 @@ public static event EventHandler ConnectivityChang
static IConnectivity? currentImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IConnectivity Current =>
currentImplementation ??= new ConnectivityImplementation();
@@ -43,7 +72,6 @@ internal static void SetCurrent(IConnectivity? implementation) =>
}
#nullable disable
- ///
partial class ConnectivityImplementation : IConnectivity
{
event EventHandler ConnectivityChangedInternal;
@@ -94,23 +122,40 @@ void OnConnectivityChanged(ConnectivityChangedEventArgs e)
}
}
- ///
+ ///
+ /// The current connectivity information from the change event.
+ ///
public class ConnectivityChangedEventArgs : EventArgs
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The current access of the network.
+ /// The connection profiles changing correspondingto this event.
public ConnectivityChangedEventArgs(NetworkAccess access, IEnumerable connectionProfiles)
{
NetworkAccess = access;
ConnectionProfiles = connectionProfiles;
}
- ///
+ ///
+ /// Gets the current state of network access.
+ ///
+ ///
+ /// Even when is returned, full internet access is not guaranteed.
+ /// Can throw on Android if ACCESS_NETWORK_STATE is not set in manifest.
+ ///
public NetworkAccess NetworkAccess { get; }
- ///
+ ///
+ /// Gets the active connectivity profiles for the device.
+ ///
public IEnumerable ConnectionProfiles { get; }
- ///
+ ///
+ /// Returns a string representation of the current values of .
+ ///
+ /// A string representation of this instance in the format of NetworkAccess: {value}, ConnectionProfiles: [{value1}, {value2}].
public override string ToString() =>
$"{nameof(NetworkAccess)}: {NetworkAccess}, " +
$"{nameof(ConnectionProfiles)}: [{string.Join(", ", ConnectionProfiles)}]";
diff --git a/src/Essentials/src/Connectivity/Connectivity.shared.enums.cs b/src/Essentials/src/Connectivity/Connectivity.shared.enums.cs
index 7ad108547183..00d793075541 100644
--- a/src/Essentials/src/Connectivity/Connectivity.shared.enums.cs
+++ b/src/Essentials/src/Connectivity/Connectivity.shared.enums.cs
@@ -1,32 +1,44 @@
namespace Microsoft.Maui.Networking
{
- ///
+ ///
+ /// Describes the type of connection the device is using.
+ ///
public enum ConnectionProfile
{
- ///
+ /// Other unknown type of connection.
Unknown = 0,
- ///
+
+ /// The bluetooth data connection.
Bluetooth = 1,
- ///
+
+ /// The mobile/cellular data connection.
Cellular = 2,
- ///
+
+ /// The ethernet data connection.
Ethernet = 3,
- ///
+
+ /// The Wi-Fi data connection.
WiFi = 4
}
- ///
+ ///
+ /// Various states of the connection to the internet.
+ ///
public enum NetworkAccess
{
- ///
+ /// The state of the connectivity is not known.
Unknown = 0,
- ///
+
+ /// No connectivity.
None = 1,
- ///
+
+ /// Local network access only.
Local = 2,
- ///
+
+ /// Limited internet access.
ConstrainedInternet = 3,
- ///
+
+ /// Local and Internet access.
Internet = 4
}
}
diff --git a/src/Essentials/src/Connectivity/Connectivity.uwp.cs b/src/Essentials/src/Connectivity/Connectivity.uwp.cs
index 6d0b1bc0183a..2ec285ab3e08 100644
--- a/src/Essentials/src/Connectivity/Connectivity.uwp.cs
+++ b/src/Essentials/src/Connectivity/Connectivity.uwp.cs
@@ -72,6 +72,7 @@ public IEnumerable ConnectionProfiles
}
catch (Exception ex)
{
+ // TODO Add Logging?
Debug.WriteLine($"Unable to get Network Adapter, returning Unknown: {ex.Message}");
}
diff --git a/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs b/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs
index 99db6fb3b68e..8dbc3836d5ba 100644
--- a/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs
+++ b/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs
@@ -4,7 +4,6 @@
namespace Microsoft.Maui.ApplicationModel.Communication
{
- ///
class ContactsImplementation : IContacts
{
public Task PickContactAsync() =>
diff --git a/src/Essentials/src/Contacts/Contacts.shared.cs b/src/Essentials/src/Contacts/Contacts.shared.cs
index 161cfb817f02..42ba47ab7077 100644
--- a/src/Essentials/src/Contacts/Contacts.shared.cs
+++ b/src/Essentials/src/Contacts/Contacts.shared.cs
@@ -5,26 +5,50 @@
namespace Microsoft.Maui.ApplicationModel.Communication
{
+ ///
+ /// The Contacts API lets a user pick a contact and retrieve information about it.
+ ///
public interface IContacts
{
+ ///
+ /// Opens the operating system's default UI for picking a contact from the device.
+ ///
+ /// A single contact, or if the user cancelled the operation.
Task PickContactAsync();
+ ///
+ /// Gets a collection of all the contacts on the device.
+ ///
+ /// A token that can be used for cancelling the operation.
+ /// A collection of contacts on the device.
Task> GetAllAsync(CancellationToken cancellationToken = default);
}
- ///
+ ///
+ /// The Contacts API lets a user pick a contact and retrieve information about it.
+ ///
public static class Contacts
{
- ///
+ ///
+ /// Opens the operating system's default UI for picking a contact from the device.
+ ///
+ /// A single contact, or if the user cancelled the operation.
public static Task PickContactAsync() =>
Default.PickContactAsync();
- ///
+ ///
+ /// Gets a collection of all the contacts on the device.
+ ///
+ /// A token that can be used for cancelling the operation.
+ /// A collection of contacts on the device.
public static Task> GetAllAsync(CancellationToken cancellationToken = default) =>
Default.GetAllAsync(cancellationToken);
static IContacts? defaultImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IContacts Default =>
defaultImplementation ??= new ContactsImplementation();
diff --git a/src/Essentials/src/DeviceDisplay/DeviceDisplay.shared.cs b/src/Essentials/src/DeviceDisplay/DeviceDisplay.shared.cs
index e38907db2cb1..8e4d9f427d1a 100644
--- a/src/Essentials/src/DeviceDisplay/DeviceDisplay.shared.cs
+++ b/src/Essentials/src/DeviceDisplay/DeviceDisplay.shared.cs
@@ -3,40 +3,67 @@
namespace Microsoft.Maui.Devices
{
+ ///
+ /// Represents information about the device screen.
+ ///
public interface IDeviceDisplay
{
+ ///
+ /// Gets or sets if the screen should be kept on.
+ ///
bool KeepScreenOn { get; set; }
+ ///
+ /// Gets the main screen's display info.
+ ///
DisplayInfo MainDisplayInfo { get; }
+ ///
+ /// Occurs when the main display's info changes.
+ ///
event EventHandler MainDisplayInfoChanged;
}
- ///
+ ///
+ /// Main display information event arguments.
+ ///
public class DisplayInfoChangedEventArgs : EventArgs
{
- ///
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The display info associated to this event.
public DisplayInfoChangedEventArgs(DisplayInfo displayInfo) =>
DisplayInfo = displayInfo;
- ///
+ ///
+ /// Gets the current display info for the main display associated to this event.
+ ///
public DisplayInfo DisplayInfo { get; }
}
- ///
+ ///
+ /// Represents information about the device screen.
+ ///
public static class DeviceDisplay
{
- ///
+ ///
+ /// Gets or sets if the screen should be kept on.
+ ///
public static bool KeepScreenOn
{
get => Current.KeepScreenOn;
set => Current.KeepScreenOn = value;
}
- ///
+ ///
+ /// Gets the main screen's display info.
+ ///
public static DisplayInfo MainDisplayInfo => Current.MainDisplayInfo;
- ///
+ ///
+ /// Occurs when the main display's info changes.
+ ///
public static event EventHandler MainDisplayInfoChanged
{
add => Current.MainDisplayInfoChanged += value;
@@ -51,6 +78,9 @@ public static event EventHandler MainDisplayInfoCha
static IDeviceDisplay? currentImplementation;
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IDeviceDisplay Current =>
currentImplementation ??= new DeviceDisplayImplementation();
diff --git a/src/Essentials/src/DeviceDisplay/DeviceDisplay.uwp.cs b/src/Essentials/src/DeviceDisplay/DeviceDisplay.uwp.cs
index 508fc5ce73e5..8906a8b40f3b 100644
--- a/src/Essentials/src/DeviceDisplay/DeviceDisplay.uwp.cs
+++ b/src/Essentials/src/DeviceDisplay/DeviceDisplay.uwp.cs
@@ -15,6 +15,9 @@ partial class DeviceDisplayImplementation
DisplayRequest? displayRequest;
+ ///
+ /// Initializes a new instance of the class.
+ ///
public DeviceDisplayImplementation()
{
_activeWindowTracker = new(WindowStateManager.Default);
diff --git a/src/Essentials/src/DeviceInfo/DeviceInfo.shared.cs b/src/Essentials/src/DeviceInfo/DeviceInfo.shared.cs
index 8a343de33276..97276ee6e1ca 100644
--- a/src/Essentials/src/DeviceInfo/DeviceInfo.shared.cs
+++ b/src/Essentials/src/DeviceInfo/DeviceInfo.shared.cs
@@ -3,65 +3,119 @@
namespace Microsoft.Maui.Devices
{
- ///
+ ///
+ ///Types of devices.
+ ///
public enum DeviceType
{
- ///
+ /// An unknown device type.
Unknown = 0,
- ///
+
+ /// The device is a physical device, such as an iPhone, Android tablet, or Windows/macOS desktop.
Physical = 1,
- ///
+
+ /// The device is virtual, such as the iOS Simulator, Android emulators, or Windows emulators.
Virtual = 2
}
+ ///
+ /// Represents information about the device.
+ ///
public interface IDeviceInfo
{
+ ///
+ /// Gets the model of the device.
+ ///
string Model { get; }
+ ///
+ /// Gets the manufacturer of the device.
+ ///
string Manufacturer { get; }
+ ///
+ /// Gets the name of the device.
+ ///
+ /// This value is often specified by the user of the device.
string Name { get; }
+ ///
+ /// Gets the string representation of the version of the operating system.
+ ///
string VersionString { get; }
+ ///
+ /// Gets the version of the operating system.
+ ///
Version Version { get; }
+ ///
+ /// Gets the platform or operating system of the device.
+ ///
DevicePlatform Platform { get; }
+ ///
+ /// Gets the idiom (form factor) of the device.
+ ///
DeviceIdiom Idiom { get; }
+ ///
+ /// Gets the type of device the application is running on.
+ ///
DeviceType DeviceType { get; }
}
- ///
+ ///
+ /// Represents information about the device.
+ ///
public static class DeviceInfo
{
- ///
+ ///
+ /// Gets the model of the device.
+ ///
public static string Model => Current.Model;
- ///
+ ///
+ /// Gets the manufacturer of the device.
+ ///
public static string Manufacturer => Current.Manufacturer;
- ///
+ ///
+ /// Gets the name of the device.
+ ///
+ /// This value is often specified by the user of the device.
public static string Name => Current.Name;
- ///
+ ///
+ /// Gets the string representation of the version of the operating system.
+ ///
public static string VersionString => Current.VersionString;
- ///
+ ///
+ /// Gets the version of the operating system.
+ ///
public static Version Version => Current.Version;
- ///
+ ///
+ /// Gets the platform or operating system of the device.
+ ///
public static DevicePlatform Platform => Current.Platform;
- ///
+ ///
+ /// Gets the idiom (form factor) of the device.
+ ///
public static DeviceIdiom Idiom => Current.Idiom;
- ///
+ ///
+ /// Gets the type of device the application is running on.
+ ///
public static DeviceType DeviceType => Current.DeviceType;
static IDeviceInfo? currentImplementation;
-
+
+ ///
+ /// Provides the default implementation for static usage of this API.
+ ///
public static IDeviceInfo Current =>
currentImplementation ??= new DeviceInfoImplementation();
diff --git a/src/Essentials/src/DeviceInfo/DeviceInfo.uwp.cs b/src/Essentials/src/DeviceInfo/DeviceInfo.uwp.cs
index 3c2713494297..c94c5940d078 100644
--- a/src/Essentials/src/DeviceInfo/DeviceInfo.uwp.cs
+++ b/src/Essentials/src/DeviceInfo/DeviceInfo.uwp.cs
@@ -15,6 +15,9 @@ class DeviceInfoImplementation : IDeviceInfo
DeviceType currentType = DeviceType.Unknown;
string systemProductName;
+ ///
+ /// Initializes a new instance of the class.
+ ///
public DeviceInfoImplementation()
{
deviceInfo = new EasClientDeviceInformation();
diff --git a/src/Essentials/src/Permissions/Permissions.netstandard.cs b/src/Essentials/src/Permissions/Permissions.netstandard.cs
index fd2c43cdceb7..e2d363ceb97f 100644
--- a/src/Essentials/src/Permissions/Permissions.netstandard.cs
+++ b/src/Essentials/src/Permissions/Permissions.netstandard.cs
@@ -24,7 +24,6 @@ public override bool ShouldShowRationale() =>
throw ExceptionUtils.NotSupportedOrImplementedException;
}
- ///
public partial class Battery : BasePlatformPermission
{
}
diff --git a/src/Graphics/samples/GraphicsTester.Android/MainActivity.cs b/src/Graphics/samples/GraphicsTester.Android/MainActivity.cs
index 70f28e2475b0..f9d94db23064 100644
--- a/src/Graphics/samples/GraphicsTester.Android/MainActivity.cs
+++ b/src/Graphics/samples/GraphicsTester.Android/MainActivity.cs
@@ -1,8 +1,8 @@
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Graphics.Android;
using Android.App;
-using Android.Widget;
using Android.OS;
+using Android.Widget;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Graphics.Android;
using Microsoft.Maui.Graphics.Platform;
namespace GraphicsTester.Android
diff --git a/src/Graphics/samples/GraphicsTester.Android/MainView.cs b/src/Graphics/samples/GraphicsTester.Android/MainView.cs
index a360bd74227e..f31d67bbb847 100644
--- a/src/Graphics/samples/GraphicsTester.Android/MainView.cs
+++ b/src/Graphics/samples/GraphicsTester.Android/MainView.cs
@@ -1,11 +1,11 @@
using System;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Graphics.Android;
-using Android.Runtime;
using Android.Content;
+using Android.Runtime;
using Android.Views;
using Android.Widget;
using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Graphics.Android;
using Microsoft.Maui.Graphics.Platform;
namespace GraphicsTester.Android
diff --git a/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterTableViewSource.cs b/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterTableViewSource.cs
index 017820b5885c..eafb88970ea2 100644
--- a/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterTableViewSource.cs
+++ b/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterTableViewSource.cs
@@ -1,7 +1,7 @@
using System;
-using Microsoft.Maui.Graphics;
using Foundation;
using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics;
using UIKit;
namespace GraphicsTester.iOS
diff --git a/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterView.cs b/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterView.cs
index d4b65fa37d0b..01993d26eb2e 100644
--- a/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterView.cs
+++ b/src/Graphics/samples/GraphicsTester.MacCatalyst/TesterView.cs
@@ -1,9 +1,9 @@
using System;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Graphics.Platform;
using CoreGraphics;
using Foundation;
using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Graphics.Platform;
using UIKit;
namespace GraphicsTester.iOS
diff --git a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawImages.cs b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawImages.cs
index 2887f80337ae..b2ab856089bf 100644
--- a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawImages.cs
+++ b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawImages.cs
@@ -1,8 +1,8 @@
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Graphics.Platform;
using System;
using System.IO;
using System.Reflection;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Graphics.Platform;
namespace GraphicsTester.Scenarios
{
diff --git a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawPathsScaled.cs b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawPathsScaled.cs
index 20b57d7404c5..fce7a7860122 100644
--- a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawPathsScaled.cs
+++ b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/DrawPathsScaled.cs
@@ -1,7 +1,7 @@
-using Microsoft.Maui.Graphics;
-using System;
+using System;
using System.Collections.Generic;
using System.Text;
+using Microsoft.Maui.Graphics;
namespace GraphicsTester.Scenarios
{
diff --git a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ImageFills.cs b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ImageFills.cs
index 296d003fee63..f507aa293ad1 100644
--- a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ImageFills.cs
+++ b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ImageFills.cs
@@ -1,6 +1,6 @@
+using System.Reflection;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Platform;
-using System.Reflection;
namespace GraphicsTester.Scenarios
{
diff --git a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ScaleCanvas.cs b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ScaleCanvas.cs
index 1ca4838e976e..60aef17783b6 100644
--- a/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ScaleCanvas.cs
+++ b/src/Graphics/samples/GraphicsTester.Portable/Scenarios/ScaleCanvas.cs
@@ -1,7 +1,7 @@
-using Microsoft.Maui.Graphics;
-using System;
+using System;
using System.Collections.Generic;
using System.Text;
+using Microsoft.Maui.Graphics;
namespace GraphicsTester.Scenarios
{
diff --git a/src/Graphics/samples/GraphicsTester.Skia.Console/Program.cs b/src/Graphics/samples/GraphicsTester.Skia.Console/Program.cs
index 3d728f3c08cb..52a80f56d8aa 100644
--- a/src/Graphics/samples/GraphicsTester.Skia.Console/Program.cs
+++ b/src/Graphics/samples/GraphicsTester.Skia.Console/Program.cs
@@ -1,9 +1,9 @@
using System;
+using System.IO;
+using System.Linq;
+using GraphicsTester.Scenarios;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Skia;
-using GraphicsTester.Scenarios;
-using System.Linq;
-using System.IO;
namespace GraphicsTester.Skia.ConsoleApp
{
diff --git a/src/Graphics/samples/GraphicsTester.Skia.Gtk/MainWindow.cs b/src/Graphics/samples/GraphicsTester.Skia.Gtk/MainWindow.cs
index 3feb0d00e0ce..f7981eab836e 100644
--- a/src/Graphics/samples/GraphicsTester.Skia.Gtk/MainWindow.cs
+++ b/src/Graphics/samples/GraphicsTester.Skia.Gtk/MainWindow.cs
@@ -1,11 +1,11 @@
// This is free and unencumbered software released into the public domain.
// Happy coding!!! - GtkSharp Team
-using Gtk;
using System;
using System.Collections.Generic;
using System.IO;
using GraphicsTester.Scenarios;
+using Gtk;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Skia;
diff --git a/src/Graphics/samples/GraphicsTester.Skia.Tizen/Main.cs b/src/Graphics/samples/GraphicsTester.Skia.Tizen/Main.cs
index 3efc044eaf5e..8dc6d3fc313a 100644
--- a/src/Graphics/samples/GraphicsTester.Skia.Tizen/Main.cs
+++ b/src/Graphics/samples/GraphicsTester.Skia.Tizen/Main.cs
@@ -1,10 +1,10 @@
using System;
+using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics.Skia.Views;
using Tizen.Applications;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using GraphicsTester.Scenarios;
-using Microsoft.Maui.Graphics.Skia.Views;
namespace GraphicsTester.Skia.Tizen
{
diff --git a/src/Graphics/samples/GraphicsTester.Skia.Windows/MainWindow.xaml.cs b/src/Graphics/samples/GraphicsTester.Skia.Windows/MainWindow.xaml.cs
index e0ba957e341b..5636f3bd2d69 100644
--- a/src/Graphics/samples/GraphicsTester.Skia.Windows/MainWindow.xaml.cs
+++ b/src/Graphics/samples/GraphicsTester.Skia.Windows/MainWindow.xaml.cs
@@ -1,7 +1,7 @@
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Graphics.Skia;
using System.Windows;
using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Graphics.Skia;
namespace GraphicsTester.WPF.Skia
{
diff --git a/src/Graphics/samples/GraphicsTester.WinUI.Desktop/App.xaml.cs b/src/Graphics/samples/GraphicsTester.WinUI.Desktop/App.xaml.cs
index 2423de355207..aa7971ae3f25 100644
--- a/src/Graphics/samples/GraphicsTester.WinUI.Desktop/App.xaml.cs
+++ b/src/Graphics/samples/GraphicsTester.WinUI.Desktop/App.xaml.cs
@@ -1,4 +1,9 @@
-using Microsoft.UI.Xaml;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
@@ -6,11 +11,6 @@
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
diff --git a/src/Graphics/samples/GraphicsTester.iOS/TesterTableViewSource.cs b/src/Graphics/samples/GraphicsTester.iOS/TesterTableViewSource.cs
index c89fca91c344..5477c47b0472 100644
--- a/src/Graphics/samples/GraphicsTester.iOS/TesterTableViewSource.cs
+++ b/src/Graphics/samples/GraphicsTester.iOS/TesterTableViewSource.cs
@@ -1,7 +1,7 @@
using System;
-using Microsoft.Maui.Graphics;
using Foundation;
using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics;
using UIKit;
namespace GraphicsTester.iOS
diff --git a/src/Graphics/samples/GraphicsTester.iOS/TesterView.cs b/src/Graphics/samples/GraphicsTester.iOS/TesterView.cs
index d4b65fa37d0b..01993d26eb2e 100644
--- a/src/Graphics/samples/GraphicsTester.iOS/TesterView.cs
+++ b/src/Graphics/samples/GraphicsTester.iOS/TesterView.cs
@@ -1,9 +1,9 @@
using System;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Graphics.Platform;
using CoreGraphics;
using Foundation;
using GraphicsTester.Scenarios;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Graphics.Platform;
using UIKit;
namespace GraphicsTester.iOS
diff --git a/src/Graphics/src/Graphics.Skia.GtkSharp/GtkSkiaDirectRenderer.cs b/src/Graphics/src/Graphics.Skia.GtkSharp/GtkSkiaDirectRenderer.cs
index 531785202f6b..d2d22b886b9d 100644
--- a/src/Graphics/src/Graphics.Skia.GtkSharp/GtkSkiaDirectRenderer.cs
+++ b/src/Graphics/src/Graphics.Skia.GtkSharp/GtkSkiaDirectRenderer.cs
@@ -1,5 +1,5 @@
-using SkiaSharp;
using System;
+using SkiaSharp;
namespace Microsoft.Maui.Graphics.Skia
{
diff --git a/src/Graphics/src/Graphics.Skia.GtkSharp/ISkiaGraphicsRenderer.cs b/src/Graphics/src/Graphics.Skia.GtkSharp/ISkiaGraphicsRenderer.cs
index 5b5cb69df864..7e6eec2bfe58 100644
--- a/src/Graphics/src/Graphics.Skia.GtkSharp/ISkiaGraphicsRenderer.cs
+++ b/src/Graphics/src/Graphics.Skia.GtkSharp/ISkiaGraphicsRenderer.cs
@@ -1,5 +1,5 @@
-using SkiaSharp;
using System;
+using SkiaSharp;
namespace Microsoft.Maui.Graphics.Skia
{
diff --git a/src/Graphics/src/Graphics.Skia.WPF/ISkiaGraphicsRenderer.cs b/src/Graphics/src/Graphics.Skia.WPF/ISkiaGraphicsRenderer.cs
index 55e84f6acd47..0f83895de3e7 100644
--- a/src/Graphics/src/Graphics.Skia.WPF/ISkiaGraphicsRenderer.cs
+++ b/src/Graphics/src/Graphics.Skia.WPF/ISkiaGraphicsRenderer.cs
@@ -1,5 +1,5 @@
-using SkiaSharp;
using System;
+using SkiaSharp;
namespace Microsoft.Maui.Graphics.Skia
{
diff --git a/src/Graphics/src/Graphics.Skia.WPF/WDSkiaDirectRenderer.cs b/src/Graphics/src/Graphics.Skia.WPF/WDSkiaDirectRenderer.cs
index 533410292396..c9f6a396bbc5 100644
--- a/src/Graphics/src/Graphics.Skia.WPF/WDSkiaDirectRenderer.cs
+++ b/src/Graphics/src/Graphics.Skia.WPF/WDSkiaDirectRenderer.cs
@@ -1,5 +1,5 @@
-using SkiaSharp;
using System;
+using SkiaSharp;
namespace Microsoft.Maui.Graphics.Skia
{
diff --git a/src/Graphics/src/Graphics.Skia/FontExtensions.cs b/src/Graphics/src/Graphics.Skia/FontExtensions.cs
index a242ce4ffaeb..cacd1d5decc0 100644
--- a/src/Graphics/src/Graphics.Skia/FontExtensions.cs
+++ b/src/Graphics/src/Graphics.Skia/FontExtensions.cs
@@ -1,7 +1,7 @@
-using SkiaSharp;
-using System;
+using System;
using System.Collections.Generic;
using System.Text;
+using SkiaSharp;
namespace Microsoft.Maui.Graphics.Skia
{
diff --git a/src/Graphics/src/Graphics.Skia/SkiaCanvasStateService.cs b/src/Graphics/src/Graphics.Skia/SkiaCanvasStateService.cs
index 32d9d8099300..0d6b285a7bab 100644
--- a/src/Graphics/src/Graphics.Skia/SkiaCanvasStateService.cs
+++ b/src/Graphics/src/Graphics.Skia/SkiaCanvasStateService.cs
@@ -1,5 +1,5 @@
-using SkiaSharp;
-using System;
+using System;
+using SkiaSharp;
namespace Microsoft.Maui.Graphics.Skia
{
diff --git a/src/Graphics/src/Graphics.Skia/Views/SkiaGraphicsView.Android.cs b/src/Graphics/src/Graphics.Skia/Views/SkiaGraphicsView.Android.cs
index a61beaf7e1ea..2a95506a2aa5 100644
--- a/src/Graphics/src/Graphics.Skia/Views/SkiaGraphicsView.Android.cs
+++ b/src/Graphics/src/Graphics.Skia/Views/SkiaGraphicsView.Android.cs
@@ -1,8 +1,8 @@
-using Microsoft.Maui.Graphics.Android;
-using Microsoft.Maui.Graphics.Skia;
using Android.App;
using Android.Content;
using Android.Util;
+using Microsoft.Maui.Graphics.Android;
+using Microsoft.Maui.Graphics.Skia;
using SkiaSharp.Views.Android;
namespace Microsoft.Maui.Graphics.Skia.Views
diff --git a/src/Graphics/src/Graphics/Platforms/Android/PlatformImage.cs b/src/Graphics/src/Graphics/Platforms/Android/PlatformImage.cs
index 13c6583bfb65..3126566d5b67 100644
--- a/src/Graphics/src/Graphics/Platforms/Android/PlatformImage.cs
+++ b/src/Graphics/src/Graphics/Platforms/Android/PlatformImage.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
@@ -33,7 +33,7 @@ public IImage Downsize(float maxWidth, float maxHeight, bool disposeOriginal = f
public IImage Resize(float width, float height, ResizeMode resizeMode = ResizeMode.Fit, bool disposeOriginal = false)
{
- using (var context = new PlatformBitmapExportContext((int)width, (int)height))
+ using (var context = new PlatformBitmapExportContext(width: (int)width, height: (int)height, disposeBitmap: disposeOriginal))
{
var fx = width / Width;
var fy = height / Height;
diff --git a/src/Graphics/src/Text.Markdig/MarkdownAttributedTextReader.cs b/src/Graphics/src/Text.Markdig/MarkdownAttributedTextReader.cs
index 4a2f6ab8149f..e00b3a6804f2 100644
--- a/src/Graphics/src/Text.Markdig/MarkdownAttributedTextReader.cs
+++ b/src/Graphics/src/Text.Markdig/MarkdownAttributedTextReader.cs
@@ -1,5 +1,5 @@
-using Microsoft.Maui.Graphics.Text.Renderer;
using Markdig;
+using Microsoft.Maui.Graphics.Text.Renderer;
namespace Microsoft.Maui.Graphics.Text
{
diff --git a/src/Graphics/src/Text.Markdig/Renderer/AttributedTextRenderer.cs b/src/Graphics/src/Text.Markdig/Renderer/AttributedTextRenderer.cs
index 4bfb41b0bf11..ef2b0d10441e 100644
--- a/src/Graphics/src/Text.Markdig/Renderer/AttributedTextRenderer.cs
+++ b/src/Graphics/src/Text.Markdig/Renderer/AttributedTextRenderer.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
-using Microsoft.Maui.Graphics.Text;
using System.IO;
using Markdig.Renderers;
+using Microsoft.Maui.Graphics.Text;
namespace Microsoft.Maui.Graphics.Text.Renderer
{
diff --git a/src/Graphics/src/Text.Markdig/Renderer/EmphasisInlineRenderer.cs b/src/Graphics/src/Text.Markdig/Renderer/EmphasisInlineRenderer.cs
index 78b08fe20fc0..0030f6e43ac8 100644
--- a/src/Graphics/src/Text.Markdig/Renderer/EmphasisInlineRenderer.cs
+++ b/src/Graphics/src/Text.Markdig/Renderer/EmphasisInlineRenderer.cs
@@ -1,5 +1,5 @@
-using Microsoft.Maui.Graphics.Text;
using Markdig.Syntax.Inlines;
+using Microsoft.Maui.Graphics.Text;
namespace Microsoft.Maui.Graphics.Text.Renderer
{
diff --git a/src/Graphics/src/Text.Markdig/Renderer/HtmlInlineRenderer.cs b/src/Graphics/src/Text.Markdig/Renderer/HtmlInlineRenderer.cs
index 2cdec2f54880..f94ef888ceef 100644
--- a/src/Graphics/src/Text.Markdig/Renderer/HtmlInlineRenderer.cs
+++ b/src/Graphics/src/Text.Markdig/Renderer/HtmlInlineRenderer.cs
@@ -1,7 +1,7 @@
+using System;
using System.Collections.Generic;
-using Microsoft.Maui.Graphics.Text;
using Markdig.Syntax.Inlines;
-using System;
+using Microsoft.Maui.Graphics.Text;
namespace Microsoft.Maui.Graphics.Text.Renderer
{
diff --git a/src/Graphics/src/Text.Markdig/Renderer/ListRenderer.cs b/src/Graphics/src/Text.Markdig/Renderer/ListRenderer.cs
index 1aa2a071b176..50b3bdf768c8 100644
--- a/src/Graphics/src/Text.Markdig/Renderer/ListRenderer.cs
+++ b/src/Graphics/src/Text.Markdig/Renderer/ListRenderer.cs
@@ -1,5 +1,5 @@
-using Microsoft.Maui.Graphics.Text;
using Markdig.Syntax;
+using Microsoft.Maui.Graphics.Text;
namespace Microsoft.Maui.Graphics.Text.Renderer
{
diff --git a/src/Graphics/tests/Graphics.Tests/ColorTypeConverterTests.cs b/src/Graphics/tests/Graphics.Tests/ColorTypeConverterTests.cs
index 8c4528d57c4c..c5d0d9a8b023 100644
--- a/src/Graphics/tests/Graphics.Tests/ColorTypeConverterTests.cs
+++ b/src/Graphics/tests/Graphics.Tests/ColorTypeConverterTests.cs
@@ -1,9 +1,9 @@
-using Microsoft.Maui.Graphics.Converters;
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Maui.Graphics.Converters;
using Xunit;
namespace Microsoft.Maui.Graphics.Tests
diff --git a/src/Graphics/tests/Graphics.Tests/PointTypeConverterTests.cs b/src/Graphics/tests/Graphics.Tests/PointTypeConverterTests.cs
index 913f05c5df5d..ca019e972e58 100644
--- a/src/Graphics/tests/Graphics.Tests/PointTypeConverterTests.cs
+++ b/src/Graphics/tests/Graphics.Tests/PointTypeConverterTests.cs
@@ -1,9 +1,9 @@
-using Microsoft.Maui.Graphics.Converters;
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Maui.Graphics.Converters;
using Xunit;
namespace Microsoft.Maui.Graphics.Tests
diff --git a/src/Graphics/tests/Graphics.Tests/RectTypeConverterTests.cs b/src/Graphics/tests/Graphics.Tests/RectTypeConverterTests.cs
index 301d2e46fa08..67028388680f 100644
--- a/src/Graphics/tests/Graphics.Tests/RectTypeConverterTests.cs
+++ b/src/Graphics/tests/Graphics.Tests/RectTypeConverterTests.cs
@@ -1,9 +1,9 @@
-using Microsoft.Maui.Graphics.Converters;
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Maui.Graphics.Converters;
using Xunit;
namespace Microsoft.Maui.Graphics.Tests
diff --git a/src/Graphics/tests/Graphics.Tests/SizeTypeConverterTests.cs b/src/Graphics/tests/Graphics.Tests/SizeTypeConverterTests.cs
index 60880d7b0744..ae6d502ab3cb 100644
--- a/src/Graphics/tests/Graphics.Tests/SizeTypeConverterTests.cs
+++ b/src/Graphics/tests/Graphics.Tests/SizeTypeConverterTests.cs
@@ -1,9 +1,9 @@
-using Microsoft.Maui.Graphics.Converters;
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Maui.Graphics.Converters;
using Xunit;
namespace Microsoft.Maui.Graphics.Tests
diff --git a/src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems b/src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems
index 8041459c8de8..5dbe9eecd8ab 100644
--- a/src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems
+++ b/src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems
@@ -20,8 +20,8 @@
-
-
+
+
diff --git a/src/TestUtils/src/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.csproj b/src/TestUtils/src/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.csproj
index 60b755fcad74..f12d4e9b096d 100644
--- a/src/TestUtils/src/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.csproj
+++ b/src/TestUtils/src/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/src/TestUtils/src/DeviceTests/AssertionExtensions.Android.cs b/src/TestUtils/src/DeviceTests/AssertionExtensions.Android.cs
index 16d55019162d..3fe045894392 100644
--- a/src/TestUtils/src/DeviceTests/AssertionExtensions.Android.cs
+++ b/src/TestUtils/src/DeviceTests/AssertionExtensions.Android.cs
@@ -6,6 +6,7 @@
using Android.Graphics.Drawables;
using Android.Text;
using Android.Views;
+using Android.Views.InputMethods;
using Android.Widget;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Platform;
@@ -17,12 +18,89 @@ namespace Microsoft.Maui.DeviceTests
{
public static partial class AssertionExtensions
{
+ public static async Task SendValueToKeyboard(this AView view, char value, int timeout = 1000)
+ {
+ await view.ShowKeyboardForView(timeout);
+
+ // I tried various permutations of KeyEventActions to set the keyboard in upper case
+ // But I wasn't successful
+ if (Enum.TryParse($"{value}".ToUpper(), out Keycode result))
+ {
+ view.OnCreateInputConnection(new EditorInfo())?
+ .SendKeyEvent(new KeyEvent(10, 10, KeyEventActions.Down, result, 0));
+
+ view.OnCreateInputConnection(new EditorInfo())?
+ .SendKeyEvent(new KeyEvent(10, 10, KeyEventActions.Up, result, 0));
+ }
+ }
+
+ public static async Task SendKeyboardReturnType(this AView view, ReturnType returnType, int timeout = 1000)
+ {
+ await view.ShowKeyboardForView(timeout);
+
+ view
+ .OnCreateInputConnection(new EditorInfo())?
+ .PerformEditorAction(returnType.ToPlatform());
+
+ // Let the action propagate
+ await Task.Delay(10);
+ }
+
+ public static async Task WaitForFocused(this AView view, int timeout = 1000)
+ {
+ if (!view.IsFocused)
+ {
+ TaskCompletionSource focusSource = new TaskCompletionSource();
+ view.FocusChange += OnFocused;
+ await focusSource.Task.WaitAsync(TimeSpan.FromMilliseconds(timeout));
+
+ // Even thuogh the event fires focus hasn't fully been achieved
+ await Task.Delay(10);
+
+ void OnFocused(object? sender, AView.FocusChangeEventArgs e)
+ {
+ view.FocusChange -= OnFocused;
+ focusSource.SetResult();
+ }
+ }
+ }
+
+ public static Task FocusView(this AView view, int timeout = 1000)
+ {
+ if (!view.IsFocused)
+ {
+ view.Focus(new FocusRequest(view.IsFocused));
+ return view.WaitForFocused(timeout);
+ }
+
+ return Task.CompletedTask;
+ }
+
+ public static async Task ShowKeyboardForView(this AView view, int timeout = 1000)
+ {
+ await view.FocusView(timeout);
+ KeyboardManager.ShowKeyboard(view);
+ await view.WaitForKeyboardToShow(timeout);
+ }
+
+ public static async Task WaitForKeyboardToShow(this AView view, int timeout = 1000)
+ {
+ var result = await Wait(() => KeyboardManager.IsSoftKeyboardVisible(view), timeout);
+ Assert.True(result);
+
+ }
+
+ public static async Task WaitForKeyboardToHide(this AView view, int timeout = 1000)
+ {
+ var result = await Wait(() => !KeyboardManager.IsSoftKeyboardVisible(view), timeout);
+ Assert.True(result);
+ }
+
public static Task WaitForLayout(AView view, int timeout = 1000)
{
var tcs = new TaskCompletionSource();
view.LayoutChange += OnLayout;
-
var cts = new CancellationTokenSource();
cts.Token.Register(() => OnLayout(view), true);
cts.CancelAfter(timeout);
@@ -36,6 +114,7 @@ void OnLayout(object? sender = null, AView.LayoutChangeEventArgs? e = null)
if (view.Handle != IntPtr.Zero)
view.LayoutChange -= OnLayout;
+ // let the layout resolve after changing
tcs.TrySetResult(e != null);
}
}
diff --git a/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs b/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs
index 77a62f735e40..8dde41766826 100644
--- a/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs
+++ b/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs
@@ -15,6 +15,41 @@ namespace Microsoft.Maui.DeviceTests
{
public static partial class AssertionExtensions
{
+ public static Task WaitForKeyboardToShow(this FrameworkElement view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task WaitForKeyboardToHide(this FrameworkElement view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task SendValueToKeyboard(this FrameworkElement view, char value, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task SendKeyboardReturnType(this FrameworkElement view, ReturnType returnType, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task WaitForFocused(this FrameworkElement view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task FocusView(this FrameworkElement view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task ShowKeyboardForView(this FrameworkElement view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
public static Task CreateColorAtPointError(this CanvasBitmap bitmap, WColor expectedColor, int x, int y) =>
CreateColorError(bitmap, $"Expected {expectedColor} at point {x},{y} in renderered view.");
diff --git a/src/TestUtils/src/DeviceTests/AssertionExtensions.cs b/src/TestUtils/src/DeviceTests/AssertionExtensions.cs
index 3725ab89178b..bd86ec1005ec 100644
--- a/src/TestUtils/src/DeviceTests/AssertionExtensions.cs
+++ b/src/TestUtils/src/DeviceTests/AssertionExtensions.cs
@@ -1,6 +1,6 @@
using System;
-using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
+using Microsoft.Maui.Platform;
using Xunit;
using Xunit.Sdk;
@@ -51,5 +51,85 @@ public static void CloseEnough(double expected, double actual, double epsilon =
var diff = Math.Abs(expected - actual);
Assert.True(diff <= epsilon, $"Expected: {expected}. Actual: {actual}. Diff: {diff} Epsilon: {epsilon}.{message}");
}
+
+#if !TIZEN
+
+ public static Task WaitForKeyboardToShow(this IView view, int timeout = 1000)
+ {
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().WaitForKeyboardToShow(timeout);
+#endif
+ }
+
+ public static Task WaitForKeyboardToHide(this IView view, int timeout = 1000)
+ {
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().WaitForKeyboardToHide(timeout);
+#endif
+ }
+
+ ///
+ /// Shane: I haven't fully tested this API. I was trying to use this to send "ReturnType"
+ /// and then found the correct API. But, I figured this would be useful to have so I left it here
+ /// so a future tester can hopefully use it and be successful!
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Task SendValueToKeyboard(this IView view, char value, int timeout = 1000)
+ {
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().SendValueToKeyboard(value, timeout);
+#endif
+ }
+
+
+ public static Task SendKeyboardReturnType(this IView view, ReturnType returnType, int timeout = 1000)
+ {
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().SendKeyboardReturnType(returnType, timeout);
+#endif
+ }
+
+ public static Task ShowKeyboardForView(this IView view, int timeout = 1000)
+ {
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().ShowKeyboardForView(timeout);
+#endif
+ }
+
+ public static Task WaitForFocused(this IView view, int timeout = 1000)
+ {
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().WaitForFocused(timeout);
+#endif
+ }
+
+ public static Task FocusView(this IView view, int timeout = 1000)
+ {
+
+#if !PLATFORM
+ return Task.CompletedTask;
+#else
+ return view.ToPlatform().FocusView(timeout);
+#endif
+ }
+
+
+#endif
+
}
}
\ No newline at end of file
diff --git a/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs b/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs
index 343bc8b6053a..94fd813803f7 100644
--- a/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs
+++ b/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs
@@ -12,6 +12,41 @@ namespace Microsoft.Maui.DeviceTests
{
public static partial class AssertionExtensions
{
+ public static Task WaitForKeyboardToShow(this UIView view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task WaitForKeyboardToHide(this UIView view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task SendValueToKeyboard(this UIView view, char value, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task SendKeyboardReturnType(this UIView view, ReturnType returnType, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task WaitForFocused(this UIView view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task FocusView(this UIView view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Task ShowKeyboardForView(this UIView view, int timeout = 1000)
+ {
+ throw new NotImplementedException();
+ }
+
public static string CreateColorAtPointError(this UIImage bitmap, UIColor expectedColor, int x, int y) =>
CreateColorError(bitmap, $"Expected {expectedColor} at point {x},{y} in renderered view.");
diff --git a/src/TestUtils/src/DeviceTests/UINSWindow.iOS.cs b/src/TestUtils/src/DeviceTests/UINSWindow.iOS.cs
index 5dc12eef3d65..b21022573959 100644
--- a/src/TestUtils/src/DeviceTests/UINSWindow.iOS.cs
+++ b/src/TestUtils/src/DeviceTests/UINSWindow.iOS.cs
@@ -1,9 +1,9 @@
-using Foundation;
+using System;
+using System.Runtime.InteropServices;
using CoreGraphics;
+using Foundation;
using Microsoft.Maui.Graphics;
using ObjCRuntime;
-using System;
-using System.Runtime.InteropServices;
using UIKit;
namespace Microsoft.Maui.DeviceTests;
diff --git a/src/Workload/Microsoft.Maui.Sdk/Sdk/AutoImport.in.props b/src/Workload/Microsoft.Maui.Sdk/Sdk/AutoImport.in.props
index 656afc062464..a03491409cde 100644
--- a/src/Workload/Microsoft.Maui.Sdk/Sdk/AutoImport.in.props
+++ b/src/Workload/Microsoft.Maui.Sdk/Sdk/AutoImport.in.props
@@ -8,7 +8,7 @@
-
+
@@ -31,7 +31,7 @@
-
+
@@ -42,7 +42,7 @@
-->
-
+
@@ -56,7 +56,7 @@
-
+
-
+
-
+