From 6c135922e685d16adf32fc69af58fb9e09613e00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:48:40 +0000 Subject: [PATCH] [create-pull-request] automated change --- .../Core/src/Tizen/ResourcePath.cs | 2 +- .../Core/src/Windows/TabbedPageRenderer.cs | 2 +- .../Platforms/Windows/App.xaml.cs | 48 +++--- .../EmptyViewWithDataTemplateSelector.xaml.cs | 78 ++++----- .../src/Build.Tasks/NodeILExtensions.cs | 2 +- .../src/Build.Tasks/SetPropertiesVisitor.cs | 2 +- src/Controls/src/Build.Tasks/XamlCTask.cs | 6 +- .../ListView/Tizen/CellContentFactory.cs | 2 +- .../ListView/Windows/ListViewRenderer.cs | 2 +- .../Shell/iOS/ShellSectionRenderer.cs | 2 +- .../Items/CarouselViewHandler.Windows.cs | 4 +- .../Items/ItemsViewHandler.Windows.cs | 2 +- .../Items/iOS/CarouselViewController.cs | 12 +- .../Handlers/Items/iOS/ItemsViewLayout.cs | 2 +- .../iOS/SelectableItemsViewController.cs | 6 +- .../Items2/CollectionViewHandler2.iOS.cs | 4 +- .../GesturePlatformManager.Windows.cs | 14 +- .../CollectionView/ItemContentControl.cs | 2 +- .../CollectionView/LoopableCollectionView.cs | 2 +- .../Windows/CollectionView/ScrollHelpers.cs | 2 +- .../Windows/Extensions/TextBlockExtensions.cs | 2 +- .../PlatformConfiguration/ExtensionPoints.cs | 2 +- .../src/Core/RadioButton/RadioButton.cs | 2 +- src/Controls/src/Core/Shell/ShellContent.cs | 8 +- src/Controls/src/Core/XamlParseException.cs | 2 +- .../src/Xaml/IXmlLineInfoExtensions.cs | 8 +- .../tests/Core.UnitTests/Menu/MenuTestBase.cs | 6 +- .../Elements/Border/BorderTests.Windows.cs | 12 +- .../CollectionViewTests.Windows.cs | 4 +- .../Elements/ContentView/ContentViewTests.cs | 12 +- .../Elements/Shell/ShellTests.Windows.cs | 2 +- .../Elements/Window/WindowTests.Windows.cs | 2 +- .../Stubs/MauiAppNewWindowStub.Windows.cs | 4 +- .../Maui25871Library/CompareConverter.cs | 8 +- .../Elements/ContactsPage.cs | 8 +- .../DragAndDropBetweenLayouts.xaml.cs | 2 +- .../Issues/Bugzilla/Bugzilla31333.cs | 4 +- .../Issues/Bugzilla/Bugzilla32801.cs | 2 +- .../Issues/Bugzilla/Bugzilla35733.cs | 4 +- .../Issues/Bugzilla/Bugzilla36009.cs | 2 +- .../Issues/Bugzilla/Bugzilla36703.cs | 2 +- .../Issues/Bugzilla/Bugzilla37625.cs | 2 +- .../Issues/Bugzilla/Bugzilla40005.cs | 6 +- .../Issues/Bugzilla/Bugzilla40092.cs | 2 +- .../Issues/Bugzilla/Bugzilla40173.cs | 4 +- .../Issues/Bugzilla/Bugzilla41038.cs | 6 +- .../Issues/Bugzilla/Bugzilla41600.cs | 36 ++-- .../Issues/Bugzilla/Bugzilla44166.cs | 2 +- .../Issues/Bugzilla/Bugzilla45125.cs | 3 +- .../Issues/Bugzilla/Bugzilla57114.cs | 48 +++--- .../TestCases.HostApp/Issues/Issue11132.cs | 104 ++++++------ .../TestCases.HostApp/Issues/Issue12213.cs | 2 +- .../TestCases.HostApp/Issues/Issue14587.cs | 6 +- .../TestCases.HostApp/Issues/Issue17123.cs | 10 +- .../TestCases.HostApp/Issues/Issue18452.cs | 10 +- .../Issues/Issue22674.xaml.cs | 2 +- .../TestCases.HostApp/Issues/Issue23491.cs | 57 ++++--- .../Issues/Issue23674.xaml.cs | 4 +- .../TestCases.HostApp/Issues/Issue24847.cs | 4 +- .../Issues/Issue24966.xaml.cs | 2 +- .../Issues/Issue25224.xaml.cs | 66 ++++---- .../Issues/Issue25436.xaml.cs | 2 +- .../Issues/Issue25473.xaml.cs | 2 +- .../Issues/Issue25551.xaml.cs | 4 +- .../TestCases.HostApp/Issues/Issue25742.cs | 88 +++++----- .../Issues/Issue25792.xaml.cs | 2 +- .../Issues/Issue25829.xaml.cs | 2 +- .../Issues/Issue25912.xaml.cs | 4 +- .../Issues/Issue26057.xaml.cs | 2 +- .../Issues/Issue26065.xaml.cs | 29 ++-- .../Issues/Issue26066.xaml.cs | 4 +- .../TestCases.HostApp/Issues/Issue26187.cs | 160 +++++++++--------- .../TestCases.HostApp/Issues/Issue26629.cs | 114 ++++++------- .../TestCases.HostApp/Issues/Issue3262.cs | 4 +- .../XFIssue/AddingMultipleItemsListView.cs | 2 +- .../Issues/XFIssue/Issue1342.cs | 2 +- .../Issues/XFIssue/Issue1557.cs | 8 +- .../Issues/XFIssue/Issue2266.cs | 4 +- .../Issues/XFIssue/Issue2993.cs | 2 +- .../Issues/XFIssue/Issue3008.cs | 4 +- .../Issues/XFIssue/Issue3318.cs | 5 +- .../Issues/XFIssue/Issue4138.cs | 2 +- .../Issues/XFIssue/Issue5132.cs | 68 ++++---- .../Issues/XFIssue/Issue530.cs | 2 +- .../Issues/XFIssue/Issue5503.cs | 8 +- .../Issues/XFIssue/Issue5831.cs | 2 +- .../Issues/XFIssue/Issue6784.cs | 54 +++--- .../Issues/XFIssue/Issue7339.cs | 2 +- .../Issues/XFIssue/Issue8145.cs | 70 ++++---- .../Issues/XFIssue/Issue973.cs | 6 +- .../Issues/XFIssue/ScrollToGroup.cs | 2 +- .../XFIssue/ShellFlyoutContentOffset.cs | 2 +- .../Issues/XFIssue/StackLayoutIssue.cs | 4 +- .../Issues/XFIssue/TabbedPageTests.cs | 10 +- .../Issues/XFIssue/Unreported1.cs | 4 +- .../Platforms/MacCatalyst/AppDelegate.cs | 2 +- .../Platforms/iOS/AppDelegate.cs | 4 +- .../CollectionViewUITests.HeaderAndFooter.cs | 4 +- ...onViewUITests.VisitAndUpdateItemsSource.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla30166.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla30317.cs | 38 ++--- .../Tests/Issues/Bugzilla/Bugzilla31114.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla31333.cs | 66 ++++---- .../Tests/Issues/Bugzilla/Bugzilla32040.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla32615.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla32801.cs | 50 +++--- .../Tests/Issues/Bugzilla/Bugzilla33612.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla34007.cs | 8 +- .../Tests/Issues/Bugzilla/Bugzilla36955.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla37841.cs | 4 +- .../Tests/Issues/Bugzilla/Bugzilla38112.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla38731.cs | 32 ++-- .../Tests/Issues/Bugzilla/Bugzilla39489.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla39530.cs | 6 +- .../Tests/Issues/Bugzilla/Bugzilla39821.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla40005.cs | 4 +- .../Tests/Issues/Bugzilla/Bugzilla40161.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla40333.cs | 12 +- .../Tests/Issues/Bugzilla/Bugzilla40955.cs | 6 +- .../Tests/Issues/Bugzilla/Bugzilla41424.cs | 4 +- .../Tests/Issues/Bugzilla/Bugzilla42074.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla42956.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla43469.cs | 56 +++--- .../Tests/Issues/Bugzilla/Bugzilla43663.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla44166.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla44461.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla45743.cs | 4 +- .../Tests/Issues/Bugzilla/Bugzilla45926.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla47923.cs | 4 +- .../Tests/Issues/Bugzilla/Bugzilla52419.cs | 30 ++-- .../Tests/Issues/Bugzilla/Bugzilla56298.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla57515.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla59863_1.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla59863_2.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla60122.cs | 2 +- ...arouselViewUITests.AdjustPeekAreaInsets.cs | 4 +- ...ionViewUITests.CollectionViewTabbedPage.cs | 4 +- .../Tests/Issues/Issue10222.cs | 6 +- .../Tests/Issues/Issue12642.cs | 2 +- .../Tests/Issues/Issue13476.cs | 4 +- .../Tests/Issues/Issue14587.cs | 4 +- .../Tests/Issues/Issue17123.cs | 16 +- .../Tests/Issues/Issue17453.cs | 2 +- .../Tests/Issues/Issue20903.cs | 2 +- .../Tests/Issues/Issue21109.cs | 6 +- .../Tests/Issues/Issue24670.cs | 2 +- .../Tests/Issues/Issue25192.cs | 28 +-- .../Tests/Issues/Issue25436.cs | 4 +- .../Tests/Issues/Issue25551.cs | 4 +- .../Tests/Issues/Issue25829.cs | 4 +- .../Tests/Issues/Issue26066.cs | 24 +-- .../Tests/Issues/Issue27542.cs | 2 +- .../Tests/Issues/Issue5669.cs | 4 +- .../Tests/Issues/Issue8529.cs | 4 +- .../Tests/Issues/Issue9794.cs | 4 +- .../XFIssue/AddingMultipleItemsListView.cs | 80 ++++----- .../Issues/XFIssue/FlyoutBehaviorShell.cs | 8 +- .../Issues/XFIssue/HeaderFooterShellFlyout.cs | 104 ++++++------ .../Tests/Issues/XFIssue/Issue10134.cs | 2 +- .../Tests/Issues/XFIssue/Issue1028.cs | 14 +- .../Tests/Issues/XFIssue/Issue10608.cs | 2 +- .../Tests/Issues/XFIssue/Issue11381.cs | 2 +- .../Tests/Issues/XFIssue/Issue11523.cs | 2 +- .../Tests/Issues/XFIssue/Issue11869.cs | 4 +- .../Tests/Issues/XFIssue/Issue12126.cs | 2 +- .../Tests/Issues/XFIssue/Issue12429.cs | 44 ++--- .../Tests/Issues/XFIssue/Issue12652.cs | 52 +++--- .../Tests/Issues/XFIssue/Issue1414.cs | 4 +- .../Tests/Issues/XFIssue/Issue15565.cs | 18 +- .../Tests/Issues/XFIssue/Issue1614.cs | 4 +- .../Tests/Issues/XFIssue/Issue1704.cs | 14 +- .../Tests/Issues/XFIssue/Issue198.cs | 8 +- .../Tests/Issues/XFIssue/Issue2272.cs | 2 +- .../Tests/Issues/XFIssue/Issue2818.cs | 8 +- .../Tests/Issues/XFIssue/Issue2894.cs | 6 +- .../Tests/Issues/XFIssue/Issue2948.cs | 40 ++--- .../Tests/Issues/XFIssue/Issue2951.cs | 4 +- .../Tests/Issues/XFIssue/Issue2964.cs | 2 +- .../Tests/Issues/XFIssue/Issue2981.cs | 2 +- .../Tests/Issues/XFIssue/Issue3139.cs | 2 +- .../Tests/Issues/XFIssue/Issue3475.cs | 4 +- .../Tests/Issues/XFIssue/Issue3840.cs | 2 +- .../Tests/Issues/XFIssue/Issue4684.cs | 4 +- .../Tests/Issues/XFIssue/Issue5132.cs | 4 +- .../Tests/Issues/XFIssue/Issue5412.cs | 4 +- .../Tests/Issues/XFIssue/Issue5500.cs | 2 +- .../Tests/Issues/XFIssue/Issue6127.cs | 2 +- .../Tests/Issues/XFIssue/Issue6784.cs | 2 +- .../Tests/Issues/XFIssue/Issue6878.cs | 2 +- .../XFIssue/Issue6932_emptyviewstring.cs | 12 +- .../XFIssue/Issue6932_emptyviewtemplate.cs | 10 +- .../Tests/Issues/XFIssue/Issue7167.cs | 6 +- .../Tests/Issues/XFIssue/Issue7329.cs | 2 +- .../Tests/Issues/XFIssue/Issue7339.cs | 2 +- .../Tests/Issues/XFIssue/Issue7556.cs | 2 +- .../Tests/Issues/XFIssue/Issue774.cs | 2 +- .../Tests/Issues/XFIssue/Issue7823.cs | 2 +- .../Tests/Issues/XFIssue/Issue7890.cs | 2 +- .../Tests/Issues/XFIssue/Issue7993.cs | 4 +- .../Tests/Issues/XFIssue/Issue8291.cs | 2 +- .../Tests/Issues/XFIssue/Issue8461.cs | 6 +- .../Tests/Issues/XFIssue/Issue8741.cs | 14 +- .../Tests/Issues/XFIssue/Issue889.cs | 2 +- .../Tests/Issues/XFIssue/Issue892.cs | 6 +- .../Tests/Issues/XFIssue/Issue9711.cs | 48 +++--- .../Issues/XFIssue/ListViewViewCellBinding.cs | 4 +- .../Tests/Issues/XFIssue/ScrollToGroup.cs | 16 +- .../XFIssue/ShellFlyoutContentOffset.cs | 2 +- .../XFIssue/ShellFlyoutHeaderBehavior.cs | 60 +++---- .../Tests/Issues/XFIssue/ShellFlyoutSizing.cs | 2 +- .../Tests/Issues/XFIssue/ShellGestures.cs | 4 +- .../Tests/Issues/XFIssue/ShellInsets.cs | 2 +- .../Tests/Issues/XFIssue/ShellTitleView.cs | 6 +- .../Tests/Issues/XFIssue/SwipeBackNavCrash.cs | 2 +- .../tests/TestCases.Shared.Tests/UITest.cs | 2 +- .../DuplicatePropertyElements.xaml.cs | 6 +- .../DuplicateXArgumentsElements.xaml.cs | 2 +- .../Xaml.UnitTests/Issues/Maui21038.xaml.cs | 60 +++---- .../Xaml.UnitTests/Issues/Maui24384.xaml.cs | 5 +- .../Xaml.UnitTests/Issues/Maui25819.xaml.cs | 12 +- .../Xaml.UnitTests/Issues/Maui25871.xaml.cs | 2 +- .../Xaml.UnitTests/Issues/Maui26206.xaml.cs | 4 +- .../Xaml.UnitTests/Issues/Maui26369.xaml.cs | 18 +- .../tests/Xaml.UnitTests/MockCompiler.cs | 12 +- .../MultipleDataTemplateChildElements.xaml.cs | 4 +- .../Application/ApplicationHandler.Windows.cs | 2 +- .../Handlers/Entry/EntryHandler.Windows.cs | 4 +- .../FlyoutView/FlyoutViewHandler.Windows.cs | 2 +- .../HybridWebViewHandler.Tizen.cs | 2 +- .../HybridWebView/HybridWebViewHandler.iOS.cs | 2 +- .../SearchBar/SearchBarHandler.Windows.cs | 2 +- .../WebView/WebViewHandler.Windows.cs | 6 +- .../src/Handlers/Window/WindowHandler.iOS.cs | 8 +- .../Hosting/Internal/MauiServiceCollection.cs | 2 +- src/Core/src/Hosting/MauiAppBuilder.cs | 8 +- .../FontImageSourceService.Windows.cs | 2 +- .../Windows/ActivityIndicatorExtensions.cs | 2 +- .../src/Platform/Windows/ColorConverter.cs | 2 +- .../Platform/Windows/MauiNavigationView.cs | 68 ++++---- .../Platform/Windows/MauiPasswordTextBox.cs | 56 ++++-- src/Core/src/Platform/Windows/MauiSlider.cs | 4 +- .../src/Platform/Windows/MauiToolbar.xaml.cs | 20 +-- src/Core/src/Platform/Windows/MauiWebView.cs | 14 +- .../src/Platform/Windows/MauiWinUIWindow.cs | 2 +- .../Platform/Windows/NavigationRootManager.cs | 16 +- .../Platform/Windows/RootNavigationView.cs | 38 ++--- .../src/Platform/Windows/SliderExtensions.cs | 4 +- .../src/Platform/Windows/TextBoxExtensions.cs | 4 +- .../src/Platform/Windows/ToolbarExtensions.cs | 2 +- .../src/Platform/Windows/WindowRootView.cs | 48 +++--- .../Platform/iOS/CALayerAutosizeObserver.cs | 4 +- src/Core/src/Platform/iOS/ContentView.cs | 6 +- .../src/Platform/iOS/GeneralWrapperView.cs | 100 +++++------ src/Core/src/Platform/iOS/MauiDatePicker.cs | 2 +- src/Core/src/Platform/iOS/MauiPageControl.cs | 4 +- .../iOS/MauiUIContextMenuInteraction.cs | 2 +- src/Core/src/Platform/iOS/MauiView.cs | 4 +- src/Core/src/Platform/iOS/StaticCALayer.cs | 2 +- .../src/Platform/iOS/StaticCAShapeLayer.cs | 2 +- src/Core/src/Platform/iOS/WindowExtensions.cs | 7 +- src/Core/src/Platform/iOS/WrapperView.cs | 10 +- src/Core/src/Primitives/KeyboardFlags.cs | 14 +- .../DatePickerHandlerTests.Windows.cs | 2 +- .../Slider/SliderHandlerTests.Windows.cs | 4 +- .../Switch/SwitchHandlerTests.Windows.cs | 2 +- .../Memory/CALayerAutosizeObserverTests.cs | 2 +- .../src/Connectivity/Connectivity.uwp.cs | 2 +- .../src/Screenshot/Screenshot.uwp.cs | 6 +- .../Platforms/MaciOS/PlatformCanvas.cs | 10 +- .../Graphics.Tests/SkiaSharpScenarioTests.cs | 2 +- .../Resizetizer/src/SkiaSharpTools.cs | 28 +-- .../AssertionExtensions.Windows.cs | 2 +- .../MacTemplateTest.cs | 4 +- .../SimpleTemplateTest.cs | 22 +-- .../Actions/AppiumAndroidSpecificActions.cs | 2 +- .../Actions/AppiumCatalystSpecificActions.cs | 6 +- .../Actions/AppiumClipboardActions.cs | 4 +- .../Actions/AppiumOrientationActions.cs | 2 +- .../src/UITest.Appium/HelperExtensions.cs | 36 ++-- 279 files changed, 1655 insertions(+), 1619 deletions(-) diff --git a/src/Compatibility/Core/src/Tizen/ResourcePath.cs b/src/Compatibility/Core/src/Tizen/ResourcePath.cs index b1fee46baf59..c8ce5ec99053 100644 --- a/src/Compatibility/Core/src/Tizen/ResourcePath.cs +++ b/src/Compatibility/Core/src/Tizen/ResourcePath.cs @@ -14,7 +14,7 @@ public static string GetPath(string res) return res; } - foreach (AppFW.ResourceManager.Category category in Enum.GetValues()) + foreach (AppFW.ResourceManager.Category category in Enum.GetValues()) { var path = AppFW.ResourceManager.TryGetPath(category, res); diff --git a/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs b/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs index 374a7dd96826..9deacf7ea951 100644 --- a/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs +++ b/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs @@ -497,7 +497,7 @@ void UpdateBarIcons() #pragma warning disable RS0030 // Do not use banned APIs; Panel.Children is banned for performance reasons. var stackPanelItem = stackPanel.Children[i]; #pragma warning restore RS0030 // Do not use banned APIs - + if (stackPanelItem is WImage tabBarImage) { // Update icon image. diff --git a/src/Controls/samples/Controls.Sample.Embedding/Platforms/Windows/App.xaml.cs b/src/Controls/samples/Controls.Sample.Embedding/Platforms/Windows/App.xaml.cs index bf07c6549e8e..4d19917658ee 100644 --- a/src/Controls/samples/Controls.Sample.Embedding/Platforms/Windows/App.xaml.cs +++ b/src/Controls/samples/Controls.Sample.Embedding/Platforms/Windows/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; @@ -26,24 +26,24 @@ namespace Maui.Controls.Sample.WinUI; /// public partial class App : Microsoft.UI.Xaml.Application { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - InitializeComponent(); - } + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + InitializeComponent(); + } - /// - /// Invoked when the application is launched. - /// - /// Details about the launch request and process. - protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) - { - m_window = new MainWindow(); - m_window.Activate(); - } + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } - private Microsoft.UI.Xaml.Window? m_window; + private Microsoft.UI.Xaml.Window? m_window; } diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewWithDataTemplateSelector.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewWithDataTemplateSelector.xaml.cs index 3cf229703706..11e7e9a97b35 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewWithDataTemplateSelector.xaml.cs +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewWithDataTemplateSelector.xaml.cs @@ -1,6 +1,4 @@ #nullable enable -using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Xaml; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -8,6 +6,8 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Windows.Input; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml; namespace Maui.Controls.Sample.Pages.CollectionViewGalleries.EmptyViewGalleries { @@ -17,59 +17,59 @@ public partial class EmptyViewWithDataTemplateSelector : ContentPage public EmptyViewWithDataTemplateSelector() { InitializeComponent(); - var emptyViewTemplateSelector = new SearchTermDataTemplateSelector - { - DefaultTemplate = (DataTemplate)Resources["AdvancedTemplate"], - OtherTemplate = (DataTemplate)Resources["BasicTemplate"] - }; - collectionView.EmptyViewTemplate = emptyViewTemplateSelector; - BindingContext = new EmptyViewWithDataTemplateSelectorViewModel(); + var emptyViewTemplateSelector = new SearchTermDataTemplateSelector + { + DefaultTemplate = (DataTemplate)Resources["AdvancedTemplate"], + OtherTemplate = (DataTemplate)Resources["BasicTemplate"] + }; + collectionView.EmptyViewTemplate = emptyViewTemplateSelector; + BindingContext = new EmptyViewWithDataTemplateSelectorViewModel(); } public class Monkey - { - public string? Name { get; set; } - public string? Location { get; set; } - public string? Details { get; set; } - } + { + public string? Name { get; set; } + public string? Location { get; set; } + public string? Details { get; set; } + } public class SearchTermDataTemplateSelector : DataTemplateSelector - { - public DataTemplate? DefaultTemplate { get; set; } - public DataTemplate? OtherTemplate { get; set; } + { + public DataTemplate? DefaultTemplate { get; set; } + public DataTemplate? OtherTemplate { get; set; } - protected override DataTemplate? OnSelectTemplate(object item, BindableObject container) + protected override DataTemplate? OnSelectTemplate(object item, BindableObject container) { string query = (string)item; return query.Equals("xamarin", StringComparison.OrdinalIgnoreCase) ? OtherTemplate : DefaultTemplate; } - } + } internal class EmptyViewWithDataTemplateSelectorViewModel { public ObservableCollection Monkeys { get; } = new(); - public ICommand FilterCommand => new Command(FilterItems); + public ICommand FilterCommand => new Command(FilterItems); - public EmptyViewWithDataTemplateSelectorViewModel() - { - // Directly populate the ObservableCollection - Monkeys.Add(new Monkey - { - Name = "Baboon", - Location = "Africa & Asia", - Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae." - }); - } + public EmptyViewWithDataTemplateSelectorViewModel() + { + // Directly populate the ObservableCollection + Monkeys.Add(new Monkey + { + Name = "Baboon", + Location = "Africa & Asia", + Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae." + }); + } - private void FilterItems(string filter) - { - var filteredItems = Monkeys.Where(monkey => monkey.Name?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false).ToList(); - Monkeys.Clear(); - foreach (var monkey in filteredItems) - { - Monkeys.Add(monkey); - } - } + private void FilterItems(string filter) + { + var filteredItems = Monkeys.Where(monkey => monkey.Name?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false).ToList(); + Monkeys.Clear(); + foreach (var monkey in filteredItems) + { + Monkeys.Add(monkey); + } + } } } } \ No newline at end of file diff --git a/src/Controls/src/Build.Tasks/NodeILExtensions.cs b/src/Controls/src/Build.Tasks/NodeILExtensions.cs index d867c65f1d3b..0a53220378b7 100644 --- a/src/Controls/src/Build.Tasks/NodeILExtensions.cs +++ b/src/Controls/src/Build.Tasks/NodeILExtensions.cs @@ -126,7 +126,7 @@ public static IEnumerable PushConvertedValue(this ValueNode node, I var typeConverter = bpRef.GetBindablePropertyTypeConverter(context.Cache, module); //we're gonna SetValue. if the BP type is Nullable, we only need to convert/box to the non-nullable type? why, because the CSC compiler does it like that - if (targetTypeRef.ResolveCached(context.Cache).FullName == "System.Nullable`1") + if (targetTypeRef.ResolveCached(context.Cache).FullName == "System.Nullable`1") targetTypeRef = ((GenericInstanceType)targetTypeRef).GenericArguments[0]; return node.PushConvertedValue(context, targetTypeRef, typeConverter, pushServiceProvider, boxValueTypes, diff --git a/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs b/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs index 033648137953..488fd60fa210 100644 --- a/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs +++ b/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs @@ -683,7 +683,7 @@ static bool TryParsePath(ILContext context, string path, TypeReference tSourceRe { if (previousPartTypeRef.IsArray) previousPartTypeRef = previousPartTypeRef.GetElementType(); - + previousPartTypeRef.ResolveCached(context.Cache); } diff --git a/src/Controls/src/Build.Tasks/XamlCTask.cs b/src/Controls/src/Build.Tasks/XamlCTask.cs index 8bc45cf69c43..9592b9cc21e5 100644 --- a/src/Controls/src/Build.Tasks/XamlCTask.cs +++ b/src/Controls/src/Build.Tasks/XamlCTask.cs @@ -283,14 +283,16 @@ public override bool Execute(out IList thrownExceptions) LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Parsing Xaml"); ILRootNode rootnode = null; - try { + try + { rootnode = ParseXaml(resource.GetResourceStream(), typeDef); if (rootnode == null) { LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}failed."); continue; } - } catch (XamlParseException xpe) + } + catch (XamlParseException xpe) { LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}failed."); xamlFilePath = LoggingHelper.GetXamlFilePath(xamlFilePath); diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Tizen/CellContentFactory.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Tizen/CellContentFactory.cs index a087f1a06cee..6a68cda7758a 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Tizen/CellContentFactory.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Tizen/CellContentFactory.cs @@ -1,6 +1,6 @@ #nullable disable -using Microsoft.Maui.Graphics; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Handlers.Compatibility { diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/ListViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/ListViewRenderer.cs index c7ddfc9ccaf9..e52a974164a2 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/ListViewRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/ListViewRenderer.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Reflection; using System.Threading.Tasks; +using Microsoft.Maui.ApplicationModel; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.Platform.Compatibility; @@ -19,7 +20,6 @@ using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media; -using Microsoft.Maui.ApplicationModel; using Windows.Foundation; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListView; using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility; diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs index aaeb1dec6d18..3078252e218a 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs @@ -633,7 +633,7 @@ void PushPage(Page page, bool animated, TaskCompletionSource completionSou _completionTasks[pageViewController] = completionSource; PushViewController(pageViewController, animated); - + if (completionSource != null && !showsPresentation) completionSource.TrySetResult(true); } diff --git a/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs index 4d79bddb25a9..c7fef72d8c06 100644 --- a/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs +++ b/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs @@ -23,7 +23,7 @@ public partial class CarouselViewHandler : ItemsViewHandler ScrollViewer _scrollViewer; WScrollBarVisibility? _horizontalScrollBarVisibilityWithoutLoop; WScrollBarVisibility? _verticalScrollBarVisibilityWithoutLoop; - Size _currentSize; + Size _currentSize; bool _isCarouselViewReady; NotifyCollectionChangedEventHandler _collectionChanged; readonly WeakNotifyCollectionChangedProxy _proxy = new(); @@ -195,7 +195,7 @@ public static void MapPosition(CarouselViewHandler handler, CarouselView carouse { handler.UpdatePosition(); } - + } public static void MapIsBounceEnabled(CarouselViewHandler handler, CarouselView carouselView) diff --git a/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs index ae7357f17cbb..4a5afa82f6ba 100644 --- a/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs +++ b/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs @@ -628,7 +628,7 @@ object FindBoundItem(ScrollToRequestEventArgs args) { // CollectionGroups property is of type IObservableVector, but these objects should implement ICollectionViewGroup var itemGroup = CollectionViewSource.View.CollectionGroups[args.GroupIndex] as ICollectionViewGroup; - if (itemGroup != null && + if (itemGroup != null && args.Index < itemGroup.GroupItems.Count) { return itemGroup.GroupItems[args.Index]; diff --git a/src/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cs b/src/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cs index 6d6b8fdb0d89..efdeffbb634a 100644 --- a/src/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cs +++ b/src/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cs @@ -483,7 +483,7 @@ internal void UpdateFromCurrentItem() { if (!InitialPositionSet) return; - + if (ItemsView is not CarouselView carousel) { return; @@ -507,7 +507,7 @@ internal void UpdateFromPosition() { return; } - + if (ItemsView is not CarouselView carousel) { return; @@ -557,7 +557,7 @@ async Task UpdateInitialPosition() { position = positionCurrentItem; } - } + } await Task.Delay(100).ContinueWith((t) => { @@ -567,17 +567,17 @@ await Task.Delay(100).ContinueWith((t) => { return; } - + InitialPositionSet = true; if (ItemsSource is null || ItemsSource.ItemCount == 0) { return; } - + carousel.ScrollTo(position, -1, Microsoft.Maui.Controls.ScrollToPosition.Center, false); - + SetCurrentItem(position); UpdateVisualStates(); }); diff --git a/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewLayout.cs b/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewLayout.cs index a5665d054e9d..c6f8473b629d 100644 --- a/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewLayout.cs +++ b/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewLayout.cs @@ -114,7 +114,7 @@ internal virtual bool UpdateConstraints(CGSize size) ClearCellSizeCache(); EstimatedItemSize = CGSize.Empty; - + _currentSize = size; var newSize = new CGSize(Math.Floor(size.Width), Math.Floor(size.Height)); diff --git a/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs b/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs index 357ac93cc678..47f721960fd0 100644 --- a/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs +++ b/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs @@ -40,7 +40,7 @@ internal void SelectItem(object selectedItem) if (index.Section > -1 && index.Item > -1) { - // Ensure the selected index is updated after the collection view's items generation is completed + // Ensure the selected index is updated after the collection view's items generation is completed CollectionView.PerformBatchUpdates(null, _ => { CollectionView.SelectItem(index, true, UICollectionViewScrollPosition.None); @@ -53,7 +53,7 @@ internal void ClearSelection() { var selectedItemIndexes = CollectionView.GetIndexPathsForSelectedItems(); - if(selectedItemIndexes is not null && selectedItemIndexes.Any()) + if (selectedItemIndexes is not null && selectedItemIndexes.Any()) { CollectionView.PerformBatchUpdates(null, _ => { @@ -167,7 +167,7 @@ void SynchronizePlatformSelectionWithSelectedItems() CollectionView.PerformBatchUpdates(null, _ => { CollectionView.DeselectItem(path, true); - }); + }); } else { diff --git a/src/Controls/src/Core/Handlers/Items2/CollectionViewHandler2.iOS.cs b/src/Controls/src/Core/Handlers/Items2/CollectionViewHandler2.iOS.cs index 189ca53a3107..4cc36317d378 100644 --- a/src/Controls/src/Core/Handlers/Items2/CollectionViewHandler2.iOS.cs +++ b/src/Controls/src/Core/Handlers/Items2/CollectionViewHandler2.iOS.cs @@ -155,7 +155,7 @@ protected override UICollectionViewLayout SelectLayout() var itemSizingStrategy = ItemsView.ItemSizingStrategy; var itemsLayout = ItemsView.ItemsLayout; - + SubscribeToItemsLayoutPropertyChanged(itemsLayout); if (itemsLayout is GridItemsLayout gridItemsLayout) @@ -199,7 +199,7 @@ public static void MapItemSizingStrategy(CollectionViewHandler2 handler, Structu void SubscribeToItemsLayoutPropertyChanged(IItemsLayout itemsLayout) { - if(itemsLayout is not null) + if (itemsLayout is not null) { itemsLayout.PropertyChanged += (sender, args) => { diff --git a/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs b/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs index ca9b06027c94..cc2cb5497761 100644 --- a/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs +++ b/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs @@ -286,14 +286,14 @@ public VisualElement? Element if (_element == value) return; - if (_element is View && ElementGestureRecognizers is {} gestureRecognizersBefore) + if (_element is View && ElementGestureRecognizers is { } gestureRecognizersBefore) { gestureRecognizersBefore.CollectionChanged -= _collectionChangedHandler; } _element = value; - if (_element is View && ElementGestureRecognizers is {} gestureRecognizersAfter) + if (_element is View && ElementGestureRecognizers is { } gestureRecognizersAfter) { gestureRecognizersAfter.CollectionChanged += _collectionChangedHandler; } @@ -385,7 +385,7 @@ protected virtual void Dispose(bool disposing) ClearContainerEventHandlers(); - if (_element is View && ElementGestureRecognizers is {} gestureRecognizers) + if (_element is View && ElementGestureRecognizers is { } gestureRecognizers) { gestureRecognizers.CollectionChanged -= _collectionChangedHandler; } @@ -425,7 +425,7 @@ void HandlePan(ManipulationDeltaRoutedEventArgs e, View view) { if (view == null) return; - + _isPanning = true; foreach (IPanGestureController recognizer in view.GestureRecognizers.GetGesturesFor().Where(g => g.TouchPoints == _fingers.Count)) @@ -517,7 +517,7 @@ void OnPointerExited(object sender, PointerRoutedEventArgs e) if (_fingers.Contains(id)) _fingers.Remove(id); } - + SwipeComplete(true); PinchComplete(true); } @@ -756,7 +756,7 @@ void UpdateDragAndDropGestureRecognizers() if (allowDrop) { _subscriptionFlags |= SubscriptionFlags.ContainerDropEventsSubscribed; - + _container.AllowDrop = true; _container.DragOver += HandleDragOver; _container.Drop += HandleDrop; @@ -784,7 +784,7 @@ void UpdatingGestureRecognizers() { _subscriptionFlags |= SubscriptionFlags.ContainerTapAndRightTabEventSubscribed; _tappedEventHandler = new TappedEventHandler(OnTap); - _container.AddHandler(FrameworkElement.TappedEvent,_tappedEventHandler, true); + _container.AddHandler(FrameworkElement.TappedEvent, _tappedEventHandler, true); _container.RightTapped += OnTap; } else diff --git a/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs b/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs index d6dabcc3bc5a..dac2fb07052a 100644 --- a/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs +++ b/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs @@ -175,7 +175,7 @@ internal void Realize() var content = dataTemplate.CreateContent(); _visualElement = content as VisualElement; - if(_visualElement is null) + if (_visualElement is null) { throw new InvalidOperationException($"{dataTemplate} could not be created from {content}"); } diff --git a/src/Controls/src/Core/Platform/Windows/CollectionView/LoopableCollectionView.cs b/src/Controls/src/Core/Platform/Windows/CollectionView/LoopableCollectionView.cs index 5c4f6105438a..1b84dd2f1f23 100644 --- a/src/Controls/src/Core/Platform/Windows/CollectionView/LoopableCollectionView.cs +++ b/src/Controls/src/Core/Platform/Windows/CollectionView/LoopableCollectionView.cs @@ -191,7 +191,7 @@ IEnumerator IEnumerable.GetEnumerator() return ((IEnumerable)_internal).GetEnumerator(); } - void OnItemsVectorChanged(global::Windows.Foundation.Collections.IObservableVector sender, + void OnItemsVectorChanged(global::Windows.Foundation.Collections.IObservableVector sender, global::Windows.Foundation.Collections.IVectorChangedEventArgs @event) { _vectorChanged.Invoke(sender, @event); diff --git a/src/Controls/src/Core/Platform/Windows/CollectionView/ScrollHelpers.cs b/src/Controls/src/Core/Platform/Windows/CollectionView/ScrollHelpers.cs index 3ac899b2ca0d..f57cf03a9c59 100644 --- a/src/Controls/src/Core/Platform/Windows/CollectionView/ScrollHelpers.cs +++ b/src/Controls/src/Core/Platform/Windows/CollectionView/ScrollHelpers.cs @@ -208,7 +208,7 @@ internal static void JumpToIndexAsync(ListViewBase list, int index, ScrollToPosi public static async Task JumpToItemAsync(ListViewBase list, object targetItem, ScrollToPosition scrollToPosition) { - if(!list.IsLoaded) + if (!list.IsLoaded) { list.OnLoaded(async () => { diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs index 41d725179f45..76ccfca3a57f 100644 --- a/src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs +++ b/src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs @@ -109,7 +109,7 @@ internal static void SetLineBreakMode(this TextBlock textBlock, LineBreakMode li throw new ArgumentOutOfRangeException(); } } - + internal static void SetTextReadingOrder(this TextBlock platformControl, bool detectReadingOrderFromContent) => platformControl.TextReadingOrder = detectReadingOrderFromContent ? TextReadingOrder.DetectFromContent diff --git a/src/Controls/src/Core/PlatformConfiguration/ExtensionPoints.cs b/src/Controls/src/Core/PlatformConfiguration/ExtensionPoints.cs index e9bd854a18a5..bb8068436778 100644 --- a/src/Controls/src/Core/PlatformConfiguration/ExtensionPoints.cs +++ b/src/Controls/src/Core/PlatformConfiguration/ExtensionPoints.cs @@ -31,7 +31,7 @@ public sealed class Windows : IConfigPlatform { } /// Developers specify the type name of this marker class to the method to specify the underlying Tizen control on which to run a platform-specific effect. /// public sealed class Tizen : IConfigPlatform { } - + /// /// Marker class that identifies the macOS platform. /// diff --git a/src/Controls/src/Core/RadioButton/RadioButton.cs b/src/Controls/src/Core/RadioButton/RadioButton.cs index db2bfec12c8b..5a5476c3ae22 100644 --- a/src/Controls/src/Core/RadioButton/RadioButton.cs +++ b/src/Controls/src/Core/RadioButton/RadioButton.cs @@ -643,7 +643,7 @@ public string ContentAsString() Font ITextStyle.Font => this.ToFont(); -#if ANDROID +#if ANDROID object IContentView.Content { get diff --git a/src/Controls/src/Core/Shell/ShellContent.cs b/src/Controls/src/Core/Shell/ShellContent.cs index bb06d838443b..d70fe0d38eac 100644 --- a/src/Controls/src/Core/Shell/ShellContent.cs +++ b/src/Controls/src/Core/Shell/ShellContent.cs @@ -231,12 +231,12 @@ internal void EvaluateDisconnect() Shell shell = null; - if (Parent is ShellSection shellSection && - shellSection.Parent is ShellItem shellItem && - shellItem.Parent is Shell shellInstance) + if (Parent is ShellSection shellSection && + shellSection.Parent is ShellItem shellItem && + shellItem.Parent is Shell shellInstance) { shell = shellInstance; - disconnect = + disconnect = !this.IsVisible || // user has set the IsVisible property to false (_contentCache is not null && !_contentCache.IsVisible) || // user has set IsVisible on the Page to false shell.CurrentItem != shellItem || // user has navigated to a different TabBar or a different FlyoutItem diff --git a/src/Controls/src/Core/XamlParseException.cs b/src/Controls/src/Core/XamlParseException.cs index f289aec4dd20..c4dfda9cdaa4 100644 --- a/src/Controls/src/Core/XamlParseException.cs +++ b/src/Controls/src/Core/XamlParseException.cs @@ -52,7 +52,7 @@ public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerE /// public IXmlLineInfo XmlInfo { get; private set; } internal string UnformattedMessage => _unformattedMessage ?? Message; - + static string FormatMessage(string message, IXmlLineInfo xmlinfo) { if (xmlinfo == null || !xmlinfo.HasLineInfo()) diff --git a/src/Controls/src/Xaml/IXmlLineInfoExtensions.cs b/src/Controls/src/Xaml/IXmlLineInfoExtensions.cs index 7234a0b758dc..aef4783d06e8 100644 --- a/src/Controls/src/Xaml/IXmlLineInfoExtensions.cs +++ b/src/Controls/src/Xaml/IXmlLineInfoExtensions.cs @@ -4,8 +4,8 @@ namespace Microsoft.Maui.Controls.Xaml; static class IXmlLineInfoExtensions { - public static IXmlLineInfo Clone(this IXmlLineInfo xmlLineInfo) - { - return new XmlLineInfo(xmlLineInfo.LineNumber, xmlLineInfo.LinePosition); - } + public static IXmlLineInfo Clone(this IXmlLineInfo xmlLineInfo) + { + return new XmlLineInfo(xmlLineInfo.LineNumber, xmlLineInfo.LinePosition); + } } \ No newline at end of file diff --git a/src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs b/src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs index 6f8ba965115a..bbdd1d11728b 100644 --- a/src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs +++ b/src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs @@ -25,7 +25,7 @@ public void IconImageSourceAddsCorrectlyToEachSetOfLogicalChildren() var child0 = new TChildType(); var child1 = new TChildType(); - + menuBar.Add(child0); menuBar.Add(child1); @@ -38,12 +38,12 @@ public void IconImageSourceAddsCorrectlyToEachSetOfLogicalChildren() if (child1 is MenuItem mi2) mi2.IconImageSource = new FileImageSource { File = "coffee.png" }; - foreach(var item in menuBar) + foreach (var item in menuBar) { Assert.NotNull(item); if (item is IList list) { - foreach(var child in list) + foreach (var child in list) { Assert.NotNull(child); } diff --git a/src/Controls/tests/DeviceTests/Elements/Border/BorderTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/Border/BorderTests.Windows.cs index 65e995b587d6..82b35e999e42 100644 --- a/src/Controls/tests/DeviceTests/Elements/Border/BorderTests.Windows.cs +++ b/src/Controls/tests/DeviceTests/Elements/Border/BorderTests.Windows.cs @@ -24,12 +24,12 @@ public async Task InnerCornerRadiusInitializesCorrectly(int cornerRadius) var border = new Border() { - Content = new Label - { - Text = "Background", - TextColor = Colors.Red, - FontFamily = "Segoe UI", - HorizontalOptions = LayoutOptions.Center, + Content = new Label + { + Text = "Background", + TextColor = Colors.Red, + FontFamily = "Segoe UI", + HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center }, HorizontalOptions = LayoutOptions.Center, diff --git a/src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.Windows.cs index d32887e40c8e..7ab563b4198d 100644 --- a/src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.Windows.cs +++ b/src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.Windows.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Collections.ObjectModel; +using System.Collections.Specialized; using System.Linq; using System.Threading.Tasks; using Microsoft.Maui.Controls; @@ -297,7 +297,7 @@ await CreateHandlerAndAddToWindow(layout, async (handler) => Assert.True(data.Count == 30); }); } - + [Fact] public async Task VerifyGroupCollectionDoesntLeak() { diff --git a/src/Controls/tests/DeviceTests/Elements/ContentView/ContentViewTests.cs b/src/Controls/tests/DeviceTests/Elements/ContentView/ContentViewTests.cs index 6497f1dbd283..589d38f5b7fb 100644 --- a/src/Controls/tests/DeviceTests/Elements/ContentView/ContentViewTests.cs +++ b/src/Controls/tests/DeviceTests/Elements/ContentView/ContentViewTests.cs @@ -31,12 +31,12 @@ public async Task ControlTemplateUpdates() await InvokeOnMainThreadAsync(() => { - var child = new Label { Text = "Content 1" }; - var contentView = new Microsoft.Maui.Controls.ContentView(); - var header = new Label { Text = "Header" }; - var footer = new Label { Text = "Footer" }; - var presenter = new ContentPresenter(); - var grid = new Grid(); + var child = new Label { Text = "Content 1" }; + var contentView = new Microsoft.Maui.Controls.ContentView(); + var header = new Label { Text = "Header" }; + var footer = new Label { Text = "Footer" }; + var presenter = new ContentPresenter(); + var grid = new Grid(); var contentViewHandler = CreateHandler(contentView); contentView.Content = child; Assert.True(GetChildCount(contentViewHandler) == 1); diff --git a/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs index 4bbcc4c27276..b1932396b75a 100644 --- a/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs +++ b/src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs @@ -13,10 +13,10 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Xunit; +using static Microsoft.Maui.DeviceTests.AssertHelpers; using NavigationView = Microsoft.UI.Xaml.Controls.NavigationView; using WFrameworkElement = Microsoft.UI.Xaml.FrameworkElement; using WNavigationViewItem = Microsoft.UI.Xaml.Controls.NavigationViewItem; -using static Microsoft.Maui.DeviceTests.AssertHelpers; 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 39ea47319a41..097485c5af89 100644 --- a/src/Controls/tests/DeviceTests/Elements/Window/WindowTests.Windows.cs +++ b/src/Controls/tests/DeviceTests/Elements/Window/WindowTests.Windows.cs @@ -10,8 +10,8 @@ using Microsoft.Maui.Platform; using Microsoft.UI.Windowing; using Xunit; -using WPanel = Microsoft.UI.Xaml.Controls.Panel; using static Microsoft.Maui.DeviceTests.AssertHelpers; +using WPanel = Microsoft.UI.Xaml.Controls.Panel; namespace Microsoft.Maui.DeviceTests { diff --git a/src/Controls/tests/DeviceTests/Stubs/MauiAppNewWindowStub.Windows.cs b/src/Controls/tests/DeviceTests/Stubs/MauiAppNewWindowStub.Windows.cs index 6223b70922ab..f9c10a1d1c65 100644 --- a/src/Controls/tests/DeviceTests/Stubs/MauiAppNewWindowStub.Windows.cs +++ b/src/Controls/tests/DeviceTests/Stubs/MauiAppNewWindowStub.Windows.cs @@ -116,8 +116,8 @@ public void OpenWindow(IWindow window) throw new NotImplementedException(); } - public void ActivateWindow(IWindow window) - { + public void ActivateWindow(IWindow window) + { throw new NotImplementedException(); } diff --git a/src/Controls/tests/Maui25871Library/CompareConverter.cs b/src/Controls/tests/Maui25871Library/CompareConverter.cs index 9ff9aadce848..0c2b8fdd9a65 100644 --- a/src/Controls/tests/Maui25871Library/CompareConverter.cs +++ b/src/Controls/tests/Maui25871Library/CompareConverter.cs @@ -21,17 +21,17 @@ public sealed partial class CompareConverter : CompareConverter public abstract class CompareConverter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TValue, TReturnObject> : IValueConverter where TValue : IComparable { - object? IValueConverter.Convert(object? value, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type targetType, object? parameter, CultureInfo culture) => + object? IValueConverter.Convert(object? value, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type targetType, object? parameter, CultureInfo culture) => true; /// object? IValueConverter.ConvertBack(object? value, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type targetType, object? parameter, CultureInfo culture) => false; - public object ProvideValue(IServiceProvider serviceProvider) => this; + public object ProvideValue(IServiceProvider serviceProvider) => this; - /// + /// /// The comparing value. /// public TValue? ComparingValue { get; set; } @@ -51,7 +51,7 @@ public abstract class CompareConverter<[DynamicallyAccessedMembers(DynamicallyAc /// public TReturnObject? FalseObject { get; set; } - /// + /// /// Math operator type /// [Flags] diff --git a/src/Controls/tests/TestCases.HostApp/Elements/ContactsPage.cs b/src/Controls/tests/TestCases.HostApp/Elements/ContactsPage.cs index fd4d420c6cce..22ab3a4b7601 100644 --- a/src/Controls/tests/TestCases.HostApp/Elements/ContactsPage.cs +++ b/src/Controls/tests/TestCases.HostApp/Elements/ContactsPage.cs @@ -12,20 +12,20 @@ public ContactsPage() { ItemTemplate = new DataTemplate(() => { - var stackLayout = new VerticalStackLayout(){ Spacing = 4 }; + var stackLayout = new VerticalStackLayout() { Spacing = 4 }; - var nameLabel = new Label() { FontSize = 14}; + var nameLabel = new Label() { FontSize = 14 }; nameLabel.SetBinding(Label.TextProperty, "Name"); nameLabel.SetBinding(Label.AutomationIdProperty, "Name"); - var numberLabel = new Label() { FontSize = 10}; + var numberLabel = new Label() { FontSize = 10 }; numberLabel.SetBinding(Label.TextProperty, "Number"); numberLabel.SetBinding(Label.AutomationIdProperty, "Number"); stackLayout.Children.Add(nameLabel); stackLayout.Children.Add(numberLabel); - return new ViewCell(){ View = stackLayout }; + return new ViewCell() { View = stackLayout }; }), IsGroupingEnabled = true, GroupDisplayBinding = new Binding("Name") diff --git a/src/Controls/tests/TestCases.HostApp/Elements/DragAndDropBetweenLayouts.xaml.cs b/src/Controls/tests/TestCases.HostApp/Elements/DragAndDropBetweenLayouts.xaml.cs index f4a5c397a6c2..b1c50eae15ae 100644 --- a/src/Controls/tests/TestCases.HostApp/Elements/DragAndDropBetweenLayouts.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Elements/DragAndDropBetweenLayouts.xaml.cs @@ -84,7 +84,7 @@ void OnDragLeave(object sender, DragEventArgs e) sl.Background = SolidColorBrush.LightBlue; - dragLeaveEvent.Text= "DragLeave"; + dragLeaveEvent.Text = "DragLeave"; } void OnDrop(object sender, DropEventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla31333.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla31333.cs index 8d48134429fb..ff964d3d1886 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla31333.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla31333.cs @@ -142,7 +142,7 @@ public ExtendedCell(string automationId = null) } } - StackLayout CreateListViewTestSection(Type controlType,string automationId) + StackLayout CreateListViewTestSection(Type controlType, string automationId) { var name = controlType.GenericTypeArguments[0].Name; name = name.Replace("Extended", "", StringComparison.InvariantCultureIgnoreCase); @@ -206,7 +206,7 @@ StackLayout CreateTableViewTestSection(string automationId) where T : View, I protected override void Init() { - var entrySection = CreateListViewTestSection(typeof(ExtendedCell),"EntryListView"); + var entrySection = CreateListViewTestSection(typeof(ExtendedCell), "EntryListView"); var editorSection = CreateListViewTestSection(typeof(ExtendedCell), "EditorListView"); var entryTableSection = CreateTableViewTestSection("EntryTable"); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla32801.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla32801.cs index 85c069103bd5..da4f97795dc9 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla32801.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla32801.cs @@ -31,7 +31,7 @@ public TestDemoPage(int level, string AddButtonAutomationId, string StackButtonA BackgroundColor = Colors.Aqua }; - buttonAdd.Clicked += (sender, e) => Navigation.PushAsync(new TestDemoPage(_level + 1, $"Level{_level + 1}AddButton", $"Level{_level + 1}StackButton" )); + buttonAdd.Clicked += (sender, e) => Navigation.PushAsync(new TestDemoPage(_level + 1, $"Level{_level + 1}AddButton", $"Level{_level + 1}StackButton")); var buttonStack = new Button { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla35733.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla35733.cs index 5536b3fd7348..c914703597f8 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla35733.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla35733.cs @@ -24,8 +24,8 @@ protected override void Init() } } }); - - } + + } async Task ShowLocation(string locationString) { var stringUri = $"https://raw.githubusercontent.com/xamarin/Xamarin.Forms/main/README.md?l=en&px_location={Uri.EscapeDataString(locationString)}"; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36009.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36009.cs index d8cf05fb8519..0faf55b58bac 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36009.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36009.cs @@ -31,7 +31,7 @@ protected override void Init() { Children = { contentView } }; - AbsoluteLayout.SetLayoutBounds(contentView, new Rect(0,0,1,1)); + AbsoluteLayout.SetLayoutBounds(contentView, new Rect(0, 0, 1, 1)); AbsoluteLayout.SetLayoutFlags(contentView, AbsoluteLayoutFlags.All); Content = layout; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36703.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36703.cs index 550d93788fdd..906ea9255cdf 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36703.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36703.cs @@ -12,7 +12,7 @@ public class Bugzilla36703 : TestContentPage protected override void Init() { - var image = new Image { Source = "coffee.png", HeightRequest=58, WidthRequest=46, IsEnabled = false, AutomationId = TestImage }; + var image = new Image { Source = "coffee.png", HeightRequest = 58, WidthRequest = 46, IsEnabled = false, AutomationId = TestImage }; var button = new Button { Text = $"Toggle IsEnabled (now {image.IsEnabled})", AutomationId = Toggle }; var resultLabel = new Label { Text = "Testing..." }; var instructions = new Label diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla37625.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla37625.cs index 68410b772692..98844cdefac5 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla37625.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla37625.cs @@ -9,7 +9,7 @@ protected override async void Init() int retry = 5; while (retry-- >= 0) { - var imageUri = new Uri("https://raw.githubusercontent.com/dotnet/maui/main/src/Compatibility/ControlGallery/src/Android/Resources/drawable/coffee.png"); + var imageUri = new Uri("https://raw.githubusercontent.com/dotnet/maui/main/src/Compatibility/ControlGallery/src/Android/Resources/drawable/coffee.png"); Content = new Image() { Source = new UriImageSource() { Uri = imageUri }, BackgroundColor = Colors.Beige, AutomationId = "success" }; await Task.Delay(50); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40005.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40005.cs index d1be943d7dfb..c5d3620d4e69 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40005.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40005.cs @@ -14,13 +14,13 @@ public class Bugzilla40005 : NavigationPage public Bugzilla40005() : base(new Page1()) { - + } - + public class Page1 : ContentPage { - + bool pageInserted; public Page1() diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs index a5d4b8d70e50..3bf56f7d6eb9 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs @@ -31,7 +31,7 @@ protected override void Init() Color = Colors.Black, AutomationId = Black }; - + mainLayout.Children.Add(view); AbsoluteLayout.SetLayoutBounds(view, new Rect(0, 0, 1, 1)); AbsoluteLayout.SetLayoutFlags(view, AbsoluteLayoutFlags.All); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40173.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40173.cs index cd358b9ca174..ccfe9e7f243c 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40173.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40173.cs @@ -18,7 +18,7 @@ public class Bugzilla40173 : TestContentPage protected override void Init() { - var outputLabel = new Label() { Text="Default", AutomationId = "outputlabel" }; + var outputLabel = new Label() { Text = "Default", AutomationId = "outputlabel" }; var testButton = new Button { Text = "Can't Touch This", @@ -105,7 +105,7 @@ protected override void Init() }; return result; - + }); testListView.ItemSelected += (sender, args) => outputLabel.Text = ListTapSuccessText; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41038.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41038.cs index 89d2c61a26e7..a4f28c148473 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41038.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41038.cs @@ -9,10 +9,10 @@ public class Bugzilla41038 : TestFlyoutPage protected override void Init() { Title = "Main"; - + // Set FlyoutBehavior to Popover to ensure consistent behavior across desktop and mobile platforms. // Windows and Catalyst default (FlyoutLayoutBehavior.Default) uses Split mode, which differs from mobile platforms. - FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; + FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; var btnViewA = new Button() { Text = "ViewA", AutomationId = "ViewA" }; btnViewA.Clicked += Button_Clicked; @@ -49,7 +49,7 @@ private async void Button_Clicked(object sender, EventArgs e) await _navPage.Navigation.PushAsync(newRoot); _navPage.Navigation.RemovePage(root); - IsPresented = false; + IsPresented = false; } public class ViewA : ContentPage diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41600.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41600.cs index b5c9c883d9e9..1c2410641739 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41600.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41600.cs @@ -20,28 +20,28 @@ protected override void Init() ItemsSource = items }; var firstbutton = new Button - { - AutomationId = _btnScrollToNonExistentItem, - Text = "Click for ScrollTo (should do nothing)", - Command = new Command(() => - { - listView.ScrollTo("Hello", ScrollToPosition.Start, true); - }) - }; + { + AutomationId = _btnScrollToNonExistentItem, + Text = "Click for ScrollTo (should do nothing)", + Command = new Command(() => + { + listView.ScrollTo("Hello", ScrollToPosition.Start, true); + }) + }; var secondbutton = new Button - { - AutomationId = _btnScrollToExistentItem, - Text = "Click for ScrollTo (should go to 15)", - Command = new Command(() => - { - listView.ScrollTo(_middleListItem, ScrollToPosition.Start, false); - }) - }; - + { + AutomationId = _btnScrollToExistentItem, + Text = "Click for ScrollTo (should go to 15)", + Command = new Command(() => + { + listView.ScrollTo(_middleListItem, ScrollToPosition.Start, false); + }) + }; + Grid.SetRow(listView, 2); Grid.SetRow(firstbutton, 0); Grid.SetRow(secondbutton, 1); - + Content = new Grid { RowDefinitions = new RowDefinitionCollection diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla44166.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla44166.cs index c70f63ee5db4..6fceb1982280 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla44166.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla44166.cs @@ -8,7 +8,7 @@ public class Bugzilla44166 : TestContentPage { protected override void Init() { - var label = new Label() { Text = "Testing..." , AutomationId = "Result"}; + var label = new Label() { Text = "Testing...", AutomationId = "Result" }; var goButton = new Button { Text = "Go", AutomationId = "Go" }; goButton.Clicked += (sender, args) => Application.Current.MainPage = new _44166MDP(); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla45125.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla45125.cs index 01ec323468dd..f2527c1ee55f 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla45125.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla45125.cs @@ -68,7 +68,8 @@ protected override void Init() InitTest(ListViewCachingStrategy.RecycleElement, true); } - void InitializeControls(){ + void InitializeControls() + { _status = new Label { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla57114.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla57114.cs index 0a3d3d24bf4d..04c006d26b64 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla57114.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla57114.cs @@ -126,35 +126,35 @@ private void OnTouch(object sender, Android.Views.View.TouchEventArgs e) #elif IOS || MACCATALYST public class _57114ViewHandler : ViewHandler<_57114View, UIKit.UIView> - { - public static IPropertyMapper<_57114View, _57114ViewHandler> Mapper = new PropertyMapper<_57114View, _57114ViewHandler>(ViewHandler.ViewMapper) - { - - }; + { + public static IPropertyMapper<_57114View, _57114ViewHandler> Mapper = new PropertyMapper<_57114View, _57114ViewHandler>(ViewHandler.ViewMapper) + { - public _57114ViewHandler() : base(Mapper) - { - } + }; - protected override UIKit.UIView CreatePlatformView() - { - var view = new UIKit.UIView(); - var rec = new CustomGestureRecognizer(); - view.AddGestureRecognizer(rec); - return view; - } - } + public _57114ViewHandler() : base(Mapper) + { + } - public class CustomGestureRecognizer : UIKit.UIGestureRecognizer - { - public override void TouchesBegan(Foundation.NSSet touches, UIKit.UIEvent evt) - { - base.TouchesBegan(touches, evt); + protected override UIKit.UIView CreatePlatformView() + { + var view = new UIKit.UIView(); + var rec = new CustomGestureRecognizer(); + view.AddGestureRecognizer(rec); + return view; + } + } + + public class CustomGestureRecognizer : UIKit.UIGestureRecognizer + { + public override void TouchesBegan(Foundation.NSSet touches, UIKit.UIEvent evt) + { + base.TouchesBegan(touches, evt); #pragma warning disable CS0618 // Type or member is obsolete - MessagingCenter.Instance.Send(this as object, Bugzilla57114._57114NativeGestureFiredMessage); + MessagingCenter.Instance.Send(this as object, Bugzilla57114._57114NativeGestureFiredMessage); #pragma warning restore CS0618 // Type or member is obsolete - } - } + } + } #elif WINDOWS public class _57114ViewHandler : ViewHandler<_57114View, Microsoft.UI.Xaml.Controls.Grid> diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue11132.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue11132.cs index 1b20132837ac..b7102ed612a1 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue11132.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue11132.cs @@ -1,12 +1,12 @@ #if IOS || MACCATALYST -using UIKit; using System.Diagnostics; using CoreAnimation; using CoreGraphics; using Microsoft.Maui.Controls; +using Microsoft.Maui.Graphics; using Microsoft.Maui.Handlers; using Microsoft.Maui.Platform; -using Microsoft.Maui.Graphics; +using UIKit; #endif namespace Maui.Controls.Sample.Issues @@ -57,56 +57,56 @@ public class Issue11132Control : View #if IOS || MACCATALYST -public class Issue11132ControlHandler : Microsoft.Maui.Handlers.ViewHandler -{ - public Issue11132ControlHandler() : base(ViewHandler.ViewMapper, ViewHandler.ViewCommandMapper) - { - } - - protected override UIKit.UIView CreatePlatformView() - { - return new UIKit.UIView(); - } - - protected override void ConnectHandler(UIKit.UIView platformView) - { - base.ConnectHandler(platformView); - - var layer = platformView.Layer; - - if (layer != null) - { - layer.BorderWidth = 10; - layer.BorderColor = Colors.Red.ToCGColor(); - layer.BackgroundColor = Colors.Orange.ToCGColor(); - - var width = 100; - var height = 25; - - var clipPath = new CoreGraphics.CGPath(); - clipPath.MoveToPoint(width, height); - clipPath.AddLineToPoint(width * 2, height); - clipPath.AddLineToPoint(width * 2, height * 2); - clipPath.AddLineToPoint(width, height * 2); - clipPath.CloseSubpath(); - - var clipShapeLayer = new CAShapeLayer - { - Path = clipPath - }; - layer.Mask = clipShapeLayer; - layer.Mask.Name = null; - - Debug.WriteLine($"Issue11132ControlHandler Layer Name {layer.Mask.Name}"); - } - } - - protected override void DisconnectHandler(UIKit.UIView platformView) - { - base.DisconnectHandler(platformView); - // Cleanup if necessary - } -} + public class Issue11132ControlHandler : Microsoft.Maui.Handlers.ViewHandler + { + public Issue11132ControlHandler() : base(ViewHandler.ViewMapper, ViewHandler.ViewCommandMapper) + { + } + + protected override UIKit.UIView CreatePlatformView() + { + return new UIKit.UIView(); + } + + protected override void ConnectHandler(UIKit.UIView platformView) + { + base.ConnectHandler(platformView); + + var layer = platformView.Layer; + + if (layer != null) + { + layer.BorderWidth = 10; + layer.BorderColor = Colors.Red.ToCGColor(); + layer.BackgroundColor = Colors.Orange.ToCGColor(); + + var width = 100; + var height = 25; + + var clipPath = new CoreGraphics.CGPath(); + clipPath.MoveToPoint(width, height); + clipPath.AddLineToPoint(width * 2, height); + clipPath.AddLineToPoint(width * 2, height * 2); + clipPath.AddLineToPoint(width, height * 2); + clipPath.CloseSubpath(); + + var clipShapeLayer = new CAShapeLayer + { + Path = clipPath + }; + layer.Mask = clipShapeLayer; + layer.Mask.Name = null; + + Debug.WriteLine($"Issue11132ControlHandler Layer Name {layer.Mask.Name}"); + } + } + + protected override void DisconnectHandler(UIKit.UIView platformView) + { + base.DisconnectHandler(platformView); + // Cleanup if necessary + } + } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue12213.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue12213.cs index dddbe6fe3d67..c180477973fd 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue12213.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue12213.cs @@ -29,7 +29,7 @@ protected override void Init() private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) { - Label label = new Label { Text = "Tapped" }; + Label label = new Label { Text = "Tapped" }; if (Content is Layout layout) { layout.Children.Add(label); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue14587.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue14587.cs index 87d14027ff29..c16103b80cd1 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue14587.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue14587.cs @@ -17,7 +17,7 @@ public Issue14587() var tabBar = new TabBar { Route = "issue14587" }; tabBar.Items.Add(t1); tabBar.Items.Add(t2); - + Items.Add(tabBar); } } @@ -71,7 +71,7 @@ private void OnGlyphChanged() private void OnIconColorChanged() { - if (IconColor == null) + if (IconColor == null) { return; } @@ -137,7 +137,7 @@ public Issue14587Main() grid.Add(button); grid.Add(cv, 0, 1); - + Content = grid; } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue17123.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue17123.cs index 089b7575fa82..54272f8f07a8 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue17123.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue17123.cs @@ -11,11 +11,11 @@ protected override void Init() { var tableRootLabel = new Label() { Text = "TableRoot Title Text", TextColor = Colors.Red, AutomationId = "TableRootLabel" }; var tableSectionLabel = new Label() { Text = "TableSection Title Text", TextColor = Colors.Red, AutomationId = "TableSectionLabel" }; - - var tableView = new TableView() { Intent = TableIntent.Menu, AutomationId = "TableView", HorizontalOptions= LayoutOptions.Center }; - var tableRoot = new TableRoot(tableRootLabel.Text); - var tableSection = new TableSection(tableSectionLabel.Text) - { + + var tableView = new TableView() { Intent = TableIntent.Menu, AutomationId = "TableView", HorizontalOptions = LayoutOptions.Center }; + var tableRoot = new TableRoot(tableRootLabel.Text); + var tableSection = new TableSection(tableSectionLabel.Text) + { new TextCell() { Text = "TextCell Text" , Detail="TextCell Detail" }, new EntryCell() { Label = "EntryCell Label", Placeholder="EntryCell Placeholder" }, }; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue18452.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue18452.cs index 676e7fdd6a44..feecf965ff82 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue18452.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue18452.cs @@ -44,11 +44,11 @@ protected override void Init() if (c.Name == "DotNetMAUICookie") { if (!grid.Contains(label)) - { - grid.Children.Add(label); - label.Text = "Success"; - break; - } + { + grid.Children.Add(label); + label.Text = "Success"; + break; + } } } }; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue22674.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue22674.xaml.cs index 57fb42110218..1edd14e4c995 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue22674.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue22674.xaml.cs @@ -16,7 +16,7 @@ public Issue22674() } public ObservableCollection ItemList { get; } = ["A", "B", "C", "D", "E", "F", "G", "H", "I",]; - + void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender is CollectionView view && view.SelectedItem is string item) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue23491.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue23491.cs index 7772664c0ad1..3867509677f7 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue23491.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue23491.cs @@ -10,40 +10,43 @@ public class Issue23491 : ContentPage Label label2; public Issue23491() { - headerLabel = new Label { Text = "Below is the Content of the Child FlexLayout", - TextColor=Colors.Red }; + headerLabel = new Label + { + Text = "Below is the Content of the Child FlexLayout", + TextColor = Colors.Red + }; headerLabel.AutomationId = "HeaderLabel"; - - // Child FlexLayout - label1 = new Label - { - Text = "First label inside the child flexlayout", - Padding =new Thickness(5) - }; - label2 = new Label - { - Text = "Second label inside the child flexLayout", - Padding =new Thickness(5) - }; + // Child FlexLayout + label1 = new Label + { + Text = "First label inside the child flexlayout", + Padding = new Thickness(5) + }; - var childFlexLayout = new FlexLayout - { - Margin = new Thickness(10), - Wrap = FlexWrap.Wrap, - Children = { label1, label2 } - }; + label2 = new Label + { + Text = "Second label inside the child flexLayout", + Padding = new Thickness(5) + }; - // Main FlexLayout - var mainLayout = new FlexLayout - { - Direction = FlexDirection.Column, + var childFlexLayout = new FlexLayout + { + Margin = new Thickness(10), + Wrap = FlexWrap.Wrap, + Children = { label1, label2 } + }; + + // Main FlexLayout + var mainLayout = new FlexLayout + { + Direction = FlexDirection.Column, Children = { headerLabel, childFlexLayout } - }; + }; - // Set the content of the page - Content = mainLayout; + // Set the content of the page + Content = mainLayout; } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue23674.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue23674.xaml.cs index d0f6ab5a9fe2..134e80010131 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue23674.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue23674.xaml.cs @@ -4,7 +4,7 @@ [Issue(IssueTracker.Github, 23674, "Page.IsBusy activity indicators gets stuck/causes multiple to be displayed", PlatformAffected.Android)] public class Issue23674 : NavigationPage { - public Issue23674() : base(new Issue23674Page1()){ } + public Issue23674() : base(new Issue23674Page1()) { } class Issue23674Page1 : ContentPage { @@ -16,7 +16,7 @@ public Issue23674Page1() VerticalOptions = LayoutOptions.Start, Text = "Navigate to page 1", HeightRequest = 100, - Command = new Command(async ()=> + Command = new Command(async () => { await Navigation.PushAsync(new Issue23674Page2()); }) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue24847.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue24847.cs index df1587ba8111..c125e965e331 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue24847.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue24847.cs @@ -35,13 +35,13 @@ public Issue24847() Spacing = 16, Padding = 16 }; - + vsl.Add(_borderView); vsl.Add(_frameView); vsl.Add(button); ToggleSize(); - + Content = vsl; } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue24966.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue24966.xaml.cs index 2839cb7126eb..07d28978be14 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue24966.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue24966.xaml.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Collections.Specialized; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows.Input; -using System.Collections.Specialized; namespace Maui.Controls.Sample.Issues { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25224.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25224.xaml.cs index 8d44ee93e2ac..bb9c59d53231 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25224.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25224.xaml.cs @@ -8,57 +8,57 @@ namespace Maui.Controls.Sample.Issues { [XamlCompilation(XamlCompilationOptions.Compile)] [Issue(IssueTracker.Github, 25224, "CollectionView - EmptyView with EmptyViewTemplate for Data template selector page throws an exception", PlatformAffected.iOS)] - public partial class Issue25224: ContentPage + public partial class Issue25224 : ContentPage { public Issue25224() { InitializeComponent(); - var emptyViewTemplateSelector = new SearchTermDataTemplateSelector - { - DefaultTemplate = (DataTemplate)Resources["AdvancedTemplate"], - OtherTemplate = (DataTemplate)Resources["BasicTemplate"] - }; - collectionView.EmptyViewTemplate = emptyViewTemplateSelector; - BindingContext = new Issue25224ViewModel(); + var emptyViewTemplateSelector = new SearchTermDataTemplateSelector + { + DefaultTemplate = (DataTemplate)Resources["AdvancedTemplate"], + OtherTemplate = (DataTemplate)Resources["BasicTemplate"] + }; + collectionView.EmptyViewTemplate = emptyViewTemplateSelector; + BindingContext = new Issue25224ViewModel(); } public class SearchTermDataTemplateSelector : DataTemplateSelector - { - public DataTemplate? DefaultTemplate { get; set; } - public DataTemplate? OtherTemplate { get; set; } + { + public DataTemplate? DefaultTemplate { get; set; } + public DataTemplate? OtherTemplate { get; set; } - protected override DataTemplate? OnSelectTemplate(object item, BindableObject container) + protected override DataTemplate? OnSelectTemplate(object item, BindableObject container) { string query = (string)item; return query.Equals("xamarin", StringComparison.OrdinalIgnoreCase) ? OtherTemplate : DefaultTemplate; } - } + } internal class Issue25224ViewModel { public ObservableCollection Monkeys { get; } = new(); - public ICommand FilterCommand => new Command(FilterItems); + public ICommand FilterCommand => new Command(FilterItems); - public Issue25224ViewModel() - { - // Directly populate the ObservableCollection - Monkeys.Add(new Monkey - { - Name = "Baboon", - Location = "Africa & Asia", - Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae." - }); - } + public Issue25224ViewModel() + { + // Directly populate the ObservableCollection + Monkeys.Add(new Monkey + { + Name = "Baboon", + Location = "Africa & Asia", + Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae." + }); + } - private void FilterItems(string filter) - { - var filteredItems = Monkeys.Where(monkey => monkey.Name?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false).ToList(); - Monkeys.Clear(); - foreach (var monkey in filteredItems) - { - Monkeys.Add(monkey); - } - } + private void FilterItems(string filter) + { + var filteredItems = Monkeys.Where(monkey => monkey.Name?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false).ToList(); + Monkeys.Clear(); + foreach (var monkey in filteredItems) + { + Monkeys.Add(monkey); + } + } } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25436.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25436.xaml.cs index 1e6e49bba9aa..1d16d635ed57 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25436.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25436.xaml.cs @@ -11,7 +11,7 @@ public Issue25436() } protected override void Init() { - + } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25473.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25473.xaml.cs index aa0924e01845..6f6012abcb50 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25473.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25473.xaml.cs @@ -11,7 +11,7 @@ public Issue25473() private void OnToggleClearButtonVisibilityClicked(object sender, EventArgs e) { - if(mainEntryField.ClearButtonVisibility == ClearButtonVisibility.Never) + if (mainEntryField.ClearButtonVisibility == ClearButtonVisibility.Never) mainEntryField.ClearButtonVisibility = ClearButtonVisibility.WhileEditing; else mainEntryField.ClearButtonVisibility = ClearButtonVisibility.Never; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25551.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25551.xaml.cs index 8a8bb94608a3..9ae2dde7a544 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25551.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25551.xaml.cs @@ -1,5 +1,5 @@ -using Microsoft.Maui.Controls; -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; +using Microsoft.Maui.Controls; namespace Maui.Controls.Sample.Issues { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25742.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25742.cs index 0f0c0373631d..3c0bd2de0a40 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25742.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25742.cs @@ -5,59 +5,59 @@ public class Issue25742 : Shell { public Issue25742() { - // Register the routes - Routing.RegisterRoute("page2", typeof(Issue25742Page2)); + // Register the routes + Routing.RegisterRoute("page2", typeof(Issue25742Page2)); - // Create and add Shell contents - var page1 = new ShellContent - { - Title = "Page 1", - Content = new Issue25742Page1() - }; + // Create and add Shell contents + var page1 = new ShellContent + { + Title = "Page 1", + Content = new Issue25742Page1() + }; - Items.Add(page1); + Items.Add(page1); } } - public class Issue25742Page1 : ContentPage - { - public Issue25742Page1() - { - Title = "Page 1"; - var navigateButton = new Button - { - Text = "Go to Page 2", + public class Issue25742Page1 : ContentPage + { + public Issue25742Page1() + { + Title = "Page 1"; + var navigateButton = new Button + { + Text = "Go to Page 2", AutomationId = "GotoPage2" - }; - navigateButton.Clicked += OnNavigateToPage2Clicked; + }; + navigateButton.Clicked += OnNavigateToPage2Clicked; - Content = new StackLayout - { - Children = { navigateButton } - }; - } + Content = new StackLayout + { + Children = { navigateButton } + }; + } - private async void OnNavigateToPage2Clicked(object sender, EventArgs e) - { - await Shell.Current.GoToAsync("page2"); // Use the route name "page2" here - } - } + private async void OnNavigateToPage2Clicked(object sender, EventArgs e) + { + await Shell.Current.GoToAsync("page2"); // Use the route name "page2" here + } + } public class Issue25742Page2 : ContentPage - { - public Issue25742Page2() - { - Title = "Page 2"; - Content = new StackLayout - { - Children = { new Label { Text = "Welcome to Page 2" } } - }; + { + public Issue25742Page2() + { + Title = "Page 2"; + Content = new StackLayout + { + Children = { new Label { Text = "Welcome to Page 2" } } + }; - // Set back button behavior with empty TextOverride - Shell.SetBackButtonBehavior(this, new BackButtonBehavior - { - TextOverride = "" // Removes the back button text - }); - } - } + // Set back button behavior with empty TextOverride + Shell.SetBackButtonBehavior(this, new BackButtonBehavior + { + TextOverride = "" // Removes the back button text + }); + } + } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25792.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25792.xaml.cs index 0bcd89d2a939..3d7177ce90dd 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25792.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25792.xaml.cs @@ -4,7 +4,7 @@ namespace Maui.Controls.Sample.Issues { [XamlCompilation(XamlCompilationOptions.Compile)] [Issue(IssueTracker.Github, 25792, "Picker ItemsSource Change Triggers Exception: 'Value Does Not Fall Within the Expected Range", PlatformAffected.UWP)] - public partial class Issue25792: ContentPage + public partial class Issue25792 : ContentPage { private Picker _picker; public Issue25792() diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25829.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25829.xaml.cs index 9410abfa6006..ab6e594aa17f 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25829.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25829.xaml.cs @@ -14,7 +14,7 @@ protected override void OnAppearing() { base.OnAppearing(); - if(this.Navigation.ModalStack.Contains(this)) + if (this.Navigation.ModalStack.Contains(this)) { testButton.AutomationId = "Success"; } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25912.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue25912.xaml.cs index 815c4aa8e5ed..497698b183c2 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25912.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25912.xaml.cs @@ -9,7 +9,7 @@ public Issue25912() Navigation.PushAsync(new Issue25912MainPage()); } } - + public partial class Issue25912MainPage : TestContentPage { @@ -26,7 +26,7 @@ void Button_Clicked(object sender, EventArgs e) { toolbarItem.IconImageSource = new FontImageSource { - Glyph ="+", + Glyph = "+", Color = Colors.Green }; } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue26057.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue26057.xaml.cs index 911c616e7f14..465e1ddb998c 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue26057.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue26057.xaml.cs @@ -4,7 +4,7 @@ namespace Maui.Controls.Sample.Issues { [Issue(IssueTracker.Github, 26057, "[iOS & Mac] Gradient background size is incorrect when invalidating parent", PlatformAffected.iOS | PlatformAffected.macOS)] - public partial class Issue26057: ContentPage + public partial class Issue26057 : ContentPage { public Issue26057() { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue26065.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue26065.xaml.cs index 485217c6eda8..6d9f6c1a4258 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue26065.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue26065.xaml.cs @@ -7,16 +7,17 @@ public partial class Issue26065 : ContentPage { public Issue26065() { - InitializeComponent();BindingContext = new BookViewModel(); + InitializeComponent(); + BindingContext = new BookViewModel(); } - + private void Button_Clicked(object sender, EventArgs e) { - if(collView.ItemsLayout is LinearItemsLayout linearItemsLayout) + if (collView.ItemsLayout is LinearItemsLayout linearItemsLayout) { - linearItemsLayout.ItemSpacing = 20; - } + linearItemsLayout.ItemSpacing = 20; + } } } @@ -27,16 +28,16 @@ public class Book } // ViewModel - public class BookViewModel + public class BookViewModel { private ObservableCollection _bookGroups; public ObservableCollection Books { get => _bookGroups; - set + set { _bookGroups = value; - + } } @@ -49,18 +50,18 @@ private void LoadBooks() { Books = new ObservableCollection { - + new Book { Title = "Dune", Author = "Frank Herbert" }, new Book { Title = "Neuromancer", Author = "William Gibson" }, - - + + new Book { Title = "The Hobbit", Author = "J.R.R. Tolkien" }, new Book { Title = "Name of the Wind", Author = "Patrick Rothfuss" }, - - + + new Book { Title = "Murder on the Orient Express", Author = "Agatha Christie" }, new Book { Title = "The Girl with the Dragon Tattoo", Author = "Stieg Larsson" } - + }; } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue26066.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue26066.xaml.cs index 6ec5772f2ff1..318fbafc82fe 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue26066.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue26066.xaml.cs @@ -33,9 +33,9 @@ public Issue26066ViewModel() static void LoadItems(ObservableCollection items, string text) { items.Clear(); - for (int i = 0; i < 3 ; i++) + for (int i = 0; i < 3; i++) { - items.Add(new Issue22035Model { Text = $"{text} - Item {i}", ImagePath = i% 2 == 0 ? "photo21314.jpg" : "oasis.jpg" }); + items.Add(new Issue22035Model { Text = $"{text} - Item {i}", ImagePath = i % 2 == 0 ? "photo21314.jpg" : "oasis.jpg" }); } } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue26187.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue26187.cs index 46913993ad06..764d78a25afe 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue26187.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue26187.cs @@ -2,91 +2,91 @@ namespace Maui.Controls.Sample.Issues { - [Issue(IssueTracker.Github, 26187, "[MAUI] Select items traces are preserved", PlatformAffected.iOS)] - public class Issue26187 : NavigationPage - { - public Issue26187() - { - PushAsync(new CollectionViewSelectedItemNullPage()); - } - } + [Issue(IssueTracker.Github, 26187, "[MAUI] Select items traces are preserved", PlatformAffected.iOS)] + public class Issue26187 : NavigationPage + { + public Issue26187() + { + PushAsync(new CollectionViewSelectedItemNullPage()); + } + } - public class CollectionViewSelectedItemNullPage : ContentPage - { - public ObservableCollection Items { get; set; } + public class CollectionViewSelectedItemNullPage : ContentPage + { + public ObservableCollection Items { get; set; } - public string SelectedItem { get; set; } + public string SelectedItem { get; set; } - public CollectionViewSelectedItemNullPage() - { - Items = new ObservableCollection - { - "Item 1", - "Item 2", - "Item 3", - "Item 4", - "Item 5" - }; - SelectedItem = Items.LastOrDefault(); - var cv = new CollectionView - { - SelectionMode = SelectionMode.Single, - ItemTemplate = new DataTemplate(() => - { - var label = new Label - { - FontSize = 24, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - AutomationId ="lblItem" - }; - label.SetBinding(Label.TextProperty, "."); - - return new HorizontalStackLayout - { - Children = { label } - }; - }) - - }; - - cv.SetBinding(CollectionView.ItemsSourceProperty, new Binding(nameof(Items))); - // cv.SetBinding(CollectionView.SelectedItemProperty, new Binding(nameof(SelectedItem))); - Content = cv; + public CollectionViewSelectedItemNullPage() + { + Items = new ObservableCollection + { + "Item 1", + "Item 2", + "Item 3", + "Item 4", + "Item 5" + }; + SelectedItem = Items.LastOrDefault(); + var cv = new CollectionView + { + SelectionMode = SelectionMode.Single, + ItemTemplate = new DataTemplate(() => + { + var label = new Label + { + FontSize = 24, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.Center, + AutomationId = "lblItem" + }; + label.SetBinding(Label.TextProperty, "."); - BindingContext = this; - // cv.SelectedItem = SelectedItem; - - cv.SelectionChanged += CollectionView_SelectionChanged; - } + return new HorizontalStackLayout + { + Children = { label } + }; + }) - async void CollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - if (e.CurrentSelection.FirstOrDefault() is string issue) - { - await Navigation.PushAsync(new NewPage(issue)); - } + }; - // Clear Selection - var cv = sender as CollectionView; - if (cv is not null) - { - cv.SelectedItem = null; - } - } + cv.SetBinding(CollectionView.ItemsSourceProperty, new Binding(nameof(Items))); + // cv.SetBinding(CollectionView.SelectedItemProperty, new Binding(nameof(SelectedItem))); + Content = cv; - class NewPage : ContentPage - { - public NewPage(string item) - { - Title = item; - Content = new Button - { - Text = $"Go Back Selected Item null from {item}", - Command = new Command(() => Navigation.PopAsync()), - AutomationId = "btnGoBack" - }; - } - } - } + BindingContext = this; + // cv.SelectedItem = SelectedItem; + + cv.SelectionChanged += CollectionView_SelectionChanged; + } + + async void CollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (e.CurrentSelection.FirstOrDefault() is string issue) + { + await Navigation.PushAsync(new NewPage(issue)); + } + + // Clear Selection + var cv = sender as CollectionView; + if (cv is not null) + { + cv.SelectedItem = null; + } + } + + class NewPage : ContentPage + { + public NewPage(string item) + { + Title = item; + Content = new Button + { + Text = $"Go Back Selected Item null from {item}", + Command = new Command(() => Navigation.PopAsync()), + AutomationId = "btnGoBack" + }; + } + } + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue26629.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue26629.cs index cd5d6fdf8103..8d389225959a 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue26629.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue26629.cs @@ -1,70 +1,70 @@ namespace Maui.Controls.Sample.Issues { - [Issue(IssueTracker.Github, 26629, "ScrollView resizes when content changes", PlatformAffected.All)] - public class Issue26629 : ContentPage - { - public Issue26629() - { - var grid = new Grid - { - Margin = 40, - RowSpacing = 16, - BackgroundColor = Colors.Beige, + [Issue(IssueTracker.Github, 26629, "ScrollView resizes when content changes", PlatformAffected.All)] + public class Issue26629 : ContentPage + { + public Issue26629() + { + var grid = new Grid + { + Margin = 40, + RowSpacing = 16, + BackgroundColor = Colors.Beige, RowDefinitions = new RowDefinitionCollection( new RowDefinition(GridLength.Auto), new RowDefinition(GridLength.Auto), new RowDefinition(GridLength.Auto), new RowDefinition(GridLength.Star)), ColumnDefinitions = new ColumnDefinitionCollection(new ColumnDefinition(GridLength.Star)), - }; - var scrollView = new ScrollView { AutomationId = "TheScrollView" }; - var scrollViewVsl = new VerticalStackLayout(); - var button = new Button - { - Text = "Add Label", - AutomationId = "AddLabelButton", - }; + }; + var scrollView = new ScrollView { AutomationId = "TheScrollView" }; + var scrollViewVsl = new VerticalStackLayout(); + var button = new Button + { + Text = "Add Label", + AutomationId = "AddLabelButton", + }; - var sizeLabel = new Label - { - AutomationId = "SizeLabel", - }; - sizeLabel.SetBinding(Label.TextProperty, new Binding(nameof(View.Height), source: scrollView)); + var sizeLabel = new Label + { + AutomationId = "SizeLabel", + }; + sizeLabel.SetBinding(Label.TextProperty, new Binding(nameof(View.Height), source: scrollView)); - var scrollOffsetLabel = new Label - { - AutomationId = "ScrollOffsetLabel", - }; - scrollOffsetLabel.SetBinding(Label.TextProperty, new Binding(nameof(ScrollView.ScrollY), source: scrollView)); + var scrollOffsetLabel = new Label + { + AutomationId = "ScrollOffsetLabel", + }; + scrollOffsetLabel.SetBinding(Label.TextProperty, new Binding(nameof(ScrollView.ScrollY), source: scrollView)); - var i = 0; - scrollView.BackgroundColor = Colors.LightBlue; - scrollView.Padding = 16; - scrollView.VerticalOptions = LayoutOptions.Start; - scrollViewVsl.Children.Add(CreateLabel("Label0")); - button.Clicked += (sender, args) => - { - scrollViewVsl.Children.Add(CreateLabel($"Label{++i}")); - }; - - scrollView.Content = scrollViewVsl; - grid.Add(button, 0, 0); - grid.Add(sizeLabel, 0, 1); - grid.Add(scrollOffsetLabel, 0, 2); - grid.Add(scrollView, 0, 3); - - Content = grid; - } + var i = 0; + scrollView.BackgroundColor = Colors.LightBlue; + scrollView.Padding = 16; + scrollView.VerticalOptions = LayoutOptions.Start; + scrollViewVsl.Children.Add(CreateLabel("Label0")); + button.Clicked += (sender, args) => + { + scrollViewVsl.Children.Add(CreateLabel($"Label{++i}")); + }; - static Label CreateLabel(string automationId) - { - return new Label - { - Text = "Huge", - FontSize = 100, - BackgroundColor = Colors.SlateBlue, - AutomationId = automationId, - }; - } - } + scrollView.Content = scrollViewVsl; + grid.Add(button, 0, 0); + grid.Add(sizeLabel, 0, 1); + grid.Add(scrollOffsetLabel, 0, 2); + grid.Add(scrollView, 0, 3); + + Content = grid; + } + + static Label CreateLabel(string automationId) + { + return new Label + { + Text = "Huge", + FontSize = 100, + BackgroundColor = Colors.SlateBlue, + AutomationId = automationId, + }; + } + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue3262.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue3262.cs index 98b37254e99e..b7f245bc7828 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue3262.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue3262.cs @@ -1,9 +1,9 @@ using System.Net; using System.Text.RegularExpressions; -using Label = Microsoft.Maui.Controls.Label; -using WebView = Microsoft.Maui.Controls.WebView; using Microsoft.Maui.Controls.PlatformConfiguration; using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; +using Label = Microsoft.Maui.Controls.Label; +using WebView = Microsoft.Maui.Controls.WebView; namespace Maui.Controls.Sample.Issues { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/AddingMultipleItemsListView.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/AddingMultipleItemsListView.cs index e63aee903be1..8b3046d7706d 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/AddingMultipleItemsListView.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/AddingMultipleItemsListView.cs @@ -33,7 +33,7 @@ protected override void Init() }; addTwoJobsButton.SetBinding(Button.CommandProperty, new Binding("AddTwoCommand")); - var layout = new VerticalStackLayout() {Spacing = 10}; + var layout = new VerticalStackLayout() { Spacing = 10 }; layout.Children.Add(listView); layout.Children.Add(addOneJobButton); layout.Children.Add(addTwoJobsButton); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1342.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1342.cs index dbb3378b3916..5832bccecc5e 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1342.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1342.cs @@ -40,7 +40,7 @@ public class MainPageCode : TabbedPage { public MainPageCode() { - ToolbarItems.Add(new Microsoft.Maui.Controls.ToolbarItem() { Text = "add1" , AutomationId = "add1" }); + ToolbarItems.Add(new Microsoft.Maui.Controls.ToolbarItem() { Text = "add1", AutomationId = "add1" }); ToolbarItems.Add(new Microsoft.Maui.Controls.ToolbarItem() { Text = $"{add2}", AutomationId = add2 }); ToolbarItems.Add(new Microsoft.Maui.Controls.ToolbarItem() { Text = $"{add3}", AutomationId = add3 }); ToolbarItems.Add(new Microsoft.Maui.Controls.ToolbarItem() { Text = "reload" }); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1557.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1557.cs index 6f1597ae7941..e8e307398b46 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1557.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue1557.cs @@ -1,5 +1,5 @@ -using Microsoft.Maui.Controls; using System.Collections.ObjectModel; +using Microsoft.Maui.Controls; namespace Maui.Controls.Sample.Issues; @@ -9,11 +9,11 @@ public class Issue1557 : NavigationPage { public Issue1557() { - - var button = new Button { Text = "Bug Repro"}; + + var button = new Button { Text = "Bug Repro" }; var contentPage = new ContentPage(); contentPage.Content = button; - button.Clicked += async(sender, e) => await Navigation.PushAsync(new Issue1557Page()); + button.Clicked += async (sender, e) => await Navigation.PushAsync(new Issue1557Page()); Navigation.PushAsync(contentPage); } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2266.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2266.cs index 21b606be6708..5f1f0c63ab53 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2266.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2266.cs @@ -122,8 +122,8 @@ public FlyoutPageNavigation() var page = e.SelectedItem as NavigationPage; if (page != null) { - Detail = page; - IsPresented = false; + Detail = page; + IsPresented = false; } }; } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2993.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2993.cs index 9243d09c4177..b020de852c32 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2993.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2993.cs @@ -18,7 +18,7 @@ protected override void Init() grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Star }); grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); grid.Children.Add(new Label() { Text = "Top Text", BackgroundColor = Colors.Purple }); - var bottomLabel = new Label() { Text = "Bottom Text", AutomationId="BottomText" }; + var bottomLabel = new Label() { Text = "Bottom Text", AutomationId = "BottomText" }; Grid.SetRow(bottomLabel, 1); grid.Children.Add(bottomLabel); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3008.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3008.cs index f44bb9961742..ced5aaa2cf87 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3008.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3008.cs @@ -79,11 +79,11 @@ void ReloadListViews() GroupHeaderTemplate = new DataTemplate(typeof(MyHeaderViewCell)), ItemTemplate = new DataTemplate(() => { - Label nameLabel = new Label() { Text = "Grouped Item" , AutomationId = "GroupedItem"}; + Label nameLabel = new Label() { Text = "Grouped Item", AutomationId = "GroupedItem" }; var cell = new ViewCell { View = nameLabel, - }; + }; return cell; }), }; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3318.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3318.cs index 94e06be2ece6..8f62d1cd0eab 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3318.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3318.cs @@ -10,12 +10,13 @@ protected override void Init() var stackLayout = new StackLayout(); var list = Enumerable.Range(0, 40).Select(c => $"Item {c}").ToArray(); - var listview = new ListView { + var listview = new ListView + { ItemsSource = list, ItemTemplate = new DataTemplate(() => { var viewCell = new ViewCell(); - var itemTemplateLabel = new Label() { HeightRequest = 30}; + var itemTemplateLabel = new Label() { HeightRequest = 30 }; itemTemplateLabel.SetBinding(Label.TextProperty, new Binding(".")); itemTemplateLabel.SetBinding(Label.AutomationIdProperty, new Binding(".")); viewCell.View = itemTemplateLabel; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue4138.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue4138.cs index 5a224986a1a6..0e36bbf03f14 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue4138.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue4138.cs @@ -12,7 +12,7 @@ public class Issue4138 : TestNavigationPage { protected override void Init() { - ContentPage contentPage = new ContentPage() { Content = new Label(){ Text = "Content Page", AutomationId = "ContentPage"}}; + ContentPage contentPage = new ContentPage() { Content = new Label() { Text = "Content Page", AutomationId = "ContentPage" } }; NavigationPage.SetTitleIconImageSource(contentPage, "coffee.png"); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs index 6b96f07e49de..d541a2054737 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs @@ -33,39 +33,39 @@ protected override void Init() }); } -// static string DefaultFontFamily() -// { -// var fontFamily = ""; -// #pragma warning disable CS0618 // Type or member is obsolete -// #pragma warning disable CS0618 // Type or member is obsolete -// #pragma warning disable CS0618 // Type or member is obsolete -// #pragma warning disable CS0618 // Type or member is obsolete -// #pragma warning disable CS0612 // Type or member is obsolete -// #pragma warning disable CS0612 // Type or member is obsolete -// #pragma warning disable CS0612 // Type or member is obsolete -// #pragma warning disable CS0612 // Type or member is obsolete -// switch (Device.RuntimePlatform) -// { -// case Device.iOS: -// fontFamily = "Ionicons"; -// break; -// case Device.WinUI: -// fontFamily = "Assets/Fonts/ionicons.ttf#ionicons"; -// break; -// case Device.Android: -// default: -// fontFamily = "fonts/ionicons.ttf#"; -// break; -// } -// #pragma warning restore CS0612 // Type or member is obsolete -// #pragma warning restore CS0612 // Type or member is obsolete -// #pragma warning restore CS0612 // Type or member is obsolete -// #pragma warning restore CS0612 // Type or member is obsolete -// #pragma warning restore CS0618 // Type or member is obsolete -// #pragma warning restore CS0618 // Type or member is obsolete -// #pragma warning restore CS0618 // Type or member is obsolete -// #pragma warning restore CS0618 // Type or member is obsolete + // static string DefaultFontFamily() + // { + // var fontFamily = ""; + // #pragma warning disable CS0618 // Type or member is obsolete + // #pragma warning disable CS0618 // Type or member is obsolete + // #pragma warning disable CS0618 // Type or member is obsolete + // #pragma warning disable CS0618 // Type or member is obsolete + // #pragma warning disable CS0612 // Type or member is obsolete + // #pragma warning disable CS0612 // Type or member is obsolete + // #pragma warning disable CS0612 // Type or member is obsolete + // #pragma warning disable CS0612 // Type or member is obsolete + // switch (Device.RuntimePlatform) + // { + // case Device.iOS: + // fontFamily = "Ionicons"; + // break; + // case Device.WinUI: + // fontFamily = "Assets/Fonts/ionicons.ttf#ionicons"; + // break; + // case Device.Android: + // default: + // fontFamily = "fonts/ionicons.ttf#"; + // break; + // } + // #pragma warning restore CS0612 // Type or member is obsolete + // #pragma warning restore CS0612 // Type or member is obsolete + // #pragma warning restore CS0612 // Type or member is obsolete + // #pragma warning restore CS0612 // Type or member is obsolete + // #pragma warning restore CS0618 // Type or member is obsolete + // #pragma warning restore CS0618 // Type or member is obsolete + // #pragma warning restore CS0618 // Type or member is obsolete + // #pragma warning restore CS0618 // Type or member is obsolete -// return fontFamily; -// } + // return fontFamily; + // } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue530.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue530.cs index b9a185225fd1..cdf710567e27 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue530.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue530.cs @@ -12,7 +12,7 @@ protected override void Init() { _list = new ListView { - ItemTemplate = new DataTemplate(() => + ItemTemplate = new DataTemplate(() => { var label = new Label(); label.SetBinding(Label.TextProperty, new Binding(".")); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5503.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5503.cs index 2290f9003f99..dd15245b8b64 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5503.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5503.cs @@ -60,14 +60,14 @@ protected override void Init() listView }; - var button = new Button(){ Text = "Go To Test Page" }; + var button = new Button() { Text = "Go To Test Page" }; button.Clicked += (sender, args) => { - Navigation.PushAsync(new ContentPage(){ Content = stack }); + Navigation.PushAsync(new ContentPage() { Content = stack }); }; var content = new ContentPage() { Content = button }; - Navigation.PushAsync(content); - + Navigation.PushAsync(content); + } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5831.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5831.cs index 8fc1345a32f5..56bd79c37e4c 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5831.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5831.cs @@ -39,7 +39,7 @@ protected override void Init() var collectionViewPage = new ContentPage { Content = stackLayout, BindingContext = this }; mainFlyoutItem.Items.Add(collectionViewPage); - otherFlyoutItem.Items.Add(new ContentPage { Content = new Label { Text = "Go back to main page via the flyout",AutomationId = "Label" } }); + otherFlyoutItem.Items.Add(new ContentPage { Content = new Label { Text = "Go back to main page via the flyout", AutomationId = "Label" } }); Items.Add(new FlyoutItem { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue6784.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue6784.cs index 14bc00010bf8..7e86f42e309a 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue6784.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue6784.cs @@ -3,35 +3,35 @@ namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 6784, "ShellItem.CurrentItem is not set when selecting shell section aggregated in more tab", PlatformAffected.iOS)] public class Issue6784 : TestShell -{ - protected override void Init() - { - var shellItem = new ShellItem() - { - Title = "ShellItem" - }; +{ + protected override void Init() + { + var shellItem = new ShellItem() + { + Title = "ShellItem" + }; - Items.Add(shellItem); + Items.Add(shellItem); - for (int i = 1; i <= 10; i++) - { - AddBottomTab($"Tab {i}"); - } + for (int i = 1; i <= 10; i++) + { + AddBottomTab($"Tab {i}"); + } var contentPage11 = AddBottomTab("Tab 11"); - AddBottomTab("Tab 12"); + AddBottomTab("Tab 12"); - shellItem.PropertyChanged += (sender, e) => - { - if (e.PropertyName == CurrentItemProperty.PropertyName) - { - if (((ShellItem)sender).CurrentItem.AutomationId == "Tab 11") - { - contentPage11.Content = new Label() - { - Text = "Success" - }; - } - } - }; - } + shellItem.PropertyChanged += (sender, e) => + { + if (e.PropertyName == CurrentItemProperty.PropertyName) + { + if (((ShellItem)sender).CurrentItem.AutomationId == "Tab 11") + { + contentPage11.Content = new Label() + { + Text = "Success" + }; + } + } + }; + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue7339.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue7339.cs index 68791f59694d..beaf2b6445db 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue7339.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue7339.cs @@ -21,6 +21,6 @@ protected override void Init() }; CreateContentPage("Item2").Content = - new StackLayout() { new Frame() { Content = new Label() { Text = "FrameContent", AutomationId ="FrameContent" } } }; + new StackLayout() { new Frame() { Content = new Label() { Text = "FrameContent", AutomationId = "FrameContent" } } }; } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue8145.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue8145.cs index c82c202e4f34..9047c7532dea 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue8145.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue8145.cs @@ -3,46 +3,46 @@ namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 8145, "Shell System.ObjectDisposedException: Cannot access a disposed object. Object name: Android.Support.Design.Widget.BottomSheetDialog", PlatformAffected.Android)] public class Issue8145 : TestShell { - string _titleElement = "Connect"; - protected override void Init() - { - Title = "Shell"; - var flyoutItem = new FlyoutItem - { - Title = _titleElement - }; + string _titleElement = "Connect"; + protected override void Init() + { + Title = "Shell"; + var flyoutItem = new FlyoutItem + { + Title = _titleElement + }; - int tabCount = 8; + int tabCount = 8; #if WINDOWS || MACCATALYST tabCount = 13; // Add more tabs for desktop platforms to make the more button visible #endif - for (int i = 0; i < tabCount; i++) - { - flyoutItem.Items.Add(new Tab - { - Title = "notme", - Items = - { - new ContentPage - { - Title = "notme", - Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } - } - } - }); - } + for (int i = 0; i < tabCount; i++) + { + flyoutItem.Items.Add(new Tab + { + Title = "notme", + Items = + { + new ContentPage + { + Title = "notme", + Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } + } + } + }); + } - // Add the target tab - flyoutItem.Items.Add(new Tab - { - Title = "target", - Items = - { - new ContentPage { Title = "Target", Content = new Label { Text = "Success" } } - } - }); + // Add the target tab + flyoutItem.Items.Add(new Tab + { + Title = "target", + Items = + { + new ContentPage { Title = "Target", Content = new Label { Text = "Success" } } + } + }); - Items.Add(flyoutItem); - } + Items.Add(flyoutItem); + } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue973.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue973.cs index 621b6749ff29..66355c3babb6 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue973.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue973.cs @@ -18,7 +18,7 @@ protected override void Init() // Set FlyoutBehavior to Popover to ensure consistent behavior across desktop and mobile platforms. // Windows and Catalyst default (FlyoutLayoutBehavior.Default) uses Split mode, which differs from mobile platforms. FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; - + var cells = new[] { new PageNameObject ("Close Flyout"), new PageNameObject ("Page 1"), @@ -49,7 +49,7 @@ protected override void Init() if (cellName == "Close Flyout") { - IsPresented = false; + IsPresented = false; } else { @@ -60,7 +60,7 @@ protected override void Init() d.PresentMaster += (s, args) => { - IsPresented = true; + IsPresented = true; }; Detail = d; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ScrollToGroup.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ScrollToGroup.cs index 448cf75de2b1..890c076fb0cc 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ScrollToGroup.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ScrollToGroup.cs @@ -5,6 +5,6 @@ public class ScrollToGroup : TestNavigationPage { protected override void Init() { - PushAsync(new CollectionViewGalleries.ScrollToGalleries.ScrollToGroup()); + PushAsync(new CollectionViewGalleries.ScrollToGalleries.ScrollToGroup()); } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ShellFlyoutContentOffset.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ShellFlyoutContentOffset.cs index ae7ad3c49cc6..4483ec8e26ec 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ShellFlyoutContentOffset.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ShellFlyoutContentOffset.cs @@ -22,7 +22,7 @@ protected override void Init() ContentPage CreateContentPage() { - + // Placing a Label directly within the flyout content centers it on Windows, complicating offset testing. // Wrapping the Label in a StackLayout within the flyout content enables testing offset values on Windows. var stackLayout = new VerticalStackLayout(); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/StackLayoutIssue.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/StackLayoutIssue.cs index c4207dae5488..accc9d59dcc1 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/StackLayoutIssue.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/StackLayoutIssue.cs @@ -14,7 +14,7 @@ protected override void Init() WidthRequest = 20, HeightRequest = 20, VerticalOptions = LayoutOptions.FillAndExpand, - AutomationId="FirstImage" + AutomationId = "FirstImage" }; #pragma warning restore CS0618 // Type or member is obsolete @@ -123,7 +123,7 @@ StackLayout MakeForm() Source = "test.jpg", WidthRequest = 100, HeightRequest = 100, - AutomationId="SecondImage" + AutomationId = "SecondImage" }; var result = new StackLayout diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/TabbedPageTests.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/TabbedPageTests.cs index 3c97551fbe8d..551df99f8c3b 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/TabbedPageTests.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/TabbedPageTests.cs @@ -5,7 +5,7 @@ public class TabbedPageTests : ContentPage { public TabbedPageTests() { - var navigate = new Button() { Text = "HomePage", AutomationId="HomePage"}; + var navigate = new Button() { Text = "HomePage", AutomationId = "HomePage" }; navigate.Clicked += async (s, a) => { @@ -17,10 +17,10 @@ public TabbedPageTests() popButton2.Clicked += (s, a) => Navigation.PopModalAsync(); tabbedPage.Children.Add(new ContentPage() { Title = "Page 1", Content = popButton1 }); - tabbedPage.Children.Add(new ContentPage() { Title = "Page 2", Content = popButton2 }); - + tabbedPage.Children.Add(new ContentPage() { Title = "Page 2", Content = popButton2 }); + await Navigation.PushModalAsync(tabbedPage); - + }; this.Content = new StackLayout @@ -30,7 +30,7 @@ public TabbedPageTests() } }; - + } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Unreported1.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Unreported1.cs index 103fb906ff56..20c2ff1759e1 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Unreported1.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Unreported1.cs @@ -19,7 +19,7 @@ protected override void OnAppearing() protected override void Init() { MDP = this; - // When assgining a page getting an invalid cast exception in all platforms, so using content page here. //Issue: https://github.com/dotnet/maui/issues/21205 + // When assgining a page getting an invalid cast exception in all platforms, so using content page here. //Issue: https://github.com/dotnet/maui/issues/21205 Flyout = new ContentPage { Title = "Flyout", Content = new Label { Text = "Flyout Content" } }; Detail = new SplashPage(); } @@ -29,5 +29,5 @@ public static void SwitchDetail() MDP.Detail = new ContentPage { Content = new Label { Text = "If this did not crash, this test has passed.", AutomationId = "Label" }, Padding = 20 }; } } - + diff --git a/src/Controls/tests/TestCases.HostApp/Platforms/MacCatalyst/AppDelegate.cs b/src/Controls/tests/TestCases.HostApp/Platforms/MacCatalyst/AppDelegate.cs index 23208d785f51..05fa2ba24368 100644 --- a/src/Controls/tests/TestCases.HostApp/Platforms/MacCatalyst/AppDelegate.cs +++ b/src/Controls/tests/TestCases.HostApp/Platforms/MacCatalyst/AppDelegate.cs @@ -11,7 +11,7 @@ public class AppDelegate : MauiUIApplicationDelegate public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { - + #pragma warning disable CS0618 // Type or member is obsolete MessagingCenter.Subscribe(this, Issue5503.ChangeUITableViewAppearanceBgColor, (s) => { diff --git a/src/Controls/tests/TestCases.HostApp/Platforms/iOS/AppDelegate.cs b/src/Controls/tests/TestCases.HostApp/Platforms/iOS/AppDelegate.cs index 7341fdf188dc..e3d307552622 100644 --- a/src/Controls/tests/TestCases.HostApp/Platforms/iOS/AppDelegate.cs +++ b/src/Controls/tests/TestCases.HostApp/Platforms/iOS/AppDelegate.cs @@ -1,7 +1,7 @@ using Foundation; +using Maui.Controls.Sample.Issues; using Microsoft.Maui; using Microsoft.Maui.Hosting; -using Maui.Controls.Sample.Issues; using UIKit; namespace Maui.Controls.Sample.Platform @@ -13,7 +13,7 @@ public class AppDelegate : MauiUIApplicationDelegate public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { - + #pragma warning disable CS0618 // Type or member is obsolete MessagingCenter.Subscribe(this, Issue5503.ChangeUITableViewAppearanceBgColor, (s) => { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.HeaderAndFooter.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.HeaderAndFooter.cs index 57f875f43b23..4f5721e09b9d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.HeaderAndFooter.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.HeaderAndFooter.cs @@ -72,7 +72,7 @@ public void HeaderFooterGridWorks() VerifyScreenshot(); } - #if TEST_FAILS_ON_IOS +#if TEST_FAILS_ON_IOS // The screenshot that's currently generated for this test is wrong // So, we're ignoring this test due to it causing confusion when other changes // cause this test to fail. @@ -93,7 +93,7 @@ public void HeaderFooterGridHorizontalWorks() VerifyScreenshot(); } - #endif +#endif } #endif } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs index 08a7f32d29af..d2df546c04b7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs @@ -38,7 +38,7 @@ public VisitAndUpdateItemsSourceUITests(TestDevice device) [Category(UITestCategories.CollectionView)] [FailsOnWindowsWhenRunningOnXamarinUITest("This test is failing, likely due to product issue.")] public void VisitAndUpdateItemsSource(string collectionTestName, string subGallery, int firstItem, int lastItem) - { + { VisitInitialGallery(collectionTestName); VisitSubGallery(subGallery, !subGallery.Contains("Horizontal", StringComparison.OrdinalIgnoreCase), $"Item: {firstItem}", $"Item: {lastItem}", lastItem - 1, true, false); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30166.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30166.cs index d5e967d4b829..34bda9025fa8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30166.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30166.cs @@ -17,7 +17,7 @@ public Bugzilla30166(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Compatibility)] public void Bugzilla30166Test() { - App.WaitForElement("PushModal"); + App.WaitForElement("PushModal"); App.Tap("PushModal"); App.WaitForElement("GoBack"); App.Tap("GoBack"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30317.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30317.cs index d103e1058d0f..0b31754a6ce8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30317.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla30317.cs @@ -12,13 +12,13 @@ public class Bugzilla30317 : _IssuesUITest const string PageOne = "Set ItemSource On Appearing"; const string PageTwo = "Set ItemSource in ctor"; #else - const string PageOne = "PageOne"; - const string PageTwo = "PageTwo"; + const string PageOne = "PageOne"; + const string PageTwo = "PageTwo"; #endif -#if ANDROID - const string TabOne = "TABONECTOR"; - const string TabTwo = "TABTWOONAPPEARING"; +#if ANDROID + const string TabOne = "TABONECTOR"; + const string TabTwo = "TABTWOONAPPEARING"; #elif WINDOWS const string TabOne = "TabOneCtor"; const string TabTwo = "TabTwoOnAppearing"; @@ -45,7 +45,7 @@ public Bugzilla30317(TestDevice testDevice) : base(testDevice) protected override bool ResetAfterEachTest => true; public override string Issue => "https://bugzilla.xamarin.com/show_bug.cgi?id=30137"; - + [Test] public void Bugzilla30317ItemSourceOnAppearingContentPage() { @@ -53,11 +53,11 @@ public void Bugzilla30317ItemSourceOnAppearingContentPage() App.WaitForElement(PageOneItem1); TouchAndHold(PageOneItem1); - + App.WaitForElement(PageOneItem5); TouchAndHold(PageOneItem5); } - + [Test] public void Bugzilla30317ItemSourceCtorContentPage() { @@ -67,11 +67,11 @@ public void Bugzilla30317ItemSourceCtorContentPage() App.WaitForElement(PageTwoItem1); TouchAndHold(PageTwoItem1); - + App.WaitForElement(PageTwoItem5); TouchAndHold(PageTwoItem5); } - + [Test] public void Bugzilla30317ItemSourceTabbedPage() { @@ -79,39 +79,39 @@ public void Bugzilla30317ItemSourceTabbedPage() App.WaitForElement(PageTwoButton); App.Tap(PageTwoButton); App.WaitForElementTillPageNavigationSettled(PageTwo); - + App.WaitForElement(PageThreeButton); App.Tap(PageThreeButton); - + App.WaitForElementTillPageNavigationSettled(TabTwo); App.Tap(TabTwo); - + App.WaitForElementTillPageNavigationSettled(TabTwoItem1); TouchAndHold(TabTwoItem1); App.WaitForElement(TabTwoItem1); - + App.WaitForElement(TabTwoItem5); TouchAndHold(TabTwoItem5); App.WaitForElement(TabTwoItem5); - + App.WaitForElement(TabOne); App.Tap(TabOne); - + App.WaitForElement(TabOneItem1); TouchAndHold(TabOneItem1); App.WaitForElement(TabOneItem1); - + App.WaitForElement(TabOneItem5); TouchAndHold(TabOneItem5); App.WaitForElement(TabOneItem5); } - + void TouchAndHold(string item) { #if MACCATALYST //In Catalyst TouchAndHold is not supported. So using LongPress App.LongPress(item); #else - App.TouchAndHold(item); + App.TouchAndHold(item); #endif } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31114.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31114.cs index 08764acfc0b4..823e4cab4d75 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31114.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31114.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID // DragCoordinates not supported on Catalyst. // On IOS the cells are disapper randomly https://github.com/dotnet/maui/issues/25656, // On Android scroll positions not reseted on Android Issue: https://github.com/dotnet/maui/issues/26661. diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31333.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31333.cs index da12cc46567c..0672380c09c3 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31333.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31333.cs @@ -13,40 +13,40 @@ public Bugzilla31333(TestDevice testDevice) : base(testDevice) public override string Issue => "Focus() on Entry in ViewCell brings up keyboard, but doesn't have cursor in EditText"; - [Test] - public void Issue31333FocusEntryInListViewCell() - { - App.Tap("Focus Entry in ListView"); - App.EnterText("EntryListView", "Entry in ListView Success"); - Assert.That(App.WaitForElement("EntryListView")?.GetText(), Is.EqualTo("Entry in ListView Success")); - App.Tap("Focus Entry in ListView"); - } + [Test] + public void Issue31333FocusEntryInListViewCell() + { + App.Tap("Focus Entry in ListView"); + App.EnterText("EntryListView", "Entry in ListView Success"); + Assert.That(App.WaitForElement("EntryListView")?.GetText(), Is.EqualTo("Entry in ListView Success")); + App.Tap("Focus Entry in ListView"); + } - [Test] - public void Issue31333FocusEditorInListViewCell() - { - App.Tap("Focus Editor in ListView"); - App.EnterText("EditorListView", "Editor in ListView Success"); - Assert.That(App.WaitForElement("EditorListView")?.GetText(), Is.EqualTo("Editor in ListView Success")); - App.Tap("Focus Editor in ListView"); - } + [Test] + public void Issue31333FocusEditorInListViewCell() + { + App.Tap("Focus Editor in ListView"); + App.EnterText("EditorListView", "Editor in ListView Success"); + Assert.That(App.WaitForElement("EditorListView")?.GetText(), Is.EqualTo("Editor in ListView Success")); + App.Tap("Focus Editor in ListView"); + } - [Test] - public void Issue31333FocusEntryInTableViewCell() - { - App.Tap("Focus Entry in Table"); - App.EnterText("EntryTable", "Entry in TableView Success"); - Assert.That(App.WaitForElement("EntryTable")?.GetText(), Is.EqualTo("Entry in TableView Success")); - App.Tap("Focus Entry in Table"); - } + [Test] + public void Issue31333FocusEntryInTableViewCell() + { + App.Tap("Focus Entry in Table"); + App.EnterText("EntryTable", "Entry in TableView Success"); + Assert.That(App.WaitForElement("EntryTable")?.GetText(), Is.EqualTo("Entry in TableView Success")); + App.Tap("Focus Entry in Table"); + } #if !IOS //Once Editor text is entered the cursor move to second line when using App.EnterText method in appium which results retrived text is not as expected one. - [Test] - public void Issue31333FocusEditorInTableViewCell() - { - App.Tap("Focus Editor in Table"); - App.EnterText("EditorTable", "Editor in TableView Success"); - Assert.That(App.WaitForElement("EditorTable")?.GetText(), Is.EqualTo("Editor in TableView Success")); - App.Tap("Focus Editor in Table"); - } -#endif + [Test] + public void Issue31333FocusEditorInTableViewCell() + { + App.Tap("Focus Editor in Table"); + App.EnterText("EditorTable", "Editor in TableView Success"); + Assert.That(App.WaitForElement("EditorTable")?.GetText(), Is.EqualTo("Editor in TableView Success")); + App.Tap("Focus Editor in Table"); } +#endif +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32040.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32040.cs index 86d2ddd7d17f..fe3a39c2afc5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32040.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32040.cs @@ -16,7 +16,7 @@ public Bugzilla32040(TestDevice testDevice) : base(testDevice) [Test] [Category(UITestCategories.Cells)] public void TappedWorksForEntryAndSwithCellTest() - { + { App.WaitForElement("blahblah"); App.Tap("blahblah"); App.WaitForElement("Tapped"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32615.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32615.cs index dac9e794de2a..16ce9c179d2a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32615.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32615.cs @@ -15,7 +15,7 @@ public Bugzilla32615(TestDevice testDevice) : base(testDevice) [Test] [Category(UITestCategories.Navigation)] [Category(UITestCategories.Compatibility)] - public void Bugzilla32615Test() + public void Bugzilla32615Test() { App.Tap("open"); App.Tap("pop"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32801.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32801.cs index 33565eac9b74..fd52e8571ff7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32801.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32801.cs @@ -7,36 +7,36 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Bugzilla32801 : _IssuesUITest { #if ANDROID - const string Tab1 = "TAB 1"; + const string Tab1 = "TAB 1"; #else const string Tab1 = "Tab 1"; #endif - const string FirstTabAddButton = "FirstTabAddButton"; - const string Level2AddButton = "Level2AddButton"; - const string Level3StackButton = "Level3StackButton"; - const string SecondTabStackButton = "SecondTabStackButton"; + const string FirstTabAddButton = "FirstTabAddButton"; + const string Level2AddButton = "Level2AddButton"; + const string Level3StackButton = "Level3StackButton"; + const string SecondTabStackButton = "SecondTabStackButton"; - public Bugzilla32801(TestDevice testDevice) : base(testDevice) - { - } + public Bugzilla32801(TestDevice testDevice) : base(testDevice) + { + } - public override string Issue => "Memory Leak in TabbedPage + NavigationPage"; + public override string Issue => "Memory Leak in TabbedPage + NavigationPage"; - [Test] - [Category(UITestCategories.TabbedPage)] - public void Bugzilla32801Test() - { - App.WaitForElement(FirstTabAddButton); - App.Tap(FirstTabAddButton); - App.WaitForElementTillPageNavigationSettled(Level2AddButton); - App.Tap(Level2AddButton); - App.WaitForElementTillPageNavigationSettled(Level3StackButton); - App.Tap(Level3StackButton); - App.WaitForElement("Stack 3"); - App.Tap(Tab1); - App.WaitForElementTillPageNavigationSettled(SecondTabStackButton); - App.Tap(SecondTabStackButton); - App.WaitForElement("Stack 1"); - } + [Test] + [Category(UITestCategories.TabbedPage)] + public void Bugzilla32801Test() + { + App.WaitForElement(FirstTabAddButton); + App.Tap(FirstTabAddButton); + App.WaitForElementTillPageNavigationSettled(Level2AddButton); + App.Tap(Level2AddButton); + App.WaitForElementTillPageNavigationSettled(Level3StackButton); + App.Tap(Level3StackButton); + App.WaitForElement("Stack 3"); + App.Tap(Tab1); + App.WaitForElementTillPageNavigationSettled(SecondTabStackButton); + App.Tap(SecondTabStackButton); + App.WaitForElement("Stack 1"); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla33612.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla33612.cs index 7b8b6ae38d8a..7484621ed3aa 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla33612.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla33612.cs @@ -25,7 +25,7 @@ public void Issue33612RemovePagesWithoutRenderers() App.WaitForElement("This is Page 3"); App.WaitForElement("Return To Page 2"); App.Tap("Return To Page 2"); - + App.WaitForElement("If you are seeing this, nothing crashed."); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla34007.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla34007.cs index 415f379068b2..ca8d05ad0e58 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla34007.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla34007.cs @@ -31,12 +31,12 @@ public void Issue34007TestFirstElementHasLowestZOrder() // Tapping Button1 1 reordered the buttons in the grid; Button 0 should // now be on top. Tapping at the Button 1 location should actually tap // Button 0, and the label should indicate that - //TapCoordinates does not work on the MacCatalyst platform - #if MACCATALYST + //TapCoordinates does not work on the MacCatalyst platform +#if MACCATALYST App.ClickCoordinates(x, y); - #else +#else App.TapCoordinates(x, y); - #endif +#endif App.WaitForElement("Button 0 was tapped last"); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs index 5e3888f86d66..0b11eec5c4c0 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs @@ -19,7 +19,7 @@ public void Bugzilla36955Test() { App.WaitForElement("Button"); Assert.That(App.FindElement("Button").GetText(), Is.EqualTo("False")); - + ToggleSwitch(); Assert.That(App.FindElement("Button").GetText(), Is.EqualTo("True")); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla37841.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla37841.cs index 5e1c8f0501d9..ac942dea3d7d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla37841.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla37841.cs @@ -22,8 +22,8 @@ public void TextAndEntryCellsDataBindInTableView() App.WaitForElement(Generate); App.Tap(Generate); - App.WaitForTextToBePresentInElement(entrycell, "12345"); - App.WaitForTextToBePresentInElement(textcell, "6789"); + App.WaitForTextToBePresentInElement(entrycell, "12345"); + App.WaitForTextToBePresentInElement(textcell, "6789"); App.Tap(Generate); App.WaitForTextToBePresentInElement(entrycell, "112358"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38112.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38112.cs index 4da012aca442..b7b7a0d2faa5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38112.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38112.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS +#if TEST_FAILS_ON_WINDOWS //After Button Click removes all Items in TableView //For more information: https://github.com/dotnet/maui/issues/26699 using NUnit.Framework; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38731.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38731.cs index 38fe6dc2ce1e..0bf273c08a6d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38731.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla38731.cs @@ -16,7 +16,7 @@ public class Bugzilla38731 : _IssuesUITest const string PageTwo = "Page two"; const string PageOne = "Page one"; #endif - const string btn1 = "btn1"; + const string btn1 = "btn1"; const string btn2 = "btn2"; const string btn3 = "btn3"; @@ -26,25 +26,25 @@ public Bugzilla38731(TestDevice testDevice) : base(testDevice) public override string Issue => "iOS.NavigationRenderer.GetAppearedOrDisappearedTask NullReferenceExceptionObject"; - [Test] - [Category(UITestCategories.Navigation)] - public void Bugzilla38731Test () - { - App.WaitForElement(btn1); - App.Tap(btn1); + [Test] + [Category(UITestCategories.Navigation)] + public void Bugzilla38731Test() + { + App.WaitForElement(btn1); + App.Tap(btn1); - App.WaitForElement(btn2); - App.Tap(btn2); + App.WaitForElement(btn2); + App.Tap(btn2); - App.WaitForElement(btn3); - App.Tap(btn3); + App.WaitForElement(btn3); + App.Tap(btn3); - App.WaitForElementTillPageNavigationSettled("FinalPage"); + App.WaitForElementTillPageNavigationSettled("FinalPage"); App.TapBackArrow(PageThree); - App.WaitForElementTillPageNavigationSettled(btn3); - App.TapBackArrow(PageTwo); - App.WaitForElementTillPageNavigationSettled(btn2); - App.TapBackArrow(PageOne); + App.WaitForElementTillPageNavigationSettled(btn3); + App.TapBackArrow(PageTwo); + App.WaitForElementTillPageNavigationSettled(btn2); + App.TapBackArrow(PageOne); App.WaitForElementTillPageNavigationSettled(btn1); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39489.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39489.cs index 43d89ff3c007..20a6050cd527 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39489.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39489.cs @@ -17,7 +17,7 @@ public Bugzilla39489(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Maps)] [Category(UITestCategories.Performance)] [Category(UITestCategories.Compatibility)] - public void Bugzilla39489Test() + public void Bugzilla39489Test() { // Original bug report (https://bugzilla.xamarin.com/show_bug.cgi?id=39489) had a crash (OOM) after 25-30 // page loads. Obviously it's going to depend heavily on the device and amount of available memory, but diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39530.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39530.cs index 45ac19fee7c6..d885d9160485 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39530.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39530.cs @@ -24,11 +24,11 @@ public void Bugzilla39530PanTest() App.WaitForElement("Panning: Completed"); } - + [Test] public void Bugzilla39530PinchTest() { -//The PinchToZoomIn gesture doesn't work on the Frame for other platforms, so it should be applied to the children of the Frame instead. + //The PinchToZoomIn gesture doesn't work on the Frame for other platforms, so it should be applied to the children of the Frame instead. #if ANDROID App.PinchToZoomIn("frame"); #else @@ -46,6 +46,6 @@ public void Bugzilla39530TapTest() App.Tap("frameLabel"); App.WaitForElement("Taps: 2"); } - + } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39821.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39821.cs index fa02c8df1180..8078ee8870e7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39821.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla39821.cs @@ -17,7 +17,7 @@ public Bugzilla39821(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Compatibility)] public void DoesNotCrash() { - App.WaitForElement("Animate"); + App.WaitForElement("Animate"); App.Tap("Animate"); App.WaitForElement("Success"); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40005.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40005.cs index b22b068e77b2..65f5fed1addc 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40005.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40005.cs @@ -15,7 +15,7 @@ public Bugzilla40005(TestDevice testDevice) : base(testDevice) } public override string Issue => "Navigation Bar back button does not show when using InsertPageBefore"; - + [Test] [Category(UITestCategories.Navigation)] public void Bugzilla40005Test() @@ -28,6 +28,6 @@ public void Bugzilla40005Test() App.TapBackArrow(); App.WaitForElement("Inserted page"); } - + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40161.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40161.cs index 107999121c1e..fc698cd21e07 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40161.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40161.cs @@ -24,7 +24,7 @@ public void Issue1Test() Assert.That(App.FindElement("counter").GetText(), Is.EqualTo("step=0")); - Assert.That(App.FindElement("width").GetText(), Is.EqualTo("w=50")); + Assert.That(App.FindElement("width").GetText(), Is.EqualTo("w=50")); } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40333.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40333.cs index 3f958d672321..1e408e5c1b50 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40333.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40333.cs @@ -29,9 +29,9 @@ public void ClickingOnMenuItemInRootDoesNotCrash_NavPageVersion() App.WaitForElement(ClickThisId); App.Tap(ClickThisId); - App.WaitForElement(StillHereId); + App.WaitForElement(StillHereId); } - + [Test] public void ClickingOnMenuItemInRootDoesNotCrash_TabPageVersion() { @@ -50,10 +50,10 @@ public void ClickingOnMenuItemInRootDoesNotCrash_TabPageVersion() App.WaitForElement(ClickThisId); App.Tap(ClickThisId); - App.WaitForElement(StillHereId); + App.WaitForElement(StillHereId); } } - - - + + + diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40955.cs index a5c191fb3cbe..66f0e045ac80 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40955.cs @@ -8,9 +8,9 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Bugzilla40955 : _IssuesUITest { const string DestructorMessage = "NavigationPageEx Destructor called"; - const string LabelPage1 = "LabelOne"; - const string LabelPage2 = "LabelTwo"; - const string LabelPage3 = "LabelThree"; + const string LabelPage1 = "LabelOne"; + const string LabelPage2 = "LabelTwo"; + const string LabelPage3 = "LabelThree"; const string Page1Title = "Page1"; const string Page2Title = "Page2"; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41424.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41424.cs index 1651cb1ba8c2..48545bf6aa1d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41424.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41424.cs @@ -8,7 +8,7 @@ public class Bugzilla41424 : _IssuesUITest { #if ANDROID // Action button on TimePicker dialog is vary on different platforms. - const string DatePickerActionButton = "Cancel"; + const string DatePickerActionButton = "Cancel"; #elif IOS const string DatePickerActionButton = "Done"; #elif WINDOWS // No Action button for Windows DatePicker, so picking any date will close the dialog on windows. @@ -32,7 +32,7 @@ public Bugzilla41424(TestDevice testDevice) : base(testDevice) public void DatePickerCancelShouldUnfocus() { - App.WaitForElement(DatePicker); + App.WaitForElement(DatePicker); App.Tap(DatePicker); CloseDialog(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42074.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42074.cs index 775538b213d7..d1efe5ca678e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42074.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42074.cs @@ -9,7 +9,7 @@ public class Bugzilla42074 : _IssuesUITest { #if ANDROID // Action button on TimePicker dialog is vary on different platforms - const string TimePickerActionButton = "Cancel"; + const string TimePickerActionButton = "Cancel"; #elif IOS const string TimePickerActionButton = "Done"; #elif WINDOWS diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42956.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42956.cs index c4595c6b7869..2615f4f3ecf4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42956.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla42956.cs @@ -13,7 +13,7 @@ public Bugzilla42956(TestDevice testDevice) : base(testDevice) } public override string Issue => "ListView with DataTemplateSelector can have only 17 Templates, even with CachingStrategy=RetainElement"; - + [Test] [Category(UITestCategories.ListView)] public void Bugzilla42956Test() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43469.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43469.cs index 29583cdf142b..6aa1272e772c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43469.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43469.cs @@ -1,9 +1,9 @@ using NUnit.Framework; using UITest.Appium; using UITest.Core; - + namespace Microsoft.Maui.TestCases.Tests.Issues; - + public class Bugzilla43469 : _IssuesUITest { #if MACCATALYST @@ -11,35 +11,35 @@ public class Bugzilla43469 : _IssuesUITest #else const string CancelBtn = "Cancel"; #endif - public Bugzilla43469(TestDevice testDevice) : base(testDevice) - { - } - - public override string Issue => "Calling DisplayAlert twice in WinRT causes a crash"; - - [Test] - [Category(UITestCategories.DisplayAlert)] - public void Bugzilla43469Test() - { - App.WaitForElement("kButton"); - App.Tap("kButton"); - App.WaitForElementTillPageNavigationSettled("First"); - App.Tap(CancelBtn); - App.WaitForElementTillPageNavigationSettled("Second"); - App.Tap(CancelBtn); - App.WaitForElementTillPageNavigationSettled("Three"); - App.Tap(CancelBtn); + public Bugzilla43469(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Calling DisplayAlert twice in WinRT causes a crash"; + + [Test] + [Category(UITestCategories.DisplayAlert)] + public void Bugzilla43469Test() + { + App.WaitForElement("kButton"); + App.Tap("kButton"); + App.WaitForElementTillPageNavigationSettled("First"); + App.Tap(CancelBtn); + App.WaitForElementTillPageNavigationSettled("Second"); + App.Tap(CancelBtn); + App.WaitForElementTillPageNavigationSettled("Three"); + App.Tap(CancelBtn); #if !MACCATALYST // Test fails on Catalyst platforms because the alert box cannot be opened propely 6 times when invoke this on using BeginInvokeOnMainThread Issue: https://github.com/dotnet/maui/issues/26481 - for(int i=0; i<3; i++) + for (int i = 0; i < 3; i++) { TapCancel(CancelBtn); } #endif - App.WaitForElement("kButton"); - } - void TapCancel(string CancelBtn) - { - App.WaitForElementTillPageNavigationSettled(CancelBtn); - App.Tap(CancelBtn); - } + App.WaitForElement("kButton"); + } + void TapCancel(string CancelBtn) + { + App.WaitForElementTillPageNavigationSettled(CancelBtn); + App.Tap(CancelBtn); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43663.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43663.cs index 965857eee914..47db140ef677 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43663.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla43663.cs @@ -28,7 +28,7 @@ public void ModalNavigation() App.Tap(AlertCancelButton); App.WaitForElement("Modal"); App.Tap("Click to dismiss modal"); - App.WaitForElementTillPageNavigationSettled(AlertCancelButton); + App.WaitForElementTillPageNavigationSettled(AlertCancelButton); App.Tap(AlertCancelButton); App.WaitForElement("Click to push Modal"); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44166.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44166.cs index 69d808fe9bdd..5971ff956acf 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44166.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44166.cs @@ -29,7 +29,7 @@ public void Bugzilla44166Test() { App.Tap("GC"); - if(App.WaitForElement("Result").GetText() == "Success") + if (App.WaitForElement("Result").GetText() == "Success") { return; } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44461.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44461.cs index c10605ded0ad..7f6457b41167 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44461.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla44461.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST //When clicking Button0 (the first button) incorrectly centers it in the ScrollView instead of maintaining its left alignment. +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST //When clicking Button0 (the first button) incorrectly centers it in the ScrollView instead of maintaining its left alignment. //Issue Link: https://github.com/dotnet/maui/issues/26760 using NUnit.Framework; using NUnit.Framework.Legacy; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45743.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45743.cs index 668edb8922ed..89a196b3db52 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45743.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45743.cs @@ -1,4 +1,4 @@ -# if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID &&TEST_FAILS_ON_CATALYST +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST // DisplayActionSheet and DisplayAlert are popped up in the constructor using BeginInvokeOnMainThread which is not working on Windows, Android, and Catalyst. Issue : https://github.com/dotnet/maui/issues/26481 using NUnit.Framework; using UITest.Appium; @@ -27,4 +27,4 @@ public void Bugzilla45743Test() Assert.That(App.FindElements("Page 2").Count, Is.GreaterThan(0)); } } -# endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45926.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45926.cs index f1bf075e9625..926c909f2a25 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45926.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla45926.cs @@ -30,7 +30,7 @@ public void Issue45926Test() App.WaitForElementTillPageNavigationSettled("Second Page #1"); //Getting nullreference exception on iOS while tapping back button. so using waitforElement for back button element. -#if IOS +#if IOS App.WaitForElement("Back"); #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla47923.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla47923.cs index 0dc4571cac32..486819ad33d1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla47923.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla47923.cs @@ -1,4 +1,4 @@ -# if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // This test uses a vector image resources which applicable only for Android. +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // This test uses a vector image resources which applicable only for Android. using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -13,7 +13,7 @@ public Bugzilla47923(TestDevice testDevice) : base(testDevice) public override string Issue => "Vectors don\'t work in Images, and work badly in Buttons"; - + [Test] [Category(UITestCategories.ListView)] public void Bugzilla47923Test() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla52419.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla52419.cs index e1fc8e0c32ba..9d6a4e3358fe 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla52419.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla52419.cs @@ -24,24 +24,24 @@ public Bugzilla52419(TestDevice testDevice) : base(testDevice) public override string Issue => "[A] OnAppearing called for previous pages in a tab's navigation when switching active tabs"; - [Test] - [Category(UITestCategories.TabbedPage)] - public void Bugzilla52419Test() - { + [Test] + [Category(UITestCategories.TabbedPage)] + public void Bugzilla52419Test() + { App.WaitForElementTillPageNavigationSettled(PushNewPage); - App.Tap(PushNewPage); + App.Tap(PushNewPage); App.WaitForElementTillPageNavigationSettled(PushNewPage); - App.Tap(PushNewPage); + App.Tap(PushNewPage); App.WaitForElementTillPageNavigationSettled(PushNewPage); - App.Tap(PushNewPage); + App.Tap(PushNewPage); App.WaitForElementTillPageNavigationSettled(TabPage2); - App.Tap(TabPage2); - App.Tap(TabPage1); - App.Tap(TabPage2); - App.Tap(TabPage1); + App.Tap(TabPage2); + App.Tap(TabPage1); + App.Tap(TabPage2); + App.Tap(TabPage1); App.WaitForElement(PushNewPage); - App.TapBackArrow(BackButtonIdentifier); - App.WaitForElement(AppearanceLabel); - Assert.That(App.WaitForElement(AppearanceLabel).GetText(), Is.EqualTo("Times Appeared: 2")); - } + App.TapBackArrow(BackButtonIdentifier); + App.WaitForElement(AppearanceLabel); + Assert.That(App.WaitForElement(AppearanceLabel).GetText(), Is.EqualTo("Times Appeared: 2")); + } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla56298.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla56298.cs index 757f3783d1aa..3d837d1a30ee 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla56298.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla56298.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST // ListView.HasUnevenRows Property Changes Not Reflected in UI on Android and Windows Platforms. Issue Link: https://github.com/dotnet/maui/issues/26780 // The CI-generated image on Catalyst doesn't match expectations, seems to be uneven rows aren't working correctly. // However, the locally generated image appears to function as expected. diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla57515.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla57515.cs index 0ffb72a79e2a..3a8317b0b1bf 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla57515.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla57515.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_CATALYST //The test fails on macOS Catalyst because the PinchToZoomIn does not working. +#if TEST_FAILS_ON_CATALYST //The test fails on macOS Catalyst because the PinchToZoomIn does not working. using NUnit.Framework; using NUnit.Framework.Legacy; using UITest.Appium; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_1.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_1.cs index 0d3585e31c0e..ae93a7a38f7e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_1.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_1.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS //BoxView automation ID isn't working on the Windows platform, causing a TimeoutException. +#if TEST_FAILS_ON_WINDOWS //BoxView automation ID isn't working on the Windows platform, causing a TimeoutException. using NUnit.Framework; using UITest.Appium; using UITest.Core; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_2.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_2.cs index bd6c419b6dd0..4f3902f0ede0 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_2.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla59863_2.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS //BoxView automation ID isn't working on the Windows platform, causing a TimeoutException. +#if TEST_FAILS_ON_WINDOWS //BoxView automation ID isn't working on the Windows platform, causing a TimeoutException. using NUnit.Framework; using UITest.Appium; using UITest.Core; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla60122.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla60122.cs index 6df983471be7..8bbb3c4a9aee 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla60122.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla60122.cs @@ -12,7 +12,7 @@ public Bugzilla60122(TestDevice testDevice) : base(testDevice) public override string Issue => "LongClick on image not working"; - + const string ImageId = "60122Image"; const string Success = "Success"; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs index 8f5ba7f1856e..24ad07b900d7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs @@ -13,13 +13,13 @@ public CarouselViewAdjustPeekAreaInsets(TestDevice device) } public override string Issue => "[Bug] Java.Lang.IllegalArgumentException in CarouselView adjusting PeekAreaInsets in OnSizeAllocated using XF 5.0"; - + [Test] [Category(UITestCategories.CarouselView)] public void ChangePeekAreaInsetsInOnSizeAllocatedTest() { App.WaitForElement("CarouselId"); - } + } } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs index ea3b593f41ea..27697cb485f8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs @@ -34,7 +34,7 @@ public void AddingItemToUnviewedCollectionViewShouldNotCrash() App.Tap(Add1); App.WaitForElement(Tab2); App.Tap(Tab2); - App.WaitForElementTillPageNavigationSettled(Success); + App.WaitForElementTillPageNavigationSettled(Success); } [Test] @@ -46,6 +46,6 @@ public void AddingGroupToUnviewedGroupedCollectionViewShouldNotCrash() App.WaitForElement(Tab3); App.Tap(Tab3); App.WaitForElementTillPageNavigationSettled(Success); - } + } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs index 53c7423632a8..ce6b9b8c7340 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs @@ -6,9 +6,9 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue10222 : _IssuesUITest { - public Issue10222(TestDevice device) : base(device) - { - } + public Issue10222(TestDevice device) : base(device) + { + } public override string Issue => "[CollectionView] ObjectDisposedException if the page is closed during scrolling"; [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs index f9690d3aa1f3..a1be768d45ae 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs @@ -24,7 +24,7 @@ public void ClickingQuicklyBetweenTopTabsBreaksContent() App.Tap("AutomatedRun"); App.WaitForElement("Success"); App.Tap("AutomatedRun"); - App.WaitForElement("Success"); + App.WaitForElement("Success"); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs index 083e3f7fa705..6303331b0281 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs @@ -10,8 +10,8 @@ public class Issue13476 : _IssuesUITest public Issue13476(TestDevice testDevice) : base(testDevice) { } -#if ANDROID - const string Page = "PAGE 1"; +#if ANDROID + const string Page = "PAGE 1"; #else const string Page = "page 1"; #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue14587.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue14587.cs index d290bd8e4515..cc8a98be3cbc 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue14587.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue14587.cs @@ -19,10 +19,10 @@ public void ImageDoesNotDisappearWhenSwitchingTab() App.Tap("Icon3"); App.Tap("Icon1"); App.Tap("ToTab2"); - + App.WaitForElement("ToTab1"); App.Tap("ToTab1"); - + App.WaitForElement("Icon1"); VerifyScreenshot(); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17123.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17123.cs index 4579fef50257..6581f5385902 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17123.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17123.cs @@ -4,18 +4,18 @@ namespace Microsoft.Maui.TestCases.Tests.Issues { - public class Issue17123 : _IssuesUITest + public class Issue17123 : _IssuesUITest { - public override string Issue => "TableSection and TableRoot Title properties are displayed as lower case"; + public override string Issue => "TableSection and TableRoot Title properties are displayed as lower case"; - public Issue17123(TestDevice device) : base(device) - { - } + public Issue17123(TestDevice device) : base(device) + { + } - [Test] + [Test] [Category(UITestCategories.TableView)] public void ValidateTableViewTitles() - { + { App.WaitForElement("TableView"); var tableViewRootText = App.FindElement("TableRootLabel").GetText(); if (string.IsNullOrEmpty(tableViewRootText)) @@ -39,5 +39,5 @@ public void ValidateTableViewTitles() VerifyScreenshot(); } - } + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17453.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17453.cs index 3cd958963d93..3325525e1c87 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17453.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17453.cs @@ -82,7 +82,7 @@ public async Task EntryWithMarginClearButtonWorks() // Set focus App.TapCoordinates(entryRect.Width, entryRect.Y); await Task.Delay(500); - + // Tap Clear Button App.TapCoordinates(entryRect.Width, entryRect.Y); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20903.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20903.cs index c430654f59a0..31e99c32f287 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20903.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20903.cs @@ -11,7 +11,7 @@ public Issue20903(TestDevice device) : base(device) { } public override string Issue => "Double-tap behavior should work correctly when adding a new double-tap handler"; -// [Test] + // [Test] [Category(UITestCategories.Gestures)] public async Task RegisterTwoDoubleTapHandlersAndCheckNumberOfFiredEventsAsync() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21109.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21109.cs index 20abd14fc72b..ca6a846ba9b1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21109.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21109.cs @@ -12,7 +12,7 @@ public Issue21109(TestDevice device) : base(device) { } public override string Issue => "[Android] MAUI 8.0.3 -> 8.0.6 regression: custom handler with key listener no longer works"; - [Test,Order(1)] + [Test, Order(1)] [Category(UITestCategories.Entry)] public void VerifyInitialEntryReturnTypeChange() { @@ -22,7 +22,7 @@ public void VerifyInitialEntryReturnTypeChange() VerifyScreenshot(); } - [Test,Order(2)] + [Test, Order(2)] [Category(UITestCategories.Entry)] public void VerifyDynamicEntryReturnTypeChange() { @@ -30,7 +30,7 @@ public void VerifyDynamicEntryReturnTypeChange() // Verify that ReturnType works as expected. if (App.IsKeyboardShown()) - App.DismissKeyboard(); + App.DismissKeyboard(); var returnType1 = App.FindElement("ReturnTypeResult").GetText(); App.Tap("ReturnTypeEntry"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24670.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24670.cs index b1ec4b28383e..c674fe31677c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24670.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24670.cs @@ -23,7 +23,7 @@ public void SearchHandlerFocusAndUnfocusEventsShouldWork() // Click the entry below to trigger the unfocused event App.Click("entry"); - + var focusedLabelText = App.WaitForElement("focusedLabel").GetText(); var unfocusedLabelText = App.WaitForElement("unfocusedLabel").GetText(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs index c84bc1dcfb42..cb31d8eac551 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs @@ -4,20 +4,20 @@ namespace Microsoft.Maui.TestCases.Tests.Issues { - public class Issue25192 : _IssuesUITest - { - public Issue25192(TestDevice testDevice) : base(testDevice) - { - } + public class Issue25192 : _IssuesUITest + { + public Issue25192(TestDevice testDevice) : base(testDevice) + { + } - public override string Issue => "CarouselView Loop='False' renders incorrectly items"; + public override string Issue => "CarouselView Loop='False' renders incorrectly items"; - [Test] - [Category(UITestCategories.CarouselView)] - public void CarouselViewShouldRenderCorrectly() - { - App.WaitForElement("Item1"); - VerifyScreenshot(); - } - } + [Test] + [Category(UITestCategories.CarouselView)] + public void CarouselViewShouldRenderCorrectly() + { + App.WaitForElement("Item1"); + VerifyScreenshot(); + } + } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25436.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25436.cs index 87ad0a5a3245..6a67db8ea197 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25436.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25436.cs @@ -4,7 +4,7 @@ namespace Microsoft.Maui.TestCases.Tests.Issues { - internal class Issue25436 : _IssuesUITest + internal class Issue25436 : _IssuesUITest { public override string Issue => "[.NET 9] Shell Flyout menu not rendering after navigating from a MenuItem page"; @@ -21,6 +21,6 @@ public void FlyoutMenuShouldNotDisappearWhenNavigateUsingServices() App.TapShellFlyoutIcon(); VerifyScreenshot(); } - + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25551.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25551.cs index 529fb7efb12c..ed990f27463a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25551.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25551.cs @@ -3,8 +3,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using NUnit.Framework.Legacy; using NUnit.Framework; +using NUnit.Framework.Legacy; using UITest.Appium; using UITest.Core; @@ -20,7 +20,7 @@ public Issue25551(TestDevice device) : base(device) [Test] [Category(UITestCategories.CollectionView)] - + public void CollectionViewPreSelectionShouldUpdate() { App.WaitForElement("SingleSelection"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25829.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25829.cs index d8c799306562..8fd90abcd3dc 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25829.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25829.cs @@ -1,7 +1,7 @@ -using NUnit.Framework; +using System.Threading.Tasks; +using NUnit.Framework; using UITest.Appium; using UITest.Core; -using System.Threading.Tasks; namespace Microsoft.Maui.TestCases.Tests.Issues { public class Issue25829 : _IssuesUITest diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26066.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26066.cs index f79b234b9358..a6742d6ecc8e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26066.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26066.cs @@ -8,16 +8,16 @@ public class Issue26066(TestDevice testDevice) : _IssuesUITest(testDevice) { public override string Issue => "CollectionViewHandler2 RelativeSource binding to AncestorType not working"; - [Test] - [Category(UITestCategories.CollectionView)] - public void CollectionView2ShouldFindAncestorType() - { - var text = "CV2"; - var i = 1; - var automationId = $"{text} - Item {i}".Replace(" ", "", StringComparison.Ordinal); - App.WaitForElement(automationId); - App.Click(automationId); - App.WaitForElement("OK"); - App.Click("OK"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void CollectionView2ShouldFindAncestorType() + { + var text = "CV2"; + var i = 1; + var automationId = $"{text} - Item {i}".Replace(" ", "", StringComparison.Ordinal); + App.WaitForElement(automationId); + App.Click(automationId); + App.WaitForElement("OK"); + App.Click("OK"); + } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27542.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27542.cs index a7a5910ad746..af46820058a5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27542.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27542.cs @@ -19,7 +19,7 @@ public void UpdatedBackButtonTitleForEmptyString() { App.WaitForElement("GotoPage2"); App.Tap("GotoPage2"); - VerifyScreenshot(); + VerifyScreenshot(); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5669.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5669.cs index bdf8ca9b5022..093d440ffafe 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5669.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5669.cs @@ -19,8 +19,8 @@ public void SearchBarMaxLength() App.EnterText("SearchBar", "r"); App.Click("ChangeValue"); App.EnterText("SearchBar", "r"); - App.EnterText("SearchBar", "c"); -#if MACCATALYST + App.EnterText("SearchBar", "c"); +#if MACCATALYST // On MacCatalyst, pressing the ESC key during screenshot capture clears the text. // This causes the image generated in CI to differ from local runs. Assert.That(App.WaitForElement("Sear").GetText(), Is.EqualTo("Sear")); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs index dfce7767f0af..8028fa583a2a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs @@ -13,7 +13,7 @@ public Issue8529(TestDevice testDevice) : base(testDevice) } public override string Issue => "[Bug] [Shell] iOS - BackButtonBehavior Command property binding throws InvalidCastException when using a custom command class that implements ICommand"; - + [Test] [Category(UITestCategories.Shell)] public void Issue8529ShellBackButtonBehaviorCommandPropertyCanUseICommand() @@ -22,7 +22,7 @@ public void Issue8529ShellBackButtonBehaviorCommandPropertyCanUseICommand() App.WaitForElement(ButtonId, "Timed out waiting for first page."); App.Tap(ButtonId); App.WaitForElement("LabelId", "Timed out waiting for the destination page."); - App.TapBackArrow("BackButtonImage"); + App.TapBackArrow("BackButtonImage"); App.WaitForElement(ButtonId, "Timed out waiting to navigate back to the first page."); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs index 0cc8c94eacc5..3cbb2b52ae54 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs @@ -13,7 +13,7 @@ public class Issue9794 : _IssuesUITest #else const string BackButtonIdentifier = "tab1"; #endif - const string tab1 = "tab1"; + const string tab1 = "tab1"; const string tab2 = "tab2"; const string GoForward = "GoForward"; @@ -22,7 +22,7 @@ public Issue9794(TestDevice testDevice) : base(testDevice) } public override string Issue => "[iOS] Tabbar Disappears with linker"; - + [Test] [Category(UITestCategories.Shell)] public void EnsureTabBarStaysVisibleAfterPoppingPage() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/AddingMultipleItemsListView.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/AddingMultipleItemsListView.cs index e58c5eda5a69..414f52a5096a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/AddingMultipleItemsListView.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/AddingMultipleItemsListView.cs @@ -8,44 +8,44 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class AddingMultipleItemsListView : _IssuesUITest { - public AddingMultipleItemsListView(TestDevice testDevice) : base(testDevice) - { - } - - public override string Issue => "Adding Multiple Items to a ListView"; - - [Test] - public void AddingMultipleListViewTests1AllElementsPresent() - { - App.WaitForElement("Big Job"); - App.FindElement("Smaller Job"); - App.FindElement("Add On Job"); - App.FindElement("Add One"); - App.FindElement("Add Two"); - App.FindElement("3672"); - App.FindElement("6289"); - App.FindElement("3672-41"); - App.FindElement("2"); - App.FindElement("2"); - App.FindElement("23"); - } - - [Test] - public void AddingMultipleListViewTests2AddOneElementToList() - { - App.WaitForElement("Add One"); - App.Tap("Add One"); - - App.WaitForElement("1234", timeout: TimeSpan.FromSeconds(2)); - } - - [Test] - public void AddingMultipleListViewTests3AddTwoElementToList() - { - App.WaitForElement("Add Two"); - App.Tap("Add Two"); - - App.WaitForElement("9999", timeout: TimeSpan.FromSeconds(2)); - App.FindElement("8888"); - } + public AddingMultipleItemsListView(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Adding Multiple Items to a ListView"; + + [Test] + public void AddingMultipleListViewTests1AllElementsPresent() + { + App.WaitForElement("Big Job"); + App.FindElement("Smaller Job"); + App.FindElement("Add On Job"); + App.FindElement("Add One"); + App.FindElement("Add Two"); + App.FindElement("3672"); + App.FindElement("6289"); + App.FindElement("3672-41"); + App.FindElement("2"); + App.FindElement("2"); + App.FindElement("23"); + } + + [Test] + public void AddingMultipleListViewTests2AddOneElementToList() + { + App.WaitForElement("Add One"); + App.Tap("Add One"); + + App.WaitForElement("1234", timeout: TimeSpan.FromSeconds(2)); + } + + [Test] + public void AddingMultipleListViewTests3AddTwoElementToList() + { + App.WaitForElement("Add Two"); + App.Tap("Add Two"); + + App.WaitForElement("9999", timeout: TimeSpan.FromSeconds(2)); + App.FindElement("8888"); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/FlyoutBehaviorShell.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/FlyoutBehaviorShell.cs index 25752f4b7300..daf1911d1cac 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/FlyoutBehaviorShell.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/FlyoutBehaviorShell.cs @@ -20,8 +20,8 @@ public FlyoutBehaviorShell(TestDevice testDevice) : base(testDevice) public override string Issue => "Shell Flyout Behavior"; -// [Test] -// [Category(UITestCategories.Shell)] + // [Test] + // [Category(UITestCategories.Shell)] public void FlyoutTests() { // Flyout is visible @@ -61,7 +61,7 @@ public void FlyoutTests() App.Tap(FlyoutItem); #if !IOS && !MACCATALYST // When DisableFlyoutBehavior is set, flyout items become inaccessible via inspection tools, leading to timeout exceptions on both iOS and Catalyst. - + // make sure you can still open flyout via code if flyout behavior is disabled App.Tap(DisableFlyoutBehavior); App.Tap(EnableBackButtonBehavior); @@ -87,7 +87,7 @@ public void WhenFlyoutIsLockedButtonsAreStillVisible() App.WaitForElement(EnableBackButtonBehavior); App.Tap(EnableBackButtonBehavior); App.Tap(LockFlyoutBehavior); - App.WaitForElement(title,"Flyout Locked hiding content"); + App.WaitForElement(title, "Flyout Locked hiding content"); App.Tap(EnableFlyoutBehavior); App.WaitForNoElement(FlyoutItem); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/HeaderFooterShellFlyout.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/HeaderFooterShellFlyout.cs index f2ac8b22de95..1dd8dac3078a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/HeaderFooterShellFlyout.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/HeaderFooterShellFlyout.cs @@ -8,8 +8,8 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class HeaderFooterShellFlyout : _IssuesUITest { - //MenuItems AutomationId fails on Windows due to navViewItem replacements with native controls, - //and, text-based IDs are ineffective on iOS. Conditional compilation is used to ensure tests run on all platforms. + //MenuItems AutomationId fails on Windows due to navViewItem replacements with native controls, + //and, text-based IDs are ineffective on iOS. Conditional compilation is used to ensure tests run on all platforms. #if WINDOWS const string ToggleHeaderFooter = "Toggle Header/Footer View"; const string ToggleHeaderFooterTemplate = "Toggle Header/Footer Template"; @@ -20,11 +20,11 @@ public class HeaderFooterShellFlyout : _IssuesUITest const string ResizeHeaderFooter = "ResizeHeaderFooter"; #endif - public HeaderFooterShellFlyout(TestDevice testDevice) : base(testDevice) - { - } + public HeaderFooterShellFlyout(TestDevice testDevice) : base(testDevice) + { + } - public override string Issue => "Shell Flyout Header Footer"; + public override string Issue => "Shell Flyout Header Footer"; #if IOS [Test] @@ -36,56 +36,56 @@ public void FlyoutHeaderWithZeroMarginShouldHaveNoY() } #endif - [Test] - public void AFlyoutTests() - { - App.WaitForElement("PageLoaded"); - App.Tap(ToggleHeaderFooter); - App.WaitForElement("Header"); - App.WaitForElement("Footer"); - - // Verify Template takes priority over header footer - App.Tap(ToggleHeaderFooterTemplate); - App.WaitForElement("Header Template"); - App.WaitForElement("Footer Template"); - App.WaitForNoElement("Header"); - App.WaitForNoElement("Footer"); - - // Verify turning off Template shows Views again - App.Tap(ToggleHeaderFooterTemplate); - App.WaitForElement("Header"); - App.WaitForElement("Footer"); - App.WaitForNoElement("Header Template"); - App.WaitForNoElement("Footer Template"); - - // Verify turning off header/footer clear out views correctly - App.Tap(ToggleHeaderFooter); - App.WaitForNoElement("Header Template"); - App.WaitForNoElement("Footer Template"); - App.WaitForNoElement("Header"); - App.WaitForNoElement("Footer"); - - // verify header and footer react to size changes - // These tests are ignored on iOS and Catalyst because the header height doesn't update correctly. Refer to issue: https://github.com/dotnet/maui/issues/26397 - // On Windows, the stack layout's AutomationId isn't behaving as expected, so the Y position of the first flyout item is used to verify header and footer sizes. + [Test] + public void AFlyoutTests() + { + App.WaitForElement("PageLoaded"); + App.Tap(ToggleHeaderFooter); + App.WaitForElement("Header"); + App.WaitForElement("Footer"); + + // Verify Template takes priority over header footer + App.Tap(ToggleHeaderFooterTemplate); + App.WaitForElement("Header Template"); + App.WaitForElement("Footer Template"); + App.WaitForNoElement("Header"); + App.WaitForNoElement("Footer"); + + // Verify turning off Template shows Views again + App.Tap(ToggleHeaderFooterTemplate); + App.WaitForElement("Header"); + App.WaitForElement("Footer"); + App.WaitForNoElement("Header Template"); + App.WaitForNoElement("Footer Template"); + + // Verify turning off header/footer clear out views correctly + App.Tap(ToggleHeaderFooter); + App.WaitForNoElement("Header Template"); + App.WaitForNoElement("Footer Template"); + App.WaitForNoElement("Header"); + App.WaitForNoElement("Footer"); + + // verify header and footer react to size changes + // These tests are ignored on iOS and Catalyst because the header height doesn't update correctly. Refer to issue: https://github.com/dotnet/maui/issues/26397 + // On Windows, the stack layout's AutomationId isn't behaving as expected, so the Y position of the first flyout item is used to verify header and footer sizes. #if ANDROID - App.Tap(ResizeHeaderFooter); - var headerSizeSmall = App.WaitForElement("HeaderView").GetRect(); - var footerSizeSmall = App.WaitForElement("FooterView").GetRect(); + App.Tap(ResizeHeaderFooter); + var headerSizeSmall = App.WaitForElement("HeaderView").GetRect(); + var footerSizeSmall = App.WaitForElement("FooterView").GetRect(); - App.Tap(ResizeHeaderFooter); - var headerSizeLarge = App.WaitForElement("HeaderView").GetRect(); - var footerSizeLarge = App.WaitForElement("FooterView").GetRect(); + App.Tap(ResizeHeaderFooter); + var headerSizeLarge = App.WaitForElement("HeaderView").GetRect(); + var footerSizeLarge = App.WaitForElement("FooterView").GetRect(); - App.Tap(ResizeHeaderFooter); - var headerSizeSmall2 = App.WaitForElement("HeaderView").GetRect(); - var footerSizeSmall2 = App.WaitForElement("FooterView").GetRect(); + App.Tap(ResizeHeaderFooter); + var headerSizeSmall2 = App.WaitForElement("HeaderView").GetRect(); + var footerSizeSmall2 = App.WaitForElement("FooterView").GetRect(); - Assert.That(headerSizeLarge.Height, Is.GreaterThan(headerSizeSmall.Height)); - Assert.That(footerSizeLarge.Height, Is.GreaterThan(footerSizeSmall.Height)); - Assert.That(headerSizeSmall2.Height, Is.EqualTo(headerSizeSmall.Height)); - Assert.That(footerSizeSmall2.Height, Is.EqualTo(footerSizeSmall.Height)); + Assert.That(headerSizeLarge.Height, Is.GreaterThan(headerSizeSmall.Height)); + Assert.That(footerSizeLarge.Height, Is.GreaterThan(footerSizeSmall.Height)); + Assert.That(headerSizeSmall2.Height, Is.EqualTo(headerSizeSmall.Height)); + Assert.That(footerSizeSmall2.Height, Is.EqualTo(footerSizeSmall.Height)); #elif WINDOWS @@ -107,5 +107,5 @@ public void AFlyoutTests() Assert.That(headerSizeSmall2.Y, Is.EqualTo(headerSizeSmall.Y)); Assert.That(footerSizeSmall2.Y, Is.EqualTo(footerSizeSmall.Y)); #endif - } + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10134.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10134.cs index 1873b5c83c6e..ad8cf1e1e09d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10134.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10134.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID // DragCoordinates is not supported on MacCatalyst // On Windows this test case is not valid due to the tob tabs are visbile in drop-down. // On Android FindElements are not working as expected in Appium. It always returns 0 elements. diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1028.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1028.cs index d423fa96f86d..00f2c5bbe88b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1028.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1028.cs @@ -12,11 +12,11 @@ public Issue1028(TestDevice testDevice) : base(testDevice) public override string Issue => "ViewCell in TableView raises exception - root page is ContentPage, Content is TableView"; - [Test] - [Category(UITestCategories.TableView)] - public void ViewCellInTableViewDoesNotCrash() - { - // If we can see this element, then we didn't crash. - App.WaitForElement("Custom Slider View:"); - } + [Test] + [Category(UITestCategories.TableView)] + public void ViewCellInTableViewDoesNotCrash() + { + // If we can see this element, then we didn't crash. + App.WaitForElement("Custom Slider View:"); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs index e82e1a35915b..0b87e51b1fa9 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs @@ -27,7 +27,7 @@ public Issue10608(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Shell)] public void ShellWithTopTabsFreezesWhenNavigatingFlyoutItems() { - App.Tap(FlyoutItem6); + App.Tap(FlyoutItem6); App.Tap("FlyoutItem0"); for (int i = 0; i < 5; i++) { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11381.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11381.cs index 2319ccb1414b..dc65093049bd 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11381.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11381.cs @@ -25,7 +25,7 @@ public void Issue11381RemoveListViewGroups() App.Tap("G1I2"); App.Tap("G1I1"); App.WaitForElement("ResultId"); - Assert.That("0 groups",Is.EqualTo( App.WaitForElement("ResultId").ReadText())); + Assert.That("0 groups", Is.EqualTo(App.WaitForElement("ResultId").ReadText())); } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11523.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11523.cs index 4e2cfc3e89da..2cf54128d5a7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11523.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11523.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // This test is skipped on iOS and Catalyst due to potential flakiness. // In the sample uses a delay which can cause the test to fail randomly. // To maintain test reliability, we exclude this test on these platforms. diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11869.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11869.cs index 0e10c2eded80..ea91fa2564e5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11869.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue11869.cs @@ -8,7 +8,7 @@ public class Issue11869 : _IssuesUITest { // In Android the top tab title was displayed with uppercase so we need to use uppercase string to find the element -#if ANDROID +#if ANDROID const string TopTab2 = "TOPTAB2"; const string TopTab3 = "TOPTAB3"; @@ -16,7 +16,7 @@ public class Issue11869 : _IssuesUITest const string TopTab2 = "TopTab2"; const string TopTab3 = "TopTab3"; #endif - const string HideTop2 = "HideTop2"; + const string HideTop2 = "HideTop2"; const string HideTop3 = "HideTop3"; const string HideBottom2 = "HideBottom2"; const string HideBottom3 = "HideBottom3"; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12126.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12126.cs index 0eb17c731cfd..57264e08389c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12126.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12126.cs @@ -12,7 +12,7 @@ public Issue12126(TestDevice testDevice) : base(testDevice) public override string Issue => "[iOS] TabBarIsVisible = True/False breaking for multiple nested pages"; - + [Test] [Category(UITestCategories.Shell)] public void NavigatingBackFromMultiplePushPagesChangesTabVisibilityCorrectly() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12429.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12429.cs index 0d37b4827254..0e880c316018 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12429.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12429.cs @@ -20,12 +20,12 @@ public Issue12429(TestDevice testDevice) : base(testDevice) #if ANDROID || IOS // Rect value measurements from Appium vary across platforms; these values ensure consistent behavior double SmallFlyoutItemValue = 35d; - double SizeToModifyBy=20d; + double SizeToModifyBy = 20d; #elif MACCATALYST double SmallFlyoutItemValue=28d; double SizeToModifyBy=15d; #endif - const string ResizeMe = "Default Flyout Item. Height is 44 on iOS and UWP. Height is 50 on Android)"; + const string ResizeMe = "Default Flyout Item. Height is 44 on iOS and UWP. Height is 50 on Android)"; @@ -41,25 +41,25 @@ public void FlyoutItemSizesToExplicitHeight() Assert.That(height.Height, Is.EqualTo(SmallFlyoutItemValue).Within(1)); } - [Test, Order(2)] - [Category(UITestCategories.Shell)] - public void FlyoutItemHeightAndWidthIncreaseAndDecreaseCorrectly() - { - App.WaitForElement(ResizeMe); - var initialHeight = App.WaitForElement(ResizeMe).GetRect().Y; - - App.Tap("ResizeFlyoutItem"); - var newHeight = App.WaitForElement(ResizeMe).GetRect().Y; - Assert.That(newHeight - initialHeight, Is.EqualTo(SizeToModifyBy).Within(1)); - - App.Tap("ResizeFlyoutItemDown"); - newHeight = App.WaitForElement(ResizeMe).GetRect().Y; - Assert.That(initialHeight, Is.EqualTo(newHeight).Within(1)); - - App.Tap("ResizeFlyoutItemDown"); - newHeight = App.WaitForElement(ResizeMe).GetRect().Y; - Assert.That(initialHeight - newHeight, Is.EqualTo(SizeToModifyBy).Within(1)); - - } + [Test, Order(2)] + [Category(UITestCategories.Shell)] + public void FlyoutItemHeightAndWidthIncreaseAndDecreaseCorrectly() + { + App.WaitForElement(ResizeMe); + var initialHeight = App.WaitForElement(ResizeMe).GetRect().Y; + + App.Tap("ResizeFlyoutItem"); + var newHeight = App.WaitForElement(ResizeMe).GetRect().Y; + Assert.That(newHeight - initialHeight, Is.EqualTo(SizeToModifyBy).Within(1)); + + App.Tap("ResizeFlyoutItemDown"); + newHeight = App.WaitForElement(ResizeMe).GetRect().Y; + Assert.That(initialHeight, Is.EqualTo(newHeight).Within(1)); + + App.Tap("ResizeFlyoutItemDown"); + newHeight = App.WaitForElement(ResizeMe).GetRect().Y; + Assert.That(initialHeight - newHeight, Is.EqualTo(SizeToModifyBy).Within(1)); + + } } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12652.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12652.cs index e63abff29e16..84ad75953044 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12652.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue12652.cs @@ -7,40 +7,40 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue12652 : _IssuesUITest { #if ANDROID - const string Top3 = "TOP 3"; + const string Top3 = "TOP 3"; #else const string Top3 = "Top 3"; #endif - public Issue12652(TestDevice testDevice) : base(testDevice) - { - } - - public override string Issue => "[Bug] NullReferenceException in the Shell on UWP when navigating back to Shell Section with multiple content items"; - - [Test] - [Category(UITestCategories.Shell)] - public void NavigatingBackToAlreadySelectedTopTabDoesntCrash() - { - // On the Windows platform, there is a dropdown menu that has to be accessed to view the "TopTab" choices. - // The "navViewItem" tap emulates user actions to open the dropdown and display the TopTab for navigation. + public Issue12652(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] NullReferenceException in the Shell on UWP when navigating back to Shell Section with multiple content items"; + + [Test] + [Category(UITestCategories.Shell)] + public void NavigatingBackToAlreadySelectedTopTabDoesntCrash() + { + // On the Windows platform, there is a dropdown menu that has to be accessed to view the "TopTab" choices. + // The "navViewItem" tap emulates user actions to open the dropdown and display the TopTab for navigation. #if WINDOWS App.Tap("navViewItem"); #endif - App.Tap(Top3); - App.WaitForElement("TopTabPage3"); - App.Tap("Main 2"); - App.WaitForElement("TopTabPage2"); - App.Tap("Main 1"); - App.WaitForElement("TopTabPage3"); - - // Once the actions are completed, the dropdown is closed to restore the original view. - // Tapping at coordinates (50, 50) simulates a click outside the dropdown, triggering it to close. + App.Tap(Top3); + App.WaitForElement("TopTabPage3"); + App.Tap("Main 2"); + App.WaitForElement("TopTabPage2"); + App.Tap("Main 1"); + App.WaitForElement("TopTabPage3"); + + // Once the actions are completed, the dropdown is closed to restore the original view. + // Tapping at coordinates (50, 50) simulates a click outside the dropdown, triggering it to close. #if WINDOWS App.TapCoordinates(50, 50); #endif App.Tap("Main 2"); - App.WaitForElement("TopTabPage2"); - App.Tap("Main 1"); - App.WaitForElement("TopTabPage3"); - } + App.WaitForElement("TopTabPage2"); + App.Tap("Main 1"); + App.WaitForElement("TopTabPage3"); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1414.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1414.cs index b61bfeb0d769..01eddd11a4c8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1414.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1414.cs @@ -19,9 +19,9 @@ public void InvalidCastExceptionWhenScrollingAndRefreshingTableView() { App.WaitForElement("TableView"); App.ScrollDown("TableView", ScrollStrategy.Gesture, 1.0, 50); - App.WaitForAnyElement(["Cell 4-24","Cell 0-24"]); + App.WaitForAnyElement(["Cell 4-24", "Cell 0-24"]); App.ScrollUp("TableView", ScrollStrategy.Gesture, 1.0, 30); - App.WaitForAnyElement(["Cell 0-0","Cell 3-24"]); + App.WaitForAnyElement(["Cell 0-0", "Cell 3-24"]); } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue15565.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue15565.cs index 8bea4badf204..ad37ec11ef65 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue15565.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue15565.cs @@ -30,13 +30,13 @@ public void TitleViewHeightIsNotZero() #if WINDOWS // In Windows the Page 1 items are inside the root navViewItem which shows in popup, so we need to tap it once to make them visible.. App.Tap("navViewItem"); #endif - var titleView = App.WaitForElement("title 1").GetRect(); - var topTab = App.WaitForElement(Page1).GetRect(); - - var titleViewBottom = titleView.Y + titleView.Height; - var topTabTop = topTab.Y; - - Assert.That(topTabTop, Is.GreaterThanOrEqualTo(titleViewBottom), "Title View is incorrectly positioned in iOS 16"); + var titleView = App.WaitForElement("title 1").GetRect(); + var topTab = App.WaitForElement(Page1).GetRect(); + + var titleViewBottom = titleView.Y + titleView.Height; + var topTabTop = topTab.Y; + + Assert.That(topTabTop, Is.GreaterThanOrEqualTo(titleViewBottom), "Title View is incorrectly positioned in iOS 16"); } @@ -51,7 +51,7 @@ public void ToolbarItemsWithTitleViewAreRendering() public void NoDuplicateTitleViews() { App.WaitForElement("title 1"); - ValidateElementsCount("title 1"); + ValidateElementsCount("title 1"); TapTopTab(Page1); TapTopTab(Page2); TapTopTab(Page3); @@ -63,7 +63,7 @@ void TapTopTab(string tab) #if WINDOWS App.Tap("navViewItem"); #endif - App.Tap(tab); + App.Tap(tab); } void ValidateElementsCount(string element) { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1614.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1614.cs index 1801b25f5ef4..8d911efb8e74 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1614.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1614.cs @@ -18,12 +18,12 @@ public Issue1614(TestDevice testDevice) : base(testDevice) } public override string Issue => "iOS 11 prevents InputAccessoryView from showing in landscape mode"; - + [Test] [Category(UITestCategories.Picker)] public void Issue1614Test() { - TapPicker("Picker"); + TapPicker("Picker"); TapPicker("DatePicker"); TapPicker("TimePicker"); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1704.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1704.cs index 6f2bf3b8fe5e..bd89fd2d2484 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1704.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1704.cs @@ -6,11 +6,11 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue1704 : _IssuesUITest { - #if ANDROID - const string OnLoad="ON LOAD"; - const string OnStart ="ON START"; - const string Source="SOURCE"; - const string Misc="MISC"; +#if ANDROID + const string OnLoad = "ON LOAD"; + const string OnStart = "ON START"; + const string Source = "SOURCE"; + const string Misc = "MISC"; #else const string OnLoad="On Load"; const string OnStart ="On Start"; @@ -32,13 +32,13 @@ public void Issue1704Test() App.FindElement(OnStart); App.FindElement(Source); App.FindElement(Misc); - + App.Tap(OnLoad); App.Tap(OnStart); App.WaitForElement("Start Animation"); App.Tap("Start Animation"); App.Tap("Stop Animation"); - + App.Tap(Misc); App.WaitForElement("Start Animation"); App.Tap("Start Animation"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue198.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue198.cs index e825a160c7ac..211f0f6691e7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue198.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue198.cs @@ -25,18 +25,18 @@ public void Issue198TestsNREWithPopModal() { App.WaitForElement(PageOne); App.WaitForElement("Leave"); - + App.Tap("Leave"); // Due to the current architecture of the HostApp, we cannot navigate back to the Bug Repro's page. // Also it's not recommended to place a TabbedPage into a NavigationPage. - // App.WaitForElement("Bug Repro's"); + // App.WaitForElement("Bug Repro's"); // App.EnterText("SearchBarGo", "G198"); // App.Tap("SearchButton"); - + App.WaitForElement(PageThree); App.Tap(PageThree); - + App.WaitForElement("No Crash"); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2272.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2272.cs index 9472f3928191..c0606c34126a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2272.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2272.cs @@ -1,4 +1,4 @@ -# if TEST_FAILS_ON_CATALYST //While invoking EnterText("1") results in the text being cleared before appending "1", leading to test fails on Catalyst. +#if TEST_FAILS_ON_CATALYST //While invoking EnterText("1") results in the text being cleared before appending "1", leading to test fails on Catalyst. using NUnit.Framework; using UITest.Appium; using UITest.Core; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs index 7bcb31a78987..33a8c2f828c9 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // Orientation not supported in Catalyst and Windows // On iOS FlyoutPage RTL is not working as expected, Issue: https://github.com/dotnet/maui/issues/26726 using NUnit.Framework; @@ -35,7 +35,7 @@ public void RootViewMovesAndContentIsVisible() Assert.That(positionStart, Is.Not.EqualTo(secondPosition)); } - [Test] + [Test] public void RootViewSizeDoesntChangeAfterBackground() { var idiom = App.WaitForElement("Idiom"); @@ -48,7 +48,7 @@ public void RootViewSizeDoesntChangeAfterBackground() App.WaitForElement("OpenRootView"); App.Tap("OpenRootView"); var windowSize = App.WaitForElement("RootLayout"); - App.BackgroundApp(); + App.BackgroundApp(); App.WaitForNoElement("RootLayout"); App.ForegroundApp(); var newWindowSize = App.WaitForElement("RootLayout"); @@ -61,7 +61,7 @@ public void TearDown() { App.SetOrientationPortrait(); } - + } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2894.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2894.cs index d0c37a352b76..34ab32df38e7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2894.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2894.cs @@ -29,7 +29,7 @@ public void VariousSpanGesturePermutation() for (int i = 1; i < 5; i++) { App.Tap($"TestSpan{i}"); - App.WaitForElement($"{kGesture1}{i-1}"); + App.WaitForElement($"{kGesture1}{i - 1}"); App.WaitForElement(kLabelAutomationId); PerformGestureActionForFirstSpan(target); PerformGestureActionForSecondSpan(target); @@ -59,8 +59,8 @@ void PerformGestureActionForFirstSpan(Rectangle target) void PerformGestureActionForSecondSpan(Rectangle target) { #if ANDROID // Calculate points vary on Android and other platforms. - App.TapCoordinates(target.X + target.Width /2, target.Y + 2); -#else + App.TapCoordinates(target.X + target.Width / 2, target.Y + 2); +#else PerformGestureAction(target.X + target.Width - 10, target.Y + 2); #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2948.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2948.cs index 125b9c2b53d5..abf7c54a65b2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2948.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2948.cs @@ -15,27 +15,27 @@ public Issue2948(TestDevice testDevice) : base(testDevice) [Test] [Category(UITestCategories.FlyoutPage)] - public void Issue2948Test() - { - App.SetOrientationLandscape(); - if (ShouldRunTest()) - { - var btnRect = App.WaitForElement("btnOnDetail").GetRect(); - App.Tap("ShowFlyoutBtn"); - //Unable to find the detail page elements when flyout is open because the layer is inaccessibile via Appium. So here we use click coordinates to click on the button on the detail page. - App.ClickCoordinates(btnRect.X + btnRect.Width-10, btnRect.Y + btnRect.Height / 2); - App.WaitForNoElement("Clicked", "Time out", new TimeSpan(0, 0, 1)); - } - } - public bool ShouldRunTest() - { - var isMasterVisible = App.FindElements("Leads").Count > 0; - return !isMasterVisible; - } - [TearDown] - public void TearDown() + public void Issue2948Test() + { + App.SetOrientationLandscape(); + if (ShouldRunTest()) { - App.SetOrientationPortrait(); + var btnRect = App.WaitForElement("btnOnDetail").GetRect(); + App.Tap("ShowFlyoutBtn"); + //Unable to find the detail page elements when flyout is open because the layer is inaccessibile via Appium. So here we use click coordinates to click on the button on the detail page. + App.ClickCoordinates(btnRect.X + btnRect.Width - 10, btnRect.Y + btnRect.Height / 2); + App.WaitForNoElement("Clicked", "Time out", new TimeSpan(0, 0, 1)); } + } + public bool ShouldRunTest() + { + var isMasterVisible = App.FindElements("Leads").Count > 0; + return !isMasterVisible; + } + [TearDown] + public void TearDown() + { + App.SetOrientationPortrait(); + } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2951.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2951.cs index 1c1e9bab1962..03c6c94562c9 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2951.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2951.cs @@ -35,7 +35,7 @@ public void Issue2951Test() // Use VerifyScreenshot to ensure the button background color has been updated properly // This screenshot is captured to visually confirm that the background color has changed as expected - VerifyScreenshot(); - + VerifyScreenshot(); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2964.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2964.cs index 2925b4a19757..9e7f37ab0ab2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2964.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2964.cs @@ -23,6 +23,6 @@ public void Issue2964Test() App.WaitForElement("ModalPagePopButton"); App.Tap("ModalPagePopButton"); App.WaitForElement("Page1Label"); - + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2981.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2981.cs index 0934c6f1a8cd..f63df0650a75 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2981.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2981.cs @@ -17,7 +17,7 @@ public Issue2981(TestDevice testDevice) : base(testDevice) public void Issue2981Test() { App.WaitForElement("Cell1"); - + #if MACCATALYST App.LongPress("Cell1"); App.LongPress("Cell2"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3139.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3139.cs index 814c60345be4..448ffb2ae9a8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3139.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3139.cs @@ -12,7 +12,7 @@ public Issue3139(TestDevice testDevice) : base(testDevice) public override string Issue => "DisplayActionSheet is hiding behind Dialogs"; - [Test] + [Test] [Category(UITestCategories.ActionSheet)] public void Issue3139Test() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3475.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3475.cs index d5276beb98ea..820ecc895740 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3475.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3475.cs @@ -37,7 +37,7 @@ public void Issue3475TestsLayoutCompressionPerformance() App.Tap(_withCompressionBtnId); App.WaitForElement(DoneLabelId); - + int elapsedWithCompression = GetMs(App.WaitForElement(ElapsedLabelId).GetText()!); var delta = elapsedWithCompression - elapsedWithoutCompression; @@ -48,7 +48,7 @@ public void Issue3475TestsLayoutCompressionPerformance() } public int GetMs(string text) - { + { text = text.Replace($"Showing {ItemsCount} items took: ", "", StringComparison.OrdinalIgnoreCase).Replace(" ms", "", StringComparison.OrdinalIgnoreCase); return int.TryParse(text, out int elapsed) ? elapsed : 0; } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3840.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3840.cs index ebf9b3b5a1a4..adfdea204975 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3840.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue3840.cs @@ -11,7 +11,7 @@ public class Issue3840 : _IssuesUITest const string FirstButton = "FirstClick"; const string SecondButton = "SecondClick"; public Issue3840(TestDevice testDevice) : base(testDevice) - { + { } public override string Issue => "[iOS] Translation change causes ScrollView to reset to initial position (0, 0)"; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue4684.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue4684.cs index e94725ba6a9f..2d40bffab7be 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue4684.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue4684.cs @@ -9,8 +9,8 @@ public Issue4684(TestDevice testDevice) : base(testDevice) { } #if ANDROID - const string connect="CONNECT"; - const string control="CONTROL"; + const string connect = "CONNECT"; + const string control = "CONTROL"; #else const string connect = "Connect"; const string control = "Control"; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs index 48d3fa92f1d6..6a4a34c7e136 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs @@ -13,7 +13,7 @@ public Issue5132(TestDevice testDevice) : base(testDevice) const string _idIconElement = "shellIcon"; public override string Issue => "Unable to specify automation properties on the hamburger/flyout icon"; - + [Test] [Category(UITestCategories.Shell)] public void ShellFlyoutAndHamburgerAutomationProperties() @@ -21,7 +21,7 @@ public void ShellFlyoutAndHamburgerAutomationProperties() App.WaitForElement(AppiumQuery.ByAccessibilityId(_idIconElement)); App.Tap(AppiumQuery.ByAccessibilityId(_idIconElement)); App.WaitForElement("Connect"); - + } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5412.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5412.cs index d22abd814b98..a809c9af1b4c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5412.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5412.cs @@ -14,9 +14,9 @@ public Issue5412(TestDevice testDevice) : base(testDevice) [Test] [Category(UITestCategories.FlyoutPage)] - public void Issue5412Test() + public void Issue5412Test() { - App.WaitForElementTillPageNavigationSettled("Index Page"); + App.WaitForElementTillPageNavigationSettled("Index Page"); App.TapFlyoutPageIcon("Menu title"); App.WaitForElementTillPageNavigationSettled("Settings"); App.Tap("Settings"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5500.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5500.cs index 855aaafef0c8..30ac78ae8bf2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5500.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5500.cs @@ -22,7 +22,7 @@ public void VerifyEditorTextChangeEventsAreFiring() var editorText = App.WaitForElement("EditorAutomationId").ReadText(); var entryText = App.WaitForElement("EntryAutomationId").ReadText(); Assert.That(editorText, Is.EqualTo(entryText)); - + App.ClearText("EntryAutomationId"); App.EnterText("EntryAutomationId", "Test 2"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6127.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6127.cs index 5d571c858266..c95cb96af0c8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6127.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6127.cs @@ -19,7 +19,7 @@ public Issue6127(TestDevice testDevice) : base(testDevice) public void Issue6127Test() { //AutomationId for ToolBarIcon is not works in android -#if ANDROID +#if ANDROID App.WaitForElement(AppiumQuery.ByXPath("//android.widget.Button[@content-desc='PrimaryToolbarIcon']")); #else App.WaitForElement("PrimaryToolbarIcon"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs index 3b5dd00a9e69..ae393f694a10 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs @@ -54,7 +54,7 @@ public void TwoMoreControllerDoesNotShowEditButton() Assert.That(App.FindElements("Edit").Count(), Is.EqualTo(1)); #else Assert.That(App.FindElements("Edit").Count(), Is.EqualTo(0)); -#endif +#endif } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6878.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6878.cs index bec5d084697c..7acd4370d85a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6878.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6878.cs @@ -14,7 +14,7 @@ public Issue6878(TestDevice testDevice) : base(testDevice) const string StatusLabelText = "Everything is fine 😎"; const string TopTab = "Top Tab"; #if ANDROID - const string PostClearTopTab = "POST CLEAR TOP TAB"; + const string PostClearTopTab = "POST CLEAR TOP TAB"; #else const string PostClearTopTab = "Post clear Top Tab"; #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewstring.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewstring.cs index ebcc1443919d..39aadf601124 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewstring.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewstring.cs @@ -13,23 +13,23 @@ public class Issue6932_emptyviewstring : _IssuesUITest const string RemoveAutomationId = "Remove"; const string ClearAutomationId = "Clear"; const string EmptyViewStringDescription = "Nothing to see here"; - + public Issue6932_emptyviewstring(TestDevice testDevice) : base(testDevice) { } public override string Issue => "EmptyView for BindableLayout (string)"; - + [Test] public void BEmptyViewStringBecomesVisibleWhenItemsSourceIsCleared() { App.WaitForElement(AddAutomationId); - for (var i = 0; i < Count/2; i++) + for (var i = 0; i < Count / 2; i++) App.Tap(AddAutomationId); App.Tap(ClearAutomationId); App.WaitForElement(EmptyViewStringDescription); } - + [Test] public void AEmptyViewStringBecomesVisibleWhenItemsSourceIsEmptiedOneByOne() { @@ -37,10 +37,10 @@ public void AEmptyViewStringBecomesVisibleWhenItemsSourceIsEmptiedOneByOne() for (var i = 0; i < Count; i++) App.Tap(RemoveAutomationId); - + App.WaitForElement(EmptyViewStringDescription); } - + [Test] public void CEmptyViewStringHidesWhenItemsSourceIsFilled() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewtemplate.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewtemplate.cs index 120cb947fd93..d1058f6bca68 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewtemplate.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6932_emptyviewtemplate.cs @@ -8,7 +8,7 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue6932_emptyviewtemplate : _IssuesUITest { const int Count = 10; - const string LayoutAutomationId = "1"; + const string LayoutAutomationId = "1"; const string AddAutomationId = "Add"; const string RemoveAutomationId = "Remove"; const string ClearAutomationId = "Clear"; @@ -30,18 +30,18 @@ public void BEmptyViewTemplateBecomesVisibleWhenItemsSourceIsCleared() App.Tap(ClearAutomationId); App.WaitForElement(EmptyTemplateAutomationId); } - + [Test] public void AEmptyViewTemplateBecomesVisibleWhenItemsSourceIsEmptiedOneByOne() { App.WaitForElement(LayoutAutomationId); - + for (var i = 0; i < Count; i++) App.Tap(RemoveAutomationId); - + App.WaitForElement(EmptyTemplateAutomationId); } - + [Test] public void CEmptyViewTemplateHidesWhenItemsSourceIsFilled() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7167.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7167.cs index 7250214b6a93..bcb9ee5a6519 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7167.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7167.cs @@ -13,7 +13,7 @@ public Issue7167(TestDevice testDevice) : base(testDevice) public override string Issue => "[Bug] improved observablecollection. a lot of collectionchanges. a reset is sent and listview scrolls to the top"; - + const string ListViewId = "ListViewId"; const string AddRangeCommandId = "AddRangeCommandId"; @@ -25,10 +25,10 @@ public void Issue7167Test() App.WaitForElement(AddRangeCommandId); App.Tap(AddRangeCommandId); App.Tap(AddRangeCommandId); - + // No equivalent method found in Appium. Also this method is not necessary to validate the test case. // App.Print.Tree(); - + App.ScrollDown(ListViewId, ScrollStrategy.Auto, 0.65, 200); App.WaitForAnyElement(["15", "20", "30", "40", "60", "80"]); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7329.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7329.cs index e590095f4441..f709a89eff9e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7329.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7329.cs @@ -21,7 +21,7 @@ public void ScrollListViewInsideScrollView() App.ScrollDown("NestedListView"); -#if IOS +#if IOS // In iOS, WaitForNoElement throws a timeout exception eventhough the text is not visible on the screen. So using the ListView Items to ensure scroll. App.WaitForElement("80"); #else diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7339.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7339.cs index a05641a8d681..e7ea5790090b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7339.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7339.cs @@ -12,7 +12,7 @@ public Issue7339(TestDevice testDevice) : base(testDevice) public override string Issue => "[iOS] Material frame renderer not being cleared"; - + [Test] [Category(UITestCategories.Shell)] public void MaterialFrameDisposesCorrectly() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7556.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7556.cs index c84dd5917bd3..fc987e6f5d3a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7556.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7556.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // Orientation nott supported in MacCatalyt and Windows. // on iOS detail page elements are not accessible through appium when flyout is open. Issue: https://github.com/dotnet/maui/issues/16245 using NUnit.Framework; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue774.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue774.cs index 3383dc13b2e4..92eadd84d358 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue774.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue774.cs @@ -27,7 +27,7 @@ public void Issue774TestsDismissActionSheetAfterRotation() } [TearDown] - public void TearDown() + public void TearDown() { App.SetOrientationPortrait(); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7823.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7823.cs index ed6d8845ab18..e42cec6d895a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7823.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7823.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // On iOS and Catalyst BoxView is not rendered, issue: https://github.com/dotnet/maui/issues/18746, // On Windows Clip is not properly working, issue: https://github.com/dotnet/maui/issues/14078 using NUnit.Framework; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7890.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7890.cs index ebf556bfa142..c4e9d760d15f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7890.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7890.cs @@ -20,7 +20,7 @@ public void TestCorrectListItemsRemoved() App.WaitForElement("RemoveBtn"); App.Tap("RemoveBtn"); var toRemove = Enumerable.Range(1, 5).ToList(); - foreach (var c in Enumerable.Range(0,10)) + foreach (var c in Enumerable.Range(0, 10)) { if (toRemove.Contains(c)) App.WaitForNoElement(c.ToString()); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7993.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7993.cs index 969f371e0fac..fbfa579e253d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7993.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue7993.cs @@ -20,8 +20,8 @@ public void CollectionViewVerticalOffset() var colView = App.WaitForElement("CollectionView7993"); App.WaitForElement("VerticalOffset: 0"); - App.DragCoordinates(colView.GetRect().Width - 10, - colView.GetRect().Y + colView.GetRect().Height - 50, + App.DragCoordinates(colView.GetRect().Width - 10, + colView.GetRect().Y + colView.GetRect().Height - 50, colView.GetRect().Width - 10, colView.GetRect().Y + 5); App.WaitForElement("19"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8291.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8291.cs index 692869a48a50..4f3221d52a3d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8291.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8291.cs @@ -17,7 +17,7 @@ public Issue8291(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Editor)] public void ContextMenuShowsUpWhenPressAndHoldTextOnEditorAndEntryField() { - App.WaitForElement("PressEditor"); + App.WaitForElement("PressEditor"); App.TouchAndHold("PressEditor"); TestForPopup(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8461.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8461.cs index d1a55f4f669a..78e3d235e042 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8461.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8461.cs @@ -10,7 +10,7 @@ public class Issue8461 : _IssuesUITest const string ButtonId = "PageButtonId"; const string LayoutId = "LayoutId"; const string InstructionsLabel = "InstructionsLabel"; - + public Issue8461(TestDevice testDevice) : base(testDevice) { } @@ -34,10 +34,10 @@ public void ShellSwipeToDismiss() App.SwipeLeftToRight(LayoutId, 0.99, 500, false); // Swipe in from left across full screen width App.SwipeLeftToRight(LayoutId); - + // On Android, swiping causes flyout items to overlap with the back arrow. // Touch actions may need to be performed twice to work around this issue. -#if ANDROID +#if ANDROID App.TapBackArrow(); #endif App.TapBackArrow(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8741.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8741.cs index c9e27c5f9666..dfc67448714d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8741.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue8741.cs @@ -11,7 +11,7 @@ public Issue8741(TestDevice testDevice) : base(testDevice) } public override string Issue => "[Bug] [Shell] [Android] ToolbarItem Enabled/Disabled behavior does not work for Shell apps"; - + [Test] [Category(UITestCategories.Shell)] public void Issue8741Test() @@ -23,21 +23,21 @@ public void Issue8741Test() // Additionally, the test scenario has already been validated through tap actions, so the color comparison was deemed unnecessary. //var toolbarItemColorValue = GetToolbarItemColorValue(); //int disabledAlpha = GetAlphaValue(toolbarItemColorValue); - + Assert.That(App.WaitForElement("ClickCount").ReadText(), Is.EqualTo("0")); - + App.Tap("ToggleEnabled"); App.Tap("Add"); - + //toolbarItemColorValue = GetToolbarItemColorValue(); //int enabledAlpha = GetAlphaValue(toolbarItemColorValue); //Assert.That(disabledAlpha, Is.LessThan(enabledAlpha)); - + Assert.That(App.WaitForElement("ClickCount").ReadText(), Is.EqualTo("1")); - + App.Tap("ToggleEnabled"); App.Tap("Add"); - + Assert.That(App.WaitForElement("ClickCount").ReadText(), Is.EqualTo("1")); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue889.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue889.cs index 8823431dde33..296a8284c740 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue889.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue889.cs @@ -25,7 +25,7 @@ public void Issue899TestsAppCrashWhenSwitchingTabs() App.WaitForElement("PushPage"); App.Tap("PushPage"); App.WaitForElement("PushedPageLabel"); - + #if IOS || MACCATALYST App.Tap(AppiumQuery.ByName("Initial Page")); #else diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue892.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue892.cs index 931e726d5339..0fbcd77cca8c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue892.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue892.cs @@ -42,10 +42,10 @@ public void Issue892TestsNavigateChangePagesNavigate() void NavigateToEndAndBack(string BackButtonId) { - App.WaitForElement("Push next page"); + App.WaitForElement("Push next page"); App.Tap("Push next page"); - App.WaitForElement("Push next next page"); - App.Tap("Push next next page"); + App.WaitForElement("Push next next page"); + App.Tap("Push next next page"); App.WaitForElement("You are at the end of the line"); App.Tap("Check back one"); App.WaitForElement("Pop one"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue9711.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue9711.cs index 8a5f0cb11d71..574a8b00725c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue9711.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue9711.cs @@ -7,30 +7,30 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue9711 : _IssuesUITest { - public Issue9711(TestDevice testDevice) : base(testDevice) - { - } + public Issue9711(TestDevice testDevice) : base(testDevice) + { + } - public override string Issue => "[Bug] iOS Failed to marshal the Objective-C object HeaderWrapperView"; - - [Test] - [Category(UITestCategories.ListView)] - public void TestTappingHeaderDoesNotCrash() - { - // Usually, tapping one header is sufficient to produce the exception. - // However, sometimes it takes two taps, and rarely, three. If the app - // crashes, one of the RunningApp queries will throw, failing the test. - - Assert.DoesNotThrowAsync(async () => - { - App.Tap("Group2"); - await Task.Delay(3000); - App.Tap("Group1"); - await Task.Delay(3000); - App.Tap("Group0"); - await Task.Delay(3000); - App.WaitForElement("9711TestListView"); - }); - } + public override string Issue => "[Bug] iOS Failed to marshal the Objective-C object HeaderWrapperView"; + + [Test] + [Category(UITestCategories.ListView)] + public void TestTappingHeaderDoesNotCrash() + { + // Usually, tapping one header is sufficient to produce the exception. + // However, sometimes it takes two taps, and rarely, three. If the app + // crashes, one of the RunningApp queries will throw, failing the test. + + Assert.DoesNotThrowAsync(async () => + { + App.Tap("Group2"); + await Task.Delay(3000); + App.Tap("Group1"); + await Task.Delay(3000); + App.Tap("Group0"); + await Task.Delay(3000); + App.WaitForElement("9711TestListView"); + }); + } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ListViewViewCellBinding.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ListViewViewCellBinding.cs index ff3eda6e5327..4f6bec51d1c7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ListViewViewCellBinding.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ListViewViewCellBinding.cs @@ -18,8 +18,8 @@ public ListViewViewCellBinding(TestDevice testDevice) : base(testDevice) public void ListViewViewCellBindingTestsAllElementsPresent() { App.WaitForElement("Remove"); - App.WaitForElement( "Add"); - App.WaitForElement( "1"); + App.WaitForElement("Add"); + App.WaitForElement("1"); App.WaitForElement("100.0"); App.WaitForElement("2"); App.WaitForElement("200.0"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ScrollToGroup.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ScrollToGroup.cs index 1ac0cf6dad23..6ba2886b876d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ScrollToGroup.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ScrollToGroup.cs @@ -18,10 +18,10 @@ public void CanScrollToGroupAndItemIndex() { App.WaitForElement("GroupIndexEntry"); App.ClearText("GroupIndexEntry"); - App.EnterText("GroupIndexEntry","5"); + App.EnterText("GroupIndexEntry", "5"); App.ClearText("ItemIndexEntry"); - App.EnterText("ItemIndexEntry","1"); + App.EnterText("ItemIndexEntry", "1"); App.Tap("GoButton"); @@ -33,13 +33,13 @@ public void CanScrollToGroupAndItemIndex() [Test, Order(1)] public void InvalidScrollToIndexShouldNotCrash() { - App.WaitForElement("GroupIndexEntry"); + App.WaitForElement("GroupIndexEntry"); App.ClearText("GroupIndexEntry"); - App.EnterText("GroupIndexEntry","55"); + App.EnterText("GroupIndexEntry", "55"); App.ClearText("ItemIndexEntry"); - App.EnterText("ItemIndexEntry","1"); - + App.EnterText("ItemIndexEntry", "1"); + App.Tap("GoButton"); // Should scroll enough to display this item @@ -52,10 +52,10 @@ public void CanScrollToGroupAndItem() { App.WaitForElement("GroupNameEntry"); App.ClearText("GroupNameEntry"); - App.EnterText("GroupNameEntry","Heroes for Hire"); + App.EnterText("GroupNameEntry", "Heroes for Hire"); App.ClearText("ItemNameEntry"); - App.EnterText("ItemNameEntry","Misty Knight"); + App.EnterText("ItemNameEntry", "Misty Knight"); App.Tap("GoItemButton"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContentOffset.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContentOffset.cs index 1759f928770e..baf4170965cc 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContentOffset.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContentOffset.cs @@ -29,7 +29,7 @@ public void FlyoutContentOffsetsCorrectly() [Category(UITestCategories.Shell)] public void FlyoutContentOffsetsCorrectlyWithHeader() { - App.WaitForElement("ToggleHeader"); + App.WaitForElement("ToggleHeader"); App.Tap("ToggleHeader"); GetLocationAndRotateToNextContent("Item 1"); var labelLoc = GetLocationAndRotateToNextContent("LabelContent"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutHeaderBehavior.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutHeaderBehavior.cs index 8628c7dcb5f3..29608dcf88ec 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutHeaderBehavior.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutHeaderBehavior.cs @@ -26,37 +26,37 @@ public void FlyoutHeaderBehaviorFixed() Assert.That(startingHeight, Is.EqualTo(endHeight).Within(1)); } #if !IOS // For iOS, getting incorrect Rect values from GetRect method in Appium even though the size is reduced in UI. - [Test] - [Category(UITestCategories.Shell)] - public void FlyoutHeaderBehaviorCollapseOnScroll() - { - App.WaitForElement("CollapseOnScroll"); - App.Tap("CollapseOnScroll"); - float startingHeight = GetFlyoutHeight(); - App.ScrollDown("Item 4", ScrollStrategy.Gesture); - float endHeight = GetFlyoutHeight(); - - Assert.That(startingHeight, Is.GreaterThan(endHeight)); - } + [Test] + [Category(UITestCategories.Shell)] + public void FlyoutHeaderBehaviorCollapseOnScroll() + { + App.WaitForElement("CollapseOnScroll"); + App.Tap("CollapseOnScroll"); + float startingHeight = GetFlyoutHeight(); + App.ScrollDown("Item 4", ScrollStrategy.Gesture); + float endHeight = GetFlyoutHeight(); + + Assert.That(startingHeight, Is.GreaterThan(endHeight)); + } + + [Test] // Skip this for iOS, because FindElements returns count eventhough the element is scrolled up and hidded from the UI. + [Category(UITestCategories.Shell)] + public void FlyoutHeaderBehaviorScroll() + { + App.WaitForElement("Scroll"); + App.Tap("Scroll"); + var startingY = GetFlyoutY(); + App.ScrollDown("Item 5", ScrollStrategy.Gesture); + var nextY = GetFlyoutY(); - [Test] // Skip this for iOS, because FindElements returns count eventhough the element is scrolled up and hidded from the UI. - [Category(UITestCategories.Shell)] - public void FlyoutHeaderBehaviorScroll() - { - App.WaitForElement("Scroll"); - App.Tap("Scroll"); - var startingY = GetFlyoutY(); - App.ScrollDown("Item 5", ScrollStrategy.Gesture); - var nextY = GetFlyoutY(); - - while (nextY != null && startingY != null) - { - Assert.That(startingY.Value, Is.GreaterThanOrEqualTo(nextY.Value)); - startingY = nextY; - App.ScrollDown("Item 5", ScrollStrategy.Gesture); - nextY = GetFlyoutY(); - } - } + while (nextY != null && startingY != null) + { + Assert.That(startingY.Value, Is.GreaterThanOrEqualTo(nextY.Value)); + startingY = nextY; + App.ScrollDown("Item 5", ScrollStrategy.Gesture); + nextY = GetFlyoutY(); + } + } #endif float GetFlyoutHeight() => diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutSizing.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutSizing.cs index 0ca3d576e293..3f9da61dfd72 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutSizing.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutSizing.cs @@ -23,7 +23,7 @@ public ShellFlyoutSizing(TestDevice testDevice) : base(testDevice) #endif #if ANDROID // Appium's GetRect method returns different sizes across platforms. - int difference = 26; + int difference = 26; #elif IOS || WINDOWS int difference = 10; #elif MACCATALYST diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellGestures.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellGestures.cs index e1f950dec095..06943adec090 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellGestures.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellGestures.cs @@ -37,7 +37,7 @@ public void TableViewScroll() App.TapInShellFlyout(TableViewTitle); App.WaitForElement(TableViewId); App.ScrollDown(TableViewId, ScrollStrategy.Gesture, 0.30, 400); - + // Verifying that first item in TableView is not visible also confirms that the TableView has scrolled. App.WaitForNoElement("section1"); } @@ -49,7 +49,7 @@ public void ListViewScroll() App.TapInShellFlyout(ListViewTitle); App.WaitForElement(ListViewId); App.ScrollDown(ListViewId, ScrollStrategy.Gesture, 0.20, 200); - + // Verifying that first item in ListView is not visible also confirms that the ListView has scrolled. App.WaitForNoElement("0 Entry"); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellInsets.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellInsets.cs index 757f38c9c440..6b73d8fed03c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellInsets.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellInsets.cs @@ -118,7 +118,7 @@ public void SafeArea() [Test, Order(1)] public void PaddingWithoutSafeArea() { - + App.WaitForElement(PaddingEntry); App.EnterText(PaddingEntry, "0"); App.WaitForElement(PaddingTest); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellTitleView.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellTitleView.cs index c2181a859f2f..307d474b9049 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellTitleView.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellTitleView.cs @@ -23,17 +23,17 @@ public ShellTitleView(TestDevice testDevice) : base(testDevice) #if WINDOWS const string TitleViewId="commandBar"; #else - const string TitleViewId = "TitleViewId"; + const string TitleViewId = "TitleViewId"; #endif #if WINDOWS const string Page="navViewItem"; #elif ANDROID - const string Page = "PAGE 2"; + const string Page = "PAGE 2"; #else const string Page = "page 2"; #endif - public override string Issue => "Shell Title View Tests"; + public override string Issue => "Shell Title View Tests"; [Test] public void TitleWidthMeasuresCorrectly_13949() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/SwipeBackNavCrash.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/SwipeBackNavCrash.cs index 8fd959b917db..547306a12dca 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/SwipeBackNavCrash.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/SwipeBackNavCrash.cs @@ -29,7 +29,7 @@ public void SwipeBackNavCrashTestsGoToSecondPage() #if !MACCATALYST //SwipeActions not working in Catalyst [Test] - public void SwipeBackNavCrashTestsSwipeBackDoesNotCrash () + public void SwipeBackNavCrashTestsSwipeBackDoesNotCrash() { App.WaitForElement("Swipe lightly left and right to crash this page"); App.SwipeLeftToRight(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITest.cs b/src/Controls/tests/TestCases.Shared.Tests/UITest.cs index de064388bf3c..f445313f2021 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/UITest.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/UITest.cs @@ -255,7 +255,7 @@ public override void TestSetup() } } } - + #if MACUITEST byte[] TakeScreenshot() { diff --git a/src/Controls/tests/Xaml.UnitTests/DuplicatePropertyElements.xaml.cs b/src/Controls/tests/Xaml.UnitTests/DuplicatePropertyElements.xaml.cs index 8810e6b9c043..8188d444f51b 100644 --- a/src/Controls/tests/Xaml.UnitTests/DuplicatePropertyElements.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/DuplicatePropertyElements.xaml.cs @@ -13,9 +13,11 @@ public DuplicatePropertyElements(bool useCompiledXaml) [TestFixture] public static class Tests { - [Test] public static void ThrowXamlParseException([Values]bool useCompiledXaml) + [Test] + public static void ThrowXamlParseException([Values] bool useCompiledXaml) { - if (useCompiledXaml){ + if (useCompiledXaml) + { MockCompiler.Compile(typeof(DuplicatePropertyElements), out var md, out var hasLoggedErrors); Assert.That(hasLoggedErrors); } diff --git a/src/Controls/tests/Xaml.UnitTests/DuplicateXArgumentsElements.xaml.cs b/src/Controls/tests/Xaml.UnitTests/DuplicateXArgumentsElements.xaml.cs index cce6de2795ca..12ab8f648482 100644 --- a/src/Controls/tests/Xaml.UnitTests/DuplicateXArgumentsElements.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/DuplicateXArgumentsElements.xaml.cs @@ -14,7 +14,7 @@ public DuplicateXArgumentsElements(bool useCompiledXaml) public static class Tests { [Test] - public static void ThrowXamlParseException([Values]bool useCompiledXaml) + public static void ThrowXamlParseException([Values] bool useCompiledXaml) { if (useCompiledXaml) { diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui21038.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui21038.xaml.cs index 4fb6dc1492cd..d17951e4361c 100644 --- a/src/Controls/tests/Xaml.UnitTests/Issues/Maui21038.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui21038.xaml.cs @@ -10,38 +10,38 @@ namespace Microsoft.Maui.Controls.Xaml.UnitTests; [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Maui21038 { - public Maui21038() - { - InitializeComponent(); - } + public Maui21038() + { + InitializeComponent(); + } - public Maui21038(bool useCompiledXaml) - { - //this stub will be replaced at compile time - } + public Maui21038(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } - [TestFixture] - class Test - { - [SetUp] - public void Setup() - { - Application.SetCurrentApplication(new MockApplication()); - DispatcherProvider.SetCurrent(new DispatcherProviderStub()); - } + [TestFixture] + class Test + { + [SetUp] + public void Setup() + { + Application.SetCurrentApplication(new MockApplication()); + DispatcherProvider.SetCurrent(new DispatcherProviderStub()); + } - [TearDown] public void TearDown() => AppInfo.SetCurrent(null); + [TearDown] public void TearDown() => AppInfo.SetCurrent(null); - [Test] - public void XamlParseErrorsHaveFileInfo([Values(false, true)] bool useCompiledXaml) - { - if (useCompiledXaml) - { - MockCompiler.Compile(typeof(Maui21038), out var md, out var hasLoggedErrors); - Assert.That(hasLoggedErrors); - } - else - Assert.Throws(() => new Maui21038(useCompiledXaml)); - } - } + [Test] + public void XamlParseErrorsHaveFileInfo([Values(false, true)] bool useCompiledXaml) + { + if (useCompiledXaml) + { + MockCompiler.Compile(typeof(Maui21038), out var md, out var hasLoggedErrors); + Assert.That(hasLoggedErrors); + } + else + Assert.Throws(() => new Maui21038(useCompiledXaml)); + } + } } diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui24384.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui24384.xaml.cs index 71dbedc26329..492a5591f384 100644 --- a/src/Controls/tests/Xaml.UnitTests/Issues/Maui24384.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui24384.xaml.cs @@ -33,11 +33,12 @@ public void Setup() [TearDown] public void TearDown() => AppInfo.SetCurrent(null); - [Test] public void ImmutableToIList([Values] bool useCompiledXaml) + [Test] + public void ImmutableToIList([Values] bool useCompiledXaml) { if (useCompiledXaml) MockCompiler.Compile(typeof(Maui24384)); - // Assert.DoesNotThrow(() => MockCompiler.Compile(typeof(Maui24384))); + // Assert.DoesNotThrow(() => MockCompiler.Compile(typeof(Maui24384))); var page = new Maui24384(useCompiledXaml); var picker = page.Content as Picker; Assert.That(picker.ItemsSource, Is.EquivalentTo(Maui24384.StaticLetters)); diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui25819.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25819.xaml.cs index e5579b0bb548..fa3e97ae4b4a 100644 --- a/src/Controls/tests/Xaml.UnitTests/Issues/Maui25819.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25819.xaml.cs @@ -40,14 +40,14 @@ public void TearDown() AppInfo.SetCurrent(null); } - + [Test] - public void DoesntThrow([Values]bool inflator) + public void DoesntThrow([Values] bool inflator) { MockCompiler.Compile(typeof(Maui25819)); var layout = new Maui25819(inflator); layout.BindingContext = new Maui25819UserDataViewModel(); - Assert.That(layout.label0.Text, Is.EqualTo("2023")); + Assert.That(layout.label0.Text, Is.EqualTo("2023")); } } } @@ -79,15 +79,15 @@ public Maui25819UserDataViewModel() public class Maui25819UsersDataModel { - public Maui25819InstalmentPlans InstalmentPlans { get; set; } = new(); + public Maui25819InstalmentPlans InstalmentPlans { get; set; } = new(); } public class Maui25819InstalmentPlans { - public Maui25819InstalmentPlan[] InstalmentPlan { get; set; } = []; + public Maui25819InstalmentPlan[] InstalmentPlan { get; set; } = []; } public class Maui25819InstalmentPlan { - public string FinancialYear { get; set; } = string.Empty; + public string FinancialYear { get; set; } = string.Empty; } \ No newline at end of file diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui25871.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25871.xaml.cs index e429fe7d9b63..c4ffa7c07566 100644 --- a/src/Controls/tests/Xaml.UnitTests/Issues/Maui25871.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25871.xaml.cs @@ -43,7 +43,7 @@ public void TearDown() public void CompilationDoesNotFail() { MockCompiler.Compile(typeof(Maui25871)); - + } } } diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui26206.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui26206.xaml.cs index a3593c1f1b5d..49e77f65c9b6 100644 --- a/src/Controls/tests/Xaml.UnitTests/Issues/Maui26206.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui26206.xaml.cs @@ -12,7 +12,7 @@ public Maui26206() { InitializeComponent(); } - + public Maui26206(bool useCompiledXaml) { //this stub will be replaced at compile time @@ -35,7 +35,7 @@ public void TearDown() } [Test] - public void MultipleResourcesInRD([Values]bool useCompiledXaml) + public void MultipleResourcesInRD([Values] bool useCompiledXaml) { if (useCompiledXaml) MockCompiler.Compile(typeof(Maui26206)); diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui26369.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui26369.xaml.cs index 0f5450f730e6..918dacc16e74 100644 --- a/src/Controls/tests/Xaml.UnitTests/Issues/Maui26369.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui26369.xaml.cs @@ -15,15 +15,15 @@ namespace Microsoft.Maui.Controls.Xaml.UnitTests; public partial class Maui26369 : ContentPage { - public static readonly BindableProperty NullableGridLengthProperty = - BindableProperty.Create(nameof(NullableGridLength), typeof(GridLength?), typeof(Maui26369), null); - - [TypeConverter(typeof(GridLengthTypeConverter))] - public GridLength? NullableGridLength - { - get => (GridLength?)GetValue(NullableGridLengthProperty); - set => SetValue(NullableGridLengthProperty, value); - } + public static readonly BindableProperty NullableGridLengthProperty = + BindableProperty.Create(nameof(NullableGridLength), typeof(GridLength?), typeof(Maui26369), null); + + [TypeConverter(typeof(GridLengthTypeConverter))] + public GridLength? NullableGridLength + { + get => (GridLength?)GetValue(NullableGridLengthProperty); + set => SetValue(NullableGridLengthProperty, value); + } public Maui26369() { diff --git a/src/Controls/tests/Xaml.UnitTests/MockCompiler.cs b/src/Controls/tests/Xaml.UnitTests/MockCompiler.cs index ad918c83b7ab..ea8ba040b622 100644 --- a/src/Controls/tests/Xaml.UnitTests/MockCompiler.cs +++ b/src/Controls/tests/Xaml.UnitTests/MockCompiler.cs @@ -14,7 +14,7 @@ public static void Compile( out bool hasLoggedErrors, string targetFramework = null, bool treatWarningsAsErrors = false, - bool compileBindingsWithSource = true) + bool compileBindingsWithSource = true) => Compile(type, out _, out hasLoggedErrors, targetFramework, treatWarningsAsErrors, compileBindingsWithSource); public static void Compile( @@ -22,11 +22,11 @@ public static void Compile( string targetFramework = null, bool treatWarningsAsErrors = false, bool compileBindingsWithSource = true) - { - Compile(type, out _, out var hasLoggedErrors, targetFramework, treatWarningsAsErrors, compileBindingsWithSource); - if (hasLoggedErrors) - throw new Exception("XamlC failed"); - } + { + Compile(type, out _, out var hasLoggedErrors, targetFramework, treatWarningsAsErrors, compileBindingsWithSource); + if (hasLoggedErrors) + throw new Exception("XamlC failed"); + } public static void Compile( Type type, diff --git a/src/Controls/tests/Xaml.UnitTests/MultipleDataTemplateChildElements.xaml.cs b/src/Controls/tests/Xaml.UnitTests/MultipleDataTemplateChildElements.xaml.cs index 9f73c26f680b..c0f7fe3d59ea 100644 --- a/src/Controls/tests/Xaml.UnitTests/MultipleDataTemplateChildElements.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/MultipleDataTemplateChildElements.xaml.cs @@ -14,13 +14,13 @@ public MultipleDataTemplateChildElements(bool useCompiledXaml) public static class Tests { [Test] - public static void ThrowXamlParseException([Values]bool useCompiledXaml) + public static void ThrowXamlParseException([Values] bool useCompiledXaml) { if (useCompiledXaml) { MockCompiler.Compile(typeof(MultipleDataTemplateChildElements), out var md, out var hasLoggedErrors); Assert.That(hasLoggedErrors); - } + } else Assert.Throws(() => new MultipleDataTemplateChildElements(useCompiledXaml)); } diff --git a/src/Core/src/Handlers/Application/ApplicationHandler.Windows.cs b/src/Core/src/Handlers/Application/ApplicationHandler.Windows.cs index ba41e3c65d04..e3327585adb1 100644 --- a/src/Core/src/Handlers/Application/ApplicationHandler.Windows.cs +++ b/src/Core/src/Handlers/Application/ApplicationHandler.Windows.cs @@ -22,7 +22,7 @@ public static partial void MapCloseWindow(ApplicationHandler handler, IApplicati (window.Handler?.PlatformView as Window)?.Close(); } } - + public static partial void MapActivateWindow(ApplicationHandler handler, IApplication application, object? args) { if (args is IWindow window) diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs b/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs index 6b7ec0c2d829..0376cb93f541 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs @@ -17,7 +17,7 @@ public partial class EntryHandler : ViewHandler protected override TextBox CreatePlatformView() => new MauiPasswordTextBox() { - IsObfuscationDelayed = s_shouldBeDelayed + MauiPasswordTextBox.IsObfuscationDelayed = s_shouldBeDelayed }; public override void SetVirtualView(IView view) @@ -109,7 +109,7 @@ public static void MapSelectionLength(IEntryHandler handler, IEntry entry) => void OnPlatformTextChanged(object sender, TextChangedEventArgs args) { if (PlatformView is MauiPasswordTextBox passwordBox) - VirtualView?.UpdateText(passwordBox.Password); + VirtualView?.UpdateText(MauiPasswordTextBox.Password); else VirtualView?.UpdateText(PlatformView.Text); } diff --git a/src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Windows.cs b/src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Windows.cs index bd5f2499cb5d..c12e562fbc93 100644 --- a/src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Windows.cs +++ b/src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Windows.cs @@ -48,7 +48,7 @@ static void UpdateFlyout(IFlyoutViewHandler handler) if (handler.PlatformView is RootNavigationView rnv) rnv.FlyoutView = handler.VirtualView.Flyout; - handler.PlatformView.FlyoutCustomContent = handler.VirtualView.Flyout?.ToPlatform(handler.MauiContext); + MauiNavigationView.FlyoutCustomContent = handler.VirtualView.Flyout?.ToPlatform(handler.MauiContext); } public static void MapDetail(IFlyoutViewHandler handler, IFlyoutView flyoutView) diff --git a/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Tizen.cs b/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Tizen.cs index 036e044634bb..c686585c373e 100644 --- a/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Tizen.cs +++ b/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Tizen.cs @@ -2,7 +2,7 @@ namespace Microsoft.Maui.Handlers { - public partial class HybridWebViewHandler : ViewHandler + public partial class HybridWebViewHandler : ViewHandler { protected override Tizen.NUI.BaseComponents.View CreatePlatformView() => throw new NotImplementedException(); diff --git a/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.iOS.cs b/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.iOS.cs index 70e8696a7b93..653e9a3428a7 100644 --- a/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.iOS.cs +++ b/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.iOS.cs @@ -220,7 +220,7 @@ public void StartUrlSchemeTask(WKWebView webView, IWKUrlSchemeTask urlSchemeTask } [Export("webView:stopURLSchemeTask:")] - public void StopUrlSchemeTask(WKWebView webView, IWKUrlSchemeTask urlSchemeTask) + public static void StopUrlSchemeTask(WKWebView webView, IWKUrlSchemeTask urlSchemeTask) { } } diff --git a/src/Core/src/Handlers/SearchBar/SearchBarHandler.Windows.cs b/src/Core/src/Handlers/SearchBar/SearchBarHandler.Windows.cs index b31d8c58ae26..f2aa5e76feff 100644 --- a/src/Core/src/Handlers/SearchBar/SearchBarHandler.Windows.cs +++ b/src/Core/src/Handlers/SearchBar/SearchBarHandler.Windows.cs @@ -5,7 +5,7 @@ namespace Microsoft.Maui.Handlers { public partial class SearchBarHandler : ViewHandler { - public AutoSuggestBox? QueryEditor => null; + public static AutoSuggestBox? QueryEditor => null; protected override AutoSuggestBox CreatePlatformView() => new AutoSuggestBox { diff --git a/src/Core/src/Handlers/WebView/WebViewHandler.Windows.cs b/src/Core/src/Handlers/WebView/WebViewHandler.Windows.cs index ee83f7f6c161..0c0ca4a733e8 100644 --- a/src/Core/src/Handlers/WebView/WebViewHandler.Windows.cs +++ b/src/Core/src/Handlers/WebView/WebViewHandler.Windows.cs @@ -145,7 +145,7 @@ void ProcessFailed(CoreWebView2 sender, CoreWebView2ProcessFailedEventArgs args) { SendProcessFailed(args); } - + async void SendNavigated(string url, WebNavigationEvent evnt, WebNavigationResult result) { if (VirtualView is not null) @@ -211,7 +211,7 @@ internal async Task SyncPlatformCookies(string url) { return; } - + await InitialCookiePreloadIfNecessary(url); var cookies = myCookieJar.GetCookies(uri); @@ -371,7 +371,7 @@ void OnCoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs if (Handler is WebViewHandler handler) { sender.UpdateUserAgent(handler.VirtualView); - if (sender.Source is not null) + if (sender.Source is not null) { handler.SyncPlatformCookies(sender.Source.ToString()).FireAndForget(); } diff --git a/src/Core/src/Handlers/Window/WindowHandler.iOS.cs b/src/Core/src/Handlers/Window/WindowHandler.iOS.cs index 13e2eedcc629..ea05d4c3999f 100644 --- a/src/Core/src/Handlers/Window/WindowHandler.iOS.cs +++ b/src/Core/src/Handlers/Window/WindowHandler.iOS.cs @@ -16,8 +16,8 @@ protected override void ConnectHandler(UIWindow platformView) if (OperatingSystem.IsMacCatalystVersionAtLeast(16)) { _proxy.Connect(VirtualView, platformView); - } - else + } + else { UpdateVirtualViewFrame(platformView); } @@ -25,7 +25,7 @@ protected override void ConnectHandler(UIWindow platformView) protected override void DisconnectHandler(UIWindow platformView) { - if (OperatingSystem.IsMacCatalystVersionAtLeast(16)) + if (OperatingSystem.IsMacCatalystVersionAtLeast(16)) { _proxy.Disconnect(); } @@ -141,7 +141,7 @@ void HandleEffectiveGeometryObserved(NSObservedChange obj) { var newRectangle = newGeometry.SystemFrame.ToRectangle(); - if (double.IsNaN(newRectangle.X) || double.IsNaN(newRectangle.Y) || double.IsNaN(newRectangle.Width) || double.IsNaN(newRectangle.Height)) + if (double.IsNaN(newRectangle.X) || double.IsNaN(newRectangle.Y) || double.IsNaN(newRectangle.Width) || double.IsNaN(newRectangle.Height)) { return; } diff --git a/src/Core/src/Hosting/Internal/MauiServiceCollection.cs b/src/Core/src/Hosting/Internal/MauiServiceCollection.cs index 201fd6811b31..76824da75c2b 100644 --- a/src/Core/src/Hosting/Internal/MauiServiceCollection.cs +++ b/src/Core/src/Hosting/Internal/MauiServiceCollection.cs @@ -13,7 +13,7 @@ class MauiServiceCollection : IMauiServiceCollection public int Count => _descriptors.Count; - public bool IsReadOnly => false; + public static bool IsReadOnly => false; public ServiceDescriptor this[int index] { diff --git a/src/Core/src/Hosting/MauiAppBuilder.cs b/src/Core/src/Hosting/MauiAppBuilder.cs index 77791baa7f10..fb24b804db40 100644 --- a/src/Core/src/Hosting/MauiAppBuilder.cs +++ b/src/Core/src/Hosting/MauiAppBuilder.cs @@ -182,11 +182,11 @@ private void ConfigureDefaultLogging() private sealed class NullLoggerFactory : ILoggerFactory { - public void AddProvider(ILoggerProvider provider) { } + public static void AddProvider(ILoggerProvider provider) { } public ILogger CreateLogger(string categoryName) => NullLogger.Instance; - public void Dispose() { } + public static void Dispose() { } } private sealed class NullLogger : ILogger, IDisposable @@ -195,9 +195,9 @@ private sealed class NullLogger : ILogger, IDisposable public void Dispose() { } - public bool IsEnabled(LogLevel logLevel) => false; + public static bool IsEnabled(LogLevel logLevel) => false; - public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) + public static void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) { } } diff --git a/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs b/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs index 6d2ad3196bdd..36e16f64ced3 100644 --- a/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs +++ b/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs @@ -136,7 +136,7 @@ string GetFontSource(IFontImageSource imageSource) } var fontUri = new Uri(fontSource, UriKind.RelativeOrAbsolute); - + var path = fontUri.AbsolutePath.TrimStart('/'); if (FileSystemUtils.TryGetAppPackageFileUri(path, out var uri)) { diff --git a/src/Core/src/Platform/Windows/ActivityIndicatorExtensions.cs b/src/Core/src/Platform/Windows/ActivityIndicatorExtensions.cs index 9b7a5911a1b3..274dd4f35084 100644 --- a/src/Core/src/Platform/Windows/ActivityIndicatorExtensions.cs +++ b/src/Core/src/Platform/Windows/ActivityIndicatorExtensions.cs @@ -25,7 +25,7 @@ public static void UpdateColor(this ProgressRing platformActivityIndicator, IAct if (color.IsDefault()) { - if(foregroundDefault is Brush defaultBrush) + if (foregroundDefault is Brush defaultBrush) brush = defaultBrush; } else diff --git a/src/Core/src/Platform/Windows/ColorConverter.cs b/src/Core/src/Platform/Windows/ColorConverter.cs index 4ef57acc9451..80d8c593e68e 100644 --- a/src/Core/src/Platform/Windows/ColorConverter.cs +++ b/src/Core/src/Platform/Windows/ColorConverter.cs @@ -7,7 +7,7 @@ namespace Microsoft.Maui.Platform { public sealed class ColorConverter : UI.Xaml.Data.IValueConverter { - public object Convert(object value, Type targetType, object parameter, string language) + public static object Convert(object value, Type targetType, object parameter, string language) { var color = (Graphics.Color)value; var defaultColorKey = (string)parameter; diff --git a/src/Core/src/Platform/Windows/MauiNavigationView.cs b/src/Core/src/Platform/Windows/MauiNavigationView.cs index 6dd485acf974..9077e888bb7b 100644 --- a/src/Core/src/Platform/Windows/MauiNavigationView.cs +++ b/src/Core/src/Platform/Windows/MauiNavigationView.cs @@ -188,7 +188,7 @@ internal static readonly DependencyProperty ToolbarProperty = DependencyProperty.Register(nameof(Toolbar), typeof(UIElement), typeof(MauiNavigationView), new PropertyMetadata(null, (d, _) => ((RootNavigationView)d).ToolbarChanged())); - internal UIElement? Toolbar + internal static UIElement? Toolbar { get => (UIElement?)GetValue(ToolbarProperty); set => SetValue(ToolbarProperty, value); @@ -196,7 +196,7 @@ internal UIElement? Toolbar protected private virtual void ToolbarChanged() { - Header = Toolbar; + Header = MauiNavigationView.Toolbar; } #endregion @@ -206,7 +206,7 @@ public static readonly DependencyProperty NavigationViewBackButtonMarginProperty = DependencyProperty.Register(nameof(NavigationViewBackButtonMargin), typeof(WThickness), typeof(MauiNavigationView), new PropertyMetadata(new WThickness(4, 2, 0, 2), NavigationViewBackButtonMarginChanged)); - public WThickness NavigationViewBackButtonMargin + public static WThickness NavigationViewBackButtonMargin { get => (WThickness)GetValue(NavigationViewBackButtonMarginProperty); set => SetValue(NavigationViewBackButtonMarginProperty, value); @@ -220,10 +220,10 @@ static void NavigationViewBackButtonMarginChanged(DependencyObject d, Dependency void UpdateNavigationViewBackButtonMargin() { if (NavigationViewBackButton != null) - NavigationViewBackButton.Margin = NavigationViewBackButtonMargin; + NavigationViewBackButton.Margin = MauiNavigationView.NavigationViewBackButtonMargin; if (NavigationViewCloseButton != null) - NavigationViewCloseButton.Margin = NavigationViewBackButtonMargin; + NavigationViewCloseButton.Margin = MauiNavigationView.NavigationViewBackButtonMargin; } #endregion @@ -232,7 +232,7 @@ internal static readonly DependencyProperty NavigationViewButtonHolderGridMargin = DependencyProperty.Register(nameof(NavigationViewButtonHolderGridMargin), typeof(WThickness), typeof(MauiNavigationView), new PropertyMetadata((WThickness)Application.Current.Resources["NavigationViewButtonHolderGridMargin"], NavigationViewButtonHolderGridMarginChanged)); - internal WThickness NavigationViewButtonHolderGridMargin + internal static WThickness NavigationViewButtonHolderGridMargin { get => (WThickness)GetValue(NavigationViewButtonHolderGridMarginProperty); set => SetValue(NavigationViewButtonHolderGridMarginProperty, value); @@ -246,7 +246,7 @@ static void NavigationViewButtonHolderGridMarginChanged(DependencyObject d, Depe void UpdateNavigationViewButtonHolderGridMargin() { if (ButtonHolderGrid != null) - ButtonHolderGrid.Margin = NavigationViewButtonHolderGridMargin; + ButtonHolderGrid.Margin = MauiNavigationView.NavigationViewButtonHolderGridMargin; } #endregion @@ -259,7 +259,7 @@ internal static readonly DependencyProperty NavigationBackButtonHeightProperty = DependencyProperty.Register(nameof(NavigationBackButtonHeight), typeof(double), typeof(MauiNavigationView), new PropertyMetadata(DefaultNavigationBackButtonHeight, OnNavigationBackButtonSizeChanged)); - internal double NavigationBackButtonHeight + internal static double NavigationBackButtonHeight { get => (double)GetValue(NavigationBackButtonHeightProperty); set => SetValue(NavigationBackButtonHeightProperty, value); @@ -269,7 +269,7 @@ internal static readonly DependencyProperty NavigationBackButtonWidthProperty = DependencyProperty.Register(nameof(NavigationBackButtonWidth), typeof(double), typeof(MauiNavigationView), new PropertyMetadata(DefaultNavigationBackButtonWidth, OnNavigationBackButtonSizeChanged)); - internal double NavigationBackButtonWidth + internal static double NavigationBackButtonWidth { get => (double)GetValue(NavigationBackButtonWidthProperty); set => SetValue(NavigationBackButtonWidthProperty, value); @@ -285,17 +285,17 @@ void UpdateNavigationBackButtonSize() { if (NavigationViewBackButton != null && NavigationViewCloseButton != null) { - if (NavigationViewBackButton.Height != NavigationBackButtonHeight) - NavigationViewBackButton.Height = NavigationBackButtonHeight; + if (NavigationViewBackButton.Height != MauiNavigationView.NavigationBackButtonHeight) + NavigationViewBackButton.Height = MauiNavigationView.NavigationBackButtonHeight; - if (NavigationViewBackButton.Width != NavigationBackButtonWidth) - NavigationViewBackButton.Width = NavigationBackButtonWidth; + if (NavigationViewBackButton.Width != MauiNavigationView.NavigationBackButtonWidth) + NavigationViewBackButton.Width = MauiNavigationView.NavigationBackButtonWidth; - if (NavigationViewCloseButton.Height != NavigationBackButtonHeight) - NavigationViewCloseButton.Height = NavigationBackButtonHeight; + if (NavigationViewCloseButton.Height != MauiNavigationView.NavigationBackButtonHeight) + NavigationViewCloseButton.Height = MauiNavigationView.NavigationBackButtonHeight; - if (NavigationViewCloseButton.Width != NavigationBackButtonWidth) - NavigationViewCloseButton.Width = NavigationBackButtonWidth; + if (NavigationViewCloseButton.Width != MauiNavigationView.NavigationBackButtonWidth) + NavigationViewCloseButton.Width = MauiNavigationView.NavigationBackButtonWidth; } } #endregion @@ -305,7 +305,7 @@ internal static readonly DependencyProperty FlyoutCustomContentProperty = DependencyProperty.Register(nameof(FlyoutCustomContent), typeof(UIElement), typeof(MauiNavigationView), new PropertyMetadata(null, (d, _) => ((RootNavigationView)d).UpdateFlyoutCustomContent())); - internal UIElement? FlyoutCustomContent + internal static UIElement? FlyoutCustomContent { get => (UIElement?)GetValue(FlyoutCustomContentProperty); set => SetValue(FlyoutCustomContentProperty, value); @@ -313,7 +313,7 @@ internal UIElement? FlyoutCustomContent protected private virtual void UpdateFlyoutCustomContent() { - PaneCustomContent = FlyoutCustomContent; + PaneCustomContent = MauiNavigationView.FlyoutCustomContent; } #endregion @@ -330,7 +330,7 @@ internal static readonly DependencyProperty PaneToggleButtonPaddingProperty = DependencyProperty.Register(nameof(PaneToggleButtonPadding), typeof(WThickness), typeof(MauiNavigationView), new PropertyMetadata(DefaultPaneToggleButtonPadding, OnPaneToggleButtonSizeChanged)); - internal WThickness PaneToggleButtonPadding + internal static WThickness PaneToggleButtonPadding { get => (WThickness)GetValue(PaneToggleButtonPaddingProperty); set => SetValue(PaneToggleButtonPaddingProperty, value); @@ -340,7 +340,7 @@ internal static readonly DependencyProperty PaneToggleButtonHeightProperty = DependencyProperty.Register(nameof(PaneToggleButtonHeight), typeof(double), typeof(MauiNavigationView), new PropertyMetadata(DefaultPaneToggleButtonHeight, OnPaneToggleButtonSizeChanged)); - internal double PaneToggleButtonHeight + internal static double PaneToggleButtonHeight { get => (double)GetValue(PaneToggleButtonHeightProperty); set => SetValue(PaneToggleButtonHeightProperty, value); @@ -351,7 +351,7 @@ internal static readonly DependencyProperty PaneToggleButtonWidthProperty new PropertyMetadata(DefaultPaneToggleButtonWidth, OnPaneToggleButtonSizeChanged)); private NavigationViewPaneDisplayMode? _pinPaneDisplayModeTo; - internal double PaneToggleButtonWidth + internal static double PaneToggleButtonWidth { get => (double)GetValue(PaneToggleButtonWidthProperty); set => SetValue(PaneToggleButtonWidthProperty, value); @@ -367,34 +367,34 @@ void UpdatePaneToggleButtonSize() { if (TogglePaneButton != null) { - if (PaneToggleButtonHeight != TogglePaneButton.Height) + if (MauiNavigationView.PaneToggleButtonHeight != TogglePaneButton.Height) { - TogglePaneButton.Height = PaneToggleButtonHeight; - var togglePaneButtonMinHeight = Math.Min((double)Application.Current.Resources["PaneToggleButtonHeight"], PaneToggleButtonHeight); + TogglePaneButton.Height = MauiNavigationView.PaneToggleButtonHeight; + var togglePaneButtonMinHeight = Math.Min((double)Application.Current.Resources["PaneToggleButtonHeight"], MauiNavigationView.PaneToggleButtonHeight); if (TogglePaneButton.MinHeight != togglePaneButtonMinHeight) TogglePaneButton.MinHeight = togglePaneButtonMinHeight; } if (TogglePaneButton.GetFirstDescendant() is Grid grid) { - if (grid.Height != PaneToggleButtonHeight) - grid.Height = PaneToggleButtonHeight; + if (grid.Height != MauiNavigationView.PaneToggleButtonHeight) + grid.Height = MauiNavigationView.PaneToggleButtonHeight; // The row definition is bound to PaneToggleButtonHeight // the height is bound to MinHeight of the button - if (grid.RowDefinitions[0].Height.Value != PaneToggleButtonHeight) - grid.RowDefinitions[0].Height = new WGridLength(PaneToggleButtonHeight); + if (grid.RowDefinitions[0].Height.Value != MauiNavigationView.PaneToggleButtonHeight) + grid.RowDefinitions[0].Height = new WGridLength(MauiNavigationView.PaneToggleButtonHeight); } - if (PaneToggleButtonWidth != TogglePaneButton.Width) - TogglePaneButton.Width = PaneToggleButtonWidth; + if (MauiNavigationView.PaneToggleButtonWidth != TogglePaneButton.Width) + TogglePaneButton.Width = MauiNavigationView.PaneToggleButtonWidth; - var togglePaneButtonMinWidth = Math.Min((double)Application.Current.Resources["PaneToggleButtonWidth"], PaneToggleButtonWidth); + var togglePaneButtonMinWidth = Math.Min((double)Application.Current.Resources["PaneToggleButtonWidth"], MauiNavigationView.PaneToggleButtonWidth); if (TogglePaneButton.MinWidth != togglePaneButtonMinWidth) TogglePaneButton.MinWidth = togglePaneButtonMinWidth; - if (TogglePaneButton.Padding != PaneToggleButtonPadding) - TogglePaneButton.Padding = PaneToggleButtonPadding; + if (TogglePaneButton.Padding != MauiNavigationView.PaneToggleButtonPadding) + TogglePaneButton.Padding = MauiNavigationView.PaneToggleButtonPadding; } } #endregion diff --git a/src/Core/src/Platform/Windows/MauiPasswordTextBox.cs b/src/Core/src/Platform/Windows/MauiPasswordTextBox.cs index ea9c11da589c..7ef26d48ca3c 100644 --- a/src/Core/src/Platform/Windows/MauiPasswordTextBox.cs +++ b/src/Core/src/Platform/Windows/MauiPasswordTextBox.cs @@ -70,27 +70,47 @@ public MauiPasswordTextBox() static void OnInputScopePropertyChanged(DependencyObject sender, DependencyProperty dp) { + +/* Unmerged change from project 'Core(net9.0-windows10.0.20348.0)' +Before: if (sender is not MauiPasswordTextBox mauiTxtBox || mauiTxtBox.IsPassword) +After: + if (sender is not MauiPasswordTextBox mauiTxtBox || IsPassword) +*/ + if (sender is not MauiPasswordTextBox mauiTxtBox || MauiPasswordTextBox.IsPassword) { return; } + +/* Unmerged change from project 'Core(net9.0-windows10.0.20348.0)' +Before: mauiTxtBox.IsPassword = mauiTxtBox.InputScope?.Names?.Any(x => x.NameValue == InputScopeNameValue.Password) ?? false; } + public bool IsPassword +After: + IsPassword = mauiTxtBox.InputScope?.Names?.Any(x => x.NameValue == InputScopeNameValue.Password) ?? false; + } + + public static bool IsPassword +*/ + MauiPasswordTextBox.IsPassword = mauiTxtBox.InputScope?.Names?.Any(x => x.NameValue == InputScopeNameValue.Password) ?? false; + } + public bool IsPassword { get => (bool)GetValue(IsPasswordProperty); set => SetValue(IsPasswordProperty, value); } - public string Password + public static string Password { get => (string)GetValue(PasswordProperty); set => SetValue(PasswordProperty, value); } - public bool IsObfuscationDelayed + public static bool IsObfuscationDelayed { get => (bool)GetValue(IsObfuscationDelayedProperty); set => SetValue(IsObfuscationDelayedProperty, value); @@ -108,7 +128,7 @@ public bool IsObfuscationDelayed // handled accordingly. protected override void OnKeyDown(KeyRoutedEventArgs e) { - if (!IsPassword) + if (!MauiPasswordTextBox.IsPassword) { base.OnKeyDown(e); return; @@ -157,7 +177,7 @@ private void OnNativeTextChanging(TextBox sender, TextBoxTextChangingEventArgs a // but when IsPassword=true, it is too late to handle it at that moment, as we have already // obfuscated the text and have lost the real CursorPosition value. So, let's handle that // issue here when IsPassword is enabled. - if (!IsPassword) + if (!MauiPasswordTextBox.IsPassword) return; // As we are obfuscating the text by ourselves we are setting the Text property directly on code many times. @@ -165,9 +185,9 @@ private void OnNativeTextChanging(TextBox sender, TextBoxTextChangingEventArgs a // to the beginning of the TextBox. // To avoid this behavior let's save the current cursor position of the first time the Text is updated by the user // and keep the same cursor position after each Text update until a new Text update by the user happens. - var updatedPassword = DetermineTextFromPassword(Password, SelectionStart, Text); + var updatedPassword = DetermineTextFromPassword(MauiPasswordTextBox.Password, SelectionStart, Text); - if (Password != updatedPassword) + if (MauiPasswordTextBox.Password != updatedPassword) { _cachedCursorPosition = SelectionStart; _cachedTextLength = updatedPassword.Length; @@ -182,21 +202,21 @@ private void OnNativeTextChanging(TextBox sender, TextBoxTextChangingEventArgs a void OnNativeTextChanged(object sender, TextChangedEventArgs textChangedEventArgs) { - if (IsPassword) + if (MauiPasswordTextBox.IsPassword) { - if (IsObfuscationDelayed) + if (MauiPasswordTextBox.IsObfuscationDelayed) DelayObfuscation(); else ImmediateObfuscation(); } - else if (Text != Password) + else if (Text != MauiPasswordTextBox.Password) { // Not in password mode, so we just need to make the "real" text match // what's in the textbox; the internalChange flag keeps the TextProperty // synchronization from happening _internalChangeFlag = true; - Password = Text; + MauiPasswordTextBox.Password = Text; _internalChangeFlag = false; } } @@ -206,7 +226,7 @@ void UpdateVisibleText() if (_internalChangeFlag) return; - var updatedText = IsPassword ? Obfuscate(Password) : Password; + var updatedText = MauiPasswordTextBox.IsPassword ? Obfuscate(MauiPasswordTextBox.Password) : MauiPasswordTextBox.Password; if (Text != updatedText) Text = updatedText; @@ -214,7 +234,7 @@ void UpdateVisibleText() void UpdateInputScope() { - if (!IsPassword) + if (!MauiPasswordTextBox.IsPassword) { InputScope = _cachedInputScope; IsSpellCheckEnabled = _cachedSpellCheckSetting; @@ -247,7 +267,7 @@ void ImmediateObfuscation() void DelayObfuscation() { - var lengthDifference = Text.Length - Password.Length; + var lengthDifference = Text.Length - MauiPasswordTextBox.Password.Length; UpdatePasswordIfNeeded(); @@ -260,13 +280,13 @@ void DelayObfuscation() { // Either More than one character got added in this text change (e.g., a paste operation) // Or characters were removed. Either way, we don't need to do the delayed obfuscation dance - updatedVisibleText = Obfuscate(Password); + updatedVisibleText = Obfuscate(MauiPasswordTextBox.Password); } else { // Only one character was added; we need to leave it visible for a brief time period // Obfuscate all but the last character for now - updatedVisibleText = Obfuscate(Password, true); + updatedVisibleText = Obfuscate(MauiPasswordTextBox.Password, true); // Leave the last character visible until a new character is added // or sufficient time has passed @@ -295,10 +315,10 @@ void StartTimeout(CancellationToken token) void UpdatePasswordIfNeeded() { - var updatedPassword = DetermineTextFromPassword(Password, SelectionStart, Text); + var updatedPassword = DetermineTextFromPassword(MauiPasswordTextBox.Password, SelectionStart, Text); - if (Password != updatedPassword) - Password = updatedPassword; + if (MauiPasswordTextBox.Password != updatedPassword) + MauiPasswordTextBox.Password = updatedPassword; } static string Obfuscate(string text, bool leaveLastVisible = false) diff --git a/src/Core/src/Platform/Windows/MauiSlider.cs b/src/Core/src/Platform/Windows/MauiSlider.cs index 1fcc5f660c32..ed4c65bea492 100644 --- a/src/Core/src/Platform/Windows/MauiSlider.cs +++ b/src/Core/src/Platform/Windows/MauiSlider.cs @@ -33,7 +33,7 @@ void UpdateThumbStyle() return; } - WImageSource imageSource = ThumbImageSource; + WImageSource imageSource = MauiSlider.ThumbImageSource; if (imageSource != null) { _thumb.Style = ImageThumbStyle; @@ -46,7 +46,7 @@ void UpdateThumbStyle() } } - public WImageSource ThumbImageSource + public static WImageSource ThumbImageSource { get { return (WImageSource)GetValue(ThumbImageSourceProperty); } set { SetValue(ThumbImageSourceProperty, value); } diff --git a/src/Core/src/Platform/Windows/MauiToolbar.xaml.cs b/src/Core/src/Platform/Windows/MauiToolbar.xaml.cs index b8319f8a6e3c..79eb79637091 100644 --- a/src/Core/src/Platform/Windows/MauiToolbar.xaml.cs +++ b/src/Core/src/Platform/Windows/MauiToolbar.xaml.cs @@ -31,7 +31,7 @@ public MauiToolbar() titleView.Visibility = UI.Xaml.Visibility.Collapsed; } - internal string? Title + internal static string? Title { get => title.Text; set @@ -45,12 +45,12 @@ internal string? Title } } - internal WImage? TitleIconImage + internal static WImage? TitleIconImage { get => titleIcon; } - internal WImageSource? TitleIconImageSource + internal static WImageSource? TitleIconImageSource { get => titleIcon.Source; set @@ -64,13 +64,13 @@ internal WImageSource? TitleIconImageSource } } - internal UI.Xaml.Thickness TitleViewMargin + internal static UI.Xaml.Thickness TitleViewMargin { get => titleView.Margin; set => titleView.Margin = value; } - internal object? TitleView + internal static object? TitleView { get => titleView.Content; set @@ -95,28 +95,28 @@ internal void SetBarTextColor(WBrush? brush) UpdateMenuBarForeground(); } - internal CommandBar CommandBar => commandBar; + internal static CommandBar CommandBar => commandBar; - internal UI.Xaml.Thickness ContentGridMargin + internal static UI.Xaml.Thickness ContentGridMargin { get => contentGrid.Margin; set => contentGrid.Margin = value; } - internal VerticalAlignment TextBlockBorderVerticalAlignment + internal static VerticalAlignment TextBlockBorderVerticalAlignment { get => textBlockBorder.VerticalAlignment; set => textBlockBorder.VerticalAlignment = value; } - public NavigationViewBackButtonVisible IsBackButtonVisible + public static NavigationViewBackButtonVisible IsBackButtonVisible { get => (NavigationViewBackButtonVisible)GetValue(IsBackButtonVisibleProperty); set => SetValue(IsBackButtonVisibleProperty, value); } - public bool IsBackEnabled + public static bool IsBackEnabled { get => (bool)GetValue(IsBackEnabledProperty); set => SetValue(IsBackEnabledProperty, value); diff --git a/src/Core/src/Platform/Windows/MauiWebView.cs b/src/Core/src/Platform/Windows/MauiWebView.cs index 932db7b69f4d..2e235e10e4b0 100644 --- a/src/Core/src/Platform/Windows/MauiWebView.cs +++ b/src/Core/src/Platform/Windows/MauiWebView.cs @@ -45,7 +45,7 @@ public MauiWebView(WebViewHandler handler) : AppContext.BaseDirectory; public async void LoadHtml(string? html, string? baseUrl) - { + { var mapBaseDirectory = false; if (string.IsNullOrEmpty(baseUrl)) { @@ -56,12 +56,12 @@ public async void LoadHtml(string? html, string? baseUrl) await EnsureCoreWebView2Async(); if (mapBaseDirectory) - { - CoreWebView2.SetVirtualHostNameToFolderMapping( - LocalHostName, - ApplicationPath, - Web.WebView2.Core.CoreWebView2HostResourceAccessKind.Allow); - } + { + CoreWebView2.SetVirtualHostNameToFolderMapping( + LocalHostName, + ApplicationPath, + Web.WebView2.Core.CoreWebView2HostResourceAccessKind.Allow); + } // Insert script to set the base tag var script = GetBaseTagInsertionScript(baseUrl); diff --git a/src/Core/src/Platform/Windows/MauiWinUIWindow.cs b/src/Core/src/Platform/Windows/MauiWinUIWindow.cs index 9b477d5a036f..ad9b3461baf4 100644 --- a/src/Core/src/Platform/Windows/MauiWinUIWindow.cs +++ b/src/Core/src/Platform/Windows/MauiWinUIWindow.cs @@ -28,7 +28,7 @@ public MauiWinUIWindow() { _windowManager = WindowMessageManager.Get(this); _viewSettings = new ViewManagement.UISettings(); - + Activated += OnActivated; Closed += OnClosedPrivate; VisibilityChanged += OnVisibilityChanged; diff --git a/src/Core/src/Platform/Windows/NavigationRootManager.cs b/src/Core/src/Platform/Windows/NavigationRootManager.cs index bd1d4bfa7b65..a3845a1fca20 100644 --- a/src/Core/src/Platform/Windows/NavigationRootManager.cs +++ b/src/Core/src/Platform/Windows/NavigationRootManager.cs @@ -113,12 +113,12 @@ public virtual void Connect(UIElement? platformView) public virtual void Disconnect() { _rootView.OnWindowTitleBarContentSizeChanged -= WindowRootViewOnWindowTitleBarContentSizeChanged; - + if (_platformWindow.TryGetTarget(out var platformWindow)) { platformWindow.Activated -= OnWindowActivated; } - + SetToolbar(null); SetTitleBar(null, null); @@ -141,17 +141,17 @@ internal void SetToolbar(FrameworkElement? toolBar) internal string? WindowTitle { - get => _rootView.WindowTitle; - set => _rootView.WindowTitle = value; + get => WindowRootView.WindowTitle; + set => WindowRootView.WindowTitle = value; } internal void SetTitle(string? title) => - _rootView.WindowTitle = title; + WindowRootView.WindowTitle = title; internal void SetTitleBar(ITitleBar? titlebar, IMauiContext? mauiContext) { if (_platformWindow.TryGetTarget(out var window)) - { + { _rootView.AppWindowId = window.GetAppWindow()?.Id; _rootView.SetTitleBar(titlebar, mauiContext); } @@ -164,11 +164,11 @@ void OnWindowActivated(object sender, WindowActivatedEventArgs e) if (e.WindowActivationState == WindowActivationState.Deactivated) { - _rootView.WindowTitleForeground = inactiveForegroundBrush; + WindowRootView.WindowTitleForeground = inactiveForegroundBrush; } else { - _rootView.WindowTitleForeground = defaultForegroundBrush; + WindowRootView.WindowTitleForeground = defaultForegroundBrush; } } } diff --git a/src/Core/src/Platform/Windows/RootNavigationView.cs b/src/Core/src/Platform/Windows/RootNavigationView.cs index dedb3fad3c4d..afec87045eb5 100644 --- a/src/Core/src/Platform/Windows/RootNavigationView.cs +++ b/src/Core/src/Platform/Windows/RootNavigationView.cs @@ -39,13 +39,13 @@ public RootNavigationView() internal new MauiToolbar? Toolbar { - get => base.Toolbar as MauiToolbar; + get => MauiNavigationView.Toolbar as MauiToolbar; set { - if (base.Toolbar == value) + if (MauiNavigationView.Toolbar == value) return; - base.Toolbar = value; + MauiNavigationView.Toolbar = value; if (value != null) { @@ -102,8 +102,8 @@ void UpdateToolbarPlacement() if (Toolbar != null) { - Toolbar.ContentGridMargin = new UI.Xaml.Thickness(0, 0, 4, 0); - Toolbar.TextBlockBorderVerticalAlignment = VerticalAlignment.Center; + MauiToolbar.ContentGridMargin = new UI.Xaml.Thickness(0, 0, 4, 0); + MauiToolbar.TextBlockBorderVerticalAlignment = VerticalAlignment.Center; } } else if (PaneFooter == Toolbar || Header == null) @@ -122,8 +122,8 @@ void UpdateToolbarPlacement() if (Toolbar != null) { - Toolbar.ContentGridMargin = new UI.Xaml.Thickness(0, 0, 0, 0); - Toolbar.TextBlockBorderVerticalAlignment = VerticalAlignment.Top; + MauiToolbar.ContentGridMargin = new UI.Xaml.Thickness(0, 0, 0, 0); + MauiToolbar.TextBlockBorderVerticalAlignment = VerticalAlignment.Top; } } } @@ -257,33 +257,33 @@ void UpdateNavigationAndPaneButtonHolderGridStyles() var buttonHeight = Math.Max(_appBarTitleHeight, DefaultNavigationBackButtonHeight); var buttonRatio = buttonHeight / DefaultNavigationBackButtonHeight; - NavigationBackButtonHeight = buttonHeight; - NavigationBackButtonWidth = DefaultNavigationBackButtonWidth * buttonRatio; + MauiNavigationView.NavigationBackButtonHeight = buttonHeight; + MauiNavigationView.NavigationBackButtonWidth = DefaultNavigationBackButtonWidth * buttonRatio; var paneToggleHeight = Math.Max(_appBarTitleHeight, DefaultPaneToggleButtonHeight); var paneToggleRatio = paneToggleHeight / DefaultPaneToggleButtonHeight; - PaneToggleButtonHeight = paneToggleHeight; - PaneToggleButtonWidth = DefaultPaneToggleButtonWidth * paneToggleRatio; + MauiNavigationView.PaneToggleButtonHeight = paneToggleHeight; + MauiNavigationView.PaneToggleButtonWidth = DefaultPaneToggleButtonWidth * paneToggleRatio; if (PaneDisplayMode == NavigationViewPaneDisplayMode.LeftMinimal || PaneDisplayMode == NavigationViewPaneDisplayMode.Top) { - NavigationViewButtonHolderGridMargin = new WThickness(0, 0, 0, 0); - NavigationViewBackButtonMargin = new WThickness(0, 0, 0, 0); - PaneToggleButtonPadding = new WThickness(); + MauiNavigationView.NavigationViewButtonHolderGridMargin = new WThickness(0, 0, 0, 0); + MauiNavigationView.NavigationViewBackButtonMargin = new WThickness(0, 0, 0, 0); + MauiNavigationView.PaneToggleButtonPadding = new WThickness(); } else if (PaneDisplayMode == NavigationViewPaneDisplayMode.LeftCompact || PaneDisplayMode == NavigationViewPaneDisplayMode.Left || DisplayMode == NavigationViewDisplayMode.Compact) { - NavigationViewButtonHolderGridMargin = new WThickness(0, 0, 0, 0); + MauiNavigationView.NavigationViewButtonHolderGridMargin = new WThickness(0, 0, 0, 0); if (IsPaneToggleButtonVisible) - NavigationViewBackButtonMargin = new WThickness(4, 0, 0, 2); + MauiNavigationView.NavigationViewBackButtonMargin = new WThickness(4, 0, 0, 2); else - NavigationViewBackButtonMargin = new WThickness(4, 0, 0, 0); + MauiNavigationView.NavigationViewBackButtonMargin = new WThickness(4, 0, 0, 0); - PaneToggleButtonPadding = new WThickness(4, 2, 4, 2); + MauiNavigationView.PaneToggleButtonPadding = new WThickness(4, 2, 4, 2); } UpdatePaneContentGridMargin(); @@ -430,7 +430,7 @@ protected override Size ArrangeOverride(Size finalSize) private protected override void UpdateFlyoutCustomContent() { - ReplacePaneMenuItemsWithCustomContent(FlyoutCustomContent as UIElement); + ReplacePaneMenuItemsWithCustomContent(MauiNavigationView.FlyoutCustomContent as UIElement); } } } diff --git a/src/Core/src/Platform/Windows/SliderExtensions.cs b/src/Core/src/Platform/Windows/SliderExtensions.cs index 246d11370c4b..bd4376af3d80 100644 --- a/src/Core/src/Platform/Windows/SliderExtensions.cs +++ b/src/Core/src/Platform/Windows/SliderExtensions.cs @@ -108,7 +108,7 @@ internal static async Task UpdateThumbImageSourceAsync(this MauiSlider nativeSli if (thumbImageSource == null) { - nativeSlider.ThumbImageSource = null; + MauiSlider.ThumbImageSource = null; var thumb = nativeSlider.GetFirstDescendant(); @@ -148,7 +148,7 @@ void OnImageOpened(object sender, RoutedEventArgs e) }; } - nativeSlider.ThumbImageSource = nativeThumbImageSource?.Value; + MauiSlider.ThumbImageSource = nativeThumbImageSource?.Value; } } } diff --git a/src/Core/src/Platform/Windows/TextBoxExtensions.cs b/src/Core/src/Platform/Windows/TextBoxExtensions.cs index 2fb696cf2b57..74c6add110df 100644 --- a/src/Core/src/Platform/Windows/TextBoxExtensions.cs +++ b/src/Core/src/Platform/Windows/TextBoxExtensions.cs @@ -11,14 +11,14 @@ public static class TextBoxExtensions public static void UpdateIsPassword(this TextBox platformControl, IEntry entry) { if (platformControl is MauiPasswordTextBox passwordTextBox) - passwordTextBox.IsPassword = entry.IsPassword; + MauiPasswordTextBox.IsPassword = entry.IsPassword; } public static void UpdateText(this TextBox platformControl, ITextInput textInput) { var newText = textInput.Text; - if (platformControl is MauiPasswordTextBox passwordTextBox && passwordTextBox.Password == newText) + if (platformControl is MauiPasswordTextBox passwordTextBox && MauiPasswordTextBox.Password == newText) return; if (platformControl.Text == newText) diff --git a/src/Core/src/Platform/Windows/ToolbarExtensions.cs b/src/Core/src/Platform/Windows/ToolbarExtensions.cs index b4bd5efb01d8..c915850920f6 100644 --- a/src/Core/src/Platform/Windows/ToolbarExtensions.cs +++ b/src/Core/src/Platform/Windows/ToolbarExtensions.cs @@ -4,7 +4,7 @@ internal static class ToolbarExtensions { public static void UpdateTitle(this MauiToolbar nativeToolbar, IToolbar toolbar) { - nativeToolbar.Title = toolbar.Title; + MauiToolbar.Title = toolbar.Title; } } } diff --git a/src/Core/src/Platform/Windows/WindowRootView.cs b/src/Core/src/Platform/Windows/WindowRootView.cs index 50e2293d6bb9..5de863a33eff 100644 --- a/src/Core/src/Platform/Windows/WindowRootView.cs +++ b/src/Core/src/Platform/Windows/WindowRootView.cs @@ -80,7 +80,7 @@ internal MenuBar? MenuBar } } - public DataTemplate? AppTitleBarTemplate + public static DataTemplate? AppTitleBarTemplate { get => (DataTemplate?)GetValue(AppTitleBarTemplateProperty); set => SetValue(AppTitleBarTemplateProperty, value); @@ -115,7 +115,7 @@ internal FrameworkElement? AppTitleBar internal void UpdateAppTitleBar(int appTitleBarHeight, bool useCustomAppTitleBar, WThickness margin) { _useCustomAppTitleBar = useCustomAppTitleBar; - WindowTitleBarContentControlMinHeight = appTitleBarHeight; + WindowRootView.WindowTitleBarContentControlMinHeight = appTitleBarHeight; double topMargin = appTitleBarHeight; if (AppTitleBarContentControl != null) @@ -125,14 +125,14 @@ internal void UpdateAppTitleBar(int appTitleBarHeight, bool useCustomAppTitleBar if (useCustomAppTitleBar) { - WindowTitleBarContentControlVisibility = UI.Xaml.Visibility.Visible; + WindowRootView.WindowTitleBarContentControlVisibility = UI.Xaml.Visibility.Visible; } else { - WindowTitleBarContentControlVisibility = UI.Xaml.Visibility.Collapsed; + WindowRootView.WindowTitleBarContentControlVisibility = UI.Xaml.Visibility.Collapsed; } - WindowTitleMargin = margin; + WindowRootView.WindowTitleMargin = margin; UpdateRootNavigationViewMargins(topMargin); this.RefreshThemeResources(); } @@ -273,10 +273,10 @@ void UpdateRootNavigationViewMargins(double margin) void LoadAppTitleBarControls() { - if (WindowTitleBarContent is not null && AppTitleBarContentControl is not null) + if (WindowRootView.WindowTitleBarContent is not null && AppTitleBarContentControl is not null) { AppTitleBarContentControl.ContentTemplateSelector = null; - AppTitleBarContentControl.Content = WindowTitleBarContent; + AppTitleBarContentControl.Content = WindowRootView.WindowTitleBarContent; } else if (AppTitleBar != null && AppFontIcon is null) { @@ -408,18 +408,18 @@ void UpdateAppTitleBarMargins() return; } - WThickness currMargin = WindowTitleBarContainerMargin; + WThickness currMargin = WindowRootView.WindowTitleBarContainerMargin; var leftIndent = buttonHolderGrid.ActualWidth; - WindowTitleBarContainerMargin = new WThickness(leftIndent, currMargin.Top, currMargin.Right, currMargin.Bottom); + WindowRootView.WindowTitleBarContainerMargin = new WThickness(leftIndent, currMargin.Top, currMargin.Right, currMargin.Bottom); // If the AppIcon loads correctly then we set a margin for the text from the image if (_hasTitleBarImage) { - WindowTitleIconVisibility = UI.Xaml.Visibility.Visible; + WindowRootView.WindowTitleIconVisibility = UI.Xaml.Visibility.Visible; } else { - WindowTitleIconVisibility = UI.Xaml.Visibility.Collapsed; + WindowRootView.WindowTitleIconVisibility = UI.Xaml.Visibility.Collapsed; } } @@ -430,9 +430,9 @@ void OnButtonHolderGridSizeChanged(object sender, SizeChangedEventArgs e) internal void SetTitleBar(ITitleBar? titlebar, IMauiContext? mauiContext) { - if (WindowTitleBarContent is not null) + if (WindowRootView.WindowTitleBarContent is not null) { - WindowTitleBarContent.LayoutUpdated -= PlatformView_LayoutUpdated; + global::Microsoft.Maui.Platform.WindowRootView.WindowTitleBarContent.LayoutUpdated -= PlatformView_LayoutUpdated; } if (_titleBar is INotifyPropertyChanged p) @@ -452,17 +452,17 @@ internal void SetTitleBar(ITitleBar? titlebar, IMauiContext? mauiContext) if (handler is not null && handler.PlatformView is not null) { - WindowTitleBarContent = handler.PlatformView; + WindowRootView.WindowTitleBarContent = handler.PlatformView; // This will handle all size changed events when leading/trailing/main content // changes size or is added - WindowTitleBarContent.LayoutUpdated += PlatformView_LayoutUpdated; + global::Microsoft.Maui.Platform.WindowRootView.WindowTitleBarContent.LayoutUpdated += PlatformView_LayoutUpdated; // Override the template selector and content if (AppTitleBarContentControl is not null) { AppTitleBarContentControl.ContentTemplateSelector = null; - AppTitleBarContentControl.Content = WindowTitleBarContent; + AppTitleBarContentControl.Content = WindowRootView.WindowTitleBarContent; } // To handle when leading/trailing/main content is added/removed @@ -568,7 +568,7 @@ static void OnAppTitleBarTemplateChanged(DependencyObject d, DependencyPropertyC typeof(WindowRootView), new PropertyMetadata(null)); - internal String? WindowTitle + internal static String? WindowTitle { get => (String?)GetValue(TitleProperty); set => SetValue(TitleProperty, value); @@ -581,7 +581,7 @@ internal String? WindowTitle typeof(WindowRootView), new PropertyMetadata(null)); - internal FrameworkElement WindowTitleBarContent + internal static FrameworkElement WindowTitleBarContent { get => (FrameworkElement)GetValue(WindowTitleBarContentProperty); set => SetValue(WindowTitleBarContentProperty, value); @@ -594,7 +594,7 @@ internal FrameworkElement WindowTitleBarContent typeof(WindowRootView), new PropertyMetadata(null)); - internal UI.Xaml.Media.Brush? WindowTitleForeground + internal static UI.Xaml.Media.Brush? WindowTitleForeground { get => (UI.Xaml.Media.Brush?)GetValue(WindowTitleForegroundProperty); set => SetValue(WindowTitleForegroundProperty, value); @@ -607,7 +607,7 @@ internal UI.Xaml.Media.Brush? WindowTitleForeground typeof(WindowRootView), new PropertyMetadata(new WThickness(0))); - internal WThickness WindowTitleBarContainerMargin + internal static WThickness WindowTitleBarContainerMargin { get => (WThickness)GetValue(WindowTitleBarContainerMarginProperty); set => SetValue(WindowTitleBarContainerMarginProperty, value); @@ -620,7 +620,7 @@ internal WThickness WindowTitleBarContainerMargin typeof(WindowRootView), new PropertyMetadata(new WThickness(0))); - internal WThickness WindowTitleMargin + internal static WThickness WindowTitleMargin { get => (WThickness)GetValue(WindowTitleMarginProperty); set => SetValue(WindowTitleMarginProperty, value); @@ -633,7 +633,7 @@ internal WThickness WindowTitleMargin typeof(WindowRootView), new PropertyMetadata(UI.Xaml.Visibility.Collapsed)); - internal UI.Xaml.Visibility WindowTitleIconVisibility + internal static UI.Xaml.Visibility WindowTitleIconVisibility { get => (UI.Xaml.Visibility)GetValue(WindowTitleIconVisibilityProperty); set => SetValue(WindowTitleIconVisibilityProperty, value); @@ -646,7 +646,7 @@ internal UI.Xaml.Visibility WindowTitleIconVisibility typeof(WindowRootView), new PropertyMetadata(UI.Xaml.Visibility.Visible)); - internal UI.Xaml.Visibility WindowTitleBarContentControlVisibility + internal static UI.Xaml.Visibility WindowTitleBarContentControlVisibility { get => (UI.Xaml.Visibility)GetValue(WindowTitleBarContentControlVisibilityProperty); set => SetValue(WindowTitleBarContentControlVisibilityProperty, value); @@ -659,7 +659,7 @@ internal UI.Xaml.Visibility WindowTitleBarContentControlVisibility typeof(WindowRootView), new PropertyMetadata(0d)); - internal double WindowTitleBarContentControlMinHeight + internal static double WindowTitleBarContentControlMinHeight { get => (double)GetValue(WindowTitleBarContentControlMinHeightProperty); set => SetValue(WindowTitleBarContentControlMinHeightProperty, value); diff --git a/src/Core/src/Platform/iOS/CALayerAutosizeObserver.cs b/src/Core/src/Platform/iOS/CALayerAutosizeObserver.cs index 6d15aab5ccbf..905946867b66 100644 --- a/src/Core/src/Platform/iOS/CALayerAutosizeObserver.cs +++ b/src/Core/src/Platform/iOS/CALayerAutosizeObserver.cs @@ -30,8 +30,8 @@ private CALayerAutosizeObserver(CALayer layer) IsDirectBinding = false; } - [Preserve (Conditional = true)] - public override void ObserveValue (NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr context) + [Preserve(Conditional = true)] + public override void ObserveValue(NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr context) { if (!_disposed && keyPath == _boundsKey && context == Handle && _layerReference.TryGetTarget(out var layer)) { diff --git a/src/Core/src/Platform/iOS/ContentView.cs b/src/Core/src/Platform/iOS/ContentView.cs index 5f6f14398f95..583607db5d36 100644 --- a/src/Core/src/Platform/iOS/ContentView.cs +++ b/src/Core/src/Platform/iOS/ContentView.cs @@ -43,7 +43,7 @@ internal IBorderStroke? Clip } } - UIView? PlatformContent + static UIView? PlatformContent { get { @@ -69,7 +69,7 @@ void RemoveContentMask() void UpdateClip() { - var content = PlatformContent; + var content = ContentView.PlatformContent; if (Clip is null || Bounds == CGRect.Empty || content == null || content.Frame == CGRect.Empty) { @@ -131,7 +131,7 @@ void UpdateClip() public override void WillRemoveSubview(UIView uiview) { // Make sure we're not holding a mask for content we no longer own - if (uiview == PlatformContent) + if (uiview == ContentView.PlatformContent) { RemoveContentMask(); } diff --git a/src/Core/src/Platform/iOS/GeneralWrapperView.cs b/src/Core/src/Platform/iOS/GeneralWrapperView.cs index 923f61c7ceaf..bf7a8f5d0b2d 100644 --- a/src/Core/src/Platform/iOS/GeneralWrapperView.cs +++ b/src/Core/src/Platform/iOS/GeneralWrapperView.cs @@ -5,67 +5,67 @@ namespace Microsoft.Maui.Platform; class GeneralWrapperView : MauiView, ICrossPlatformLayout { - public WeakReference? ChildView { get; private set; } + public WeakReference? ChildView { get; private set; } - public GeneralWrapperView(IView childView, IMauiContext mauiContext) - { - CrossPlatformLayout = this; - UpdatePlatformView(childView, mauiContext); - } + public GeneralWrapperView(IView childView, IMauiContext mauiContext) + { + CrossPlatformLayout = this; + UpdatePlatformView(childView, mauiContext); + } - public void Disconnect() - { - if (ChildView is null || !ChildView.TryGetTarget(out var childView)) - { - return; - } + public void Disconnect() + { + if (ChildView is null || !ChildView.TryGetTarget(out var childView)) + { + return; + } - childView.DisconnectHandlers(); - } + childView.DisconnectHandlers(); + } - public void UpdatePlatformView(IView? newChildView, IMauiContext mauiContext) - { - if (Subviews.Length > 0) - { - Subviews[0].RemoveFromSuperview(); - } + public void UpdatePlatformView(IView? newChildView, IMauiContext mauiContext) + { + if (Subviews.Length > 0) + { + Subviews[0].RemoveFromSuperview(); + } - if (newChildView is null) - { - ChildView = null; - return; - } + if (newChildView is null) + { + ChildView = null; + return; + } - ChildView = new(newChildView); + ChildView = new(newChildView); - var nativeView = newChildView.ToPlatform(mauiContext); + var nativeView = newChildView.ToPlatform(mauiContext); - if (nativeView is WrapperView) - { - // Disable clipping for WrapperView to allow the shadow to be displayed - ClipsToBounds = false; - } - else - { - ClipsToBounds = true; - } + if (nativeView is WrapperView) + { + // Disable clipping for WrapperView to allow the shadow to be displayed + ClipsToBounds = false; + } + else + { + ClipsToBounds = true; + } - AddSubview(nativeView); - } + AddSubview(nativeView); + } - public Size CrossPlatformArrange(Rect bounds) - { - if (ChildView == null || !ChildView.TryGetTarget(out var childView)) - return Size.Zero; + public Size CrossPlatformArrange(Rect bounds) + { + if (ChildView == null || !ChildView.TryGetTarget(out var childView)) + return Size.Zero; - return childView.Arrange(bounds); - } + return childView.Arrange(bounds); + } - public Size CrossPlatformMeasure(double widthConstraint, double heightConstraint) - { - if (ChildView == null || !ChildView.TryGetTarget(out var childView)) - return Size.Zero; + public Size CrossPlatformMeasure(double widthConstraint, double heightConstraint) + { + if (ChildView == null || !ChildView.TryGetTarget(out var childView)) + return Size.Zero; - return childView.Measure(widthConstraint, heightConstraint); - } + return childView.Measure(widthConstraint, heightConstraint); + } } diff --git a/src/Core/src/Platform/iOS/MauiDatePicker.cs b/src/Core/src/Platform/iOS/MauiDatePicker.cs index c77cad85ddbe..f36235675f45 100644 --- a/src/Core/src/Platform/iOS/MauiDatePicker.cs +++ b/src/Core/src/Platform/iOS/MauiDatePicker.cs @@ -57,7 +57,7 @@ internal MauiDatePickerDelegate? MauiDatePickerDelegate set => _proxy.MauiDatePickerDelegate = value; } - internal UIDatePicker? DatePickerDialog { get { return InputView as UIDatePicker; } } + internal static UIDatePicker? DatePickerDialog { get { return InputView as UIDatePicker; } } class UIDatePickerProxy { diff --git a/src/Core/src/Platform/iOS/MauiPageControl.cs b/src/Core/src/Platform/iOS/MauiPageControl.cs index 66dfa2f8456a..dc8913f79d2a 100644 --- a/src/Core/src/Platform/iOS/MauiPageControl.cs +++ b/src/Core/src/Platform/iOS/MauiPageControl.cs @@ -102,7 +102,7 @@ void UpdateSquareShape() { if (!(OperatingSystem.IsIOSVersionAtLeast(14) || OperatingSystem.IsTvOSVersionAtLeast(14))) { - UpdateCornerRadius(); + MauiPageControl.UpdateCornerRadius(); return; } @@ -125,7 +125,7 @@ void UpdateSquareShape() } } - void UpdateCornerRadius() + static void UpdateCornerRadius() { foreach (var view in Subviews) { diff --git a/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs b/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs index ba7d36fcb46d..766665dfadbb 100644 --- a/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs +++ b/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs @@ -69,7 +69,7 @@ public FlyoutUIContextMenuInteractionDelegate() { } - public UIContextMenuConfiguration? GetConfigurationForMenu(UIContextMenuInteraction interaction, CGPoint location) + public static UIContextMenuConfiguration? GetConfigurationForMenu(UIContextMenuInteraction interaction, CGPoint location) { if (interaction is MauiUIContextMenuInteraction contextMenu) return contextMenu.GetConfigurationForMenu(); diff --git a/src/Core/src/Platform/iOS/MauiView.cs b/src/Core/src/Platform/iOS/MauiView.cs index 1d9b985611e7..6b65b4bdf435 100644 --- a/src/Core/src/Platform/iOS/MauiView.cs +++ b/src/Core/src/Platform/iOS/MauiView.cs @@ -24,7 +24,7 @@ public IView? View set => _reference = value == null ? null : new(value); } - bool RespondsToSafeArea() + static bool RespondsToSafeArea() { if (_respondsToSafeArea.HasValue) return _respondsToSafeArea.Value; @@ -38,7 +38,7 @@ protected CGRect AdjustForSafeArea(CGRect bounds) KeyboardAutoManagerScroll.ShouldScrollAgain = true; } - if (View is not ISafeAreaView sav || sav.IgnoreSafeArea || !RespondsToSafeArea()) + if (View is not ISafeAreaView sav || sav.IgnoreSafeArea || !MauiView.RespondsToSafeArea()) { return bounds; } diff --git a/src/Core/src/Platform/iOS/StaticCALayer.cs b/src/Core/src/Platform/iOS/StaticCALayer.cs index 48cb7ecaa848..f5eeeeddc287 100644 --- a/src/Core/src/Platform/iOS/StaticCALayer.cs +++ b/src/Core/src/Platform/iOS/StaticCALayer.cs @@ -27,7 +27,7 @@ void IAutoSizableCALayer.AutoSizeToSuperLayer() _boundsObserver?.Dispose(); _boundsObserver = CALayerAutosizeObserver.Attach(this); } - + public override void AddAnimation(CAAnimation animation, string? key) { // Do nothing, we don't want animations here diff --git a/src/Core/src/Platform/iOS/StaticCAShapeLayer.cs b/src/Core/src/Platform/iOS/StaticCAShapeLayer.cs index 31600cc495a7..6d753e641b2f 100644 --- a/src/Core/src/Platform/iOS/StaticCAShapeLayer.cs +++ b/src/Core/src/Platform/iOS/StaticCAShapeLayer.cs @@ -27,7 +27,7 @@ void IAutoSizableCALayer.AutoSizeToSuperLayer() _boundsObserver?.Dispose(); _boundsObserver = CALayerAutosizeObserver.Attach(this); } - + public override void AddAnimation(CAAnimation animation, string? key) { // Do nothing, we don't want animations here diff --git a/src/Core/src/Platform/iOS/WindowExtensions.cs b/src/Core/src/Platform/iOS/WindowExtensions.cs index 65e2f745358b..a7252d31a1a2 100644 --- a/src/Core/src/Platform/iOS/WindowExtensions.cs +++ b/src/Core/src/Platform/iOS/WindowExtensions.cs @@ -36,9 +36,9 @@ internal static void UpdateHeight(this UIWindow platformWindow, IWindow window) internal static void UpdateCoordinates(this UIWindow platformWindow, IWindow window) { - if (OperatingSystem.IsMacCatalyst() && OperatingSystem.IsIOSVersionAtLeast(16) && platformWindow.WindowScene is {} windowScene) + if (OperatingSystem.IsMacCatalyst() && OperatingSystem.IsIOSVersionAtLeast(16) && platformWindow.WindowScene is { } windowScene) { - if (double.IsNaN(window.X) || double.IsNaN(window.Y) || double.IsNaN(window.Width) || double.IsNaN(window.Height)) + if (double.IsNaN(window.X) || double.IsNaN(window.Y) || double.IsNaN(window.Width) || double.IsNaN(window.Height)) { return; } @@ -48,7 +48,8 @@ internal static void UpdateCoordinates(this UIWindow platformWindow, IWindow win SystemFrame = new CGRect(window.X, window.Y, window.Width, window.Height) }; - windowScene.RequestGeometryUpdate(preferences, (error) => { + windowScene.RequestGeometryUpdate(preferences, (error) => + { window.Handler?.MauiContext?.CreateLogger()?.LogError("Requesting geometry update failed with error '{error}'.", error); }); } diff --git a/src/Core/src/Platform/iOS/WrapperView.cs b/src/Core/src/Platform/iOS/WrapperView.cs index 88e00dd51538..186fc53fae71 100644 --- a/src/Core/src/Platform/iOS/WrapperView.cs +++ b/src/Core/src/Platform/iOS/WrapperView.cs @@ -56,7 +56,7 @@ internal void CacheMeasureConstraints(double widthConstraint, double heightConst get => _maskLayer; set { - var layer = GetLayer(); + var layer = WrapperView.GetLayer(); if (layer is not null && _maskLayer is not null) layer.Mask = null; @@ -73,7 +73,7 @@ internal void CacheMeasureConstraints(double widthConstraint, double heightConst get => _backgroundMaskLayer; set { - var backgroundLayer = GetBackgroundLayer(); + var backgroundLayer = WrapperView.GetBackgroundLayer(); if (backgroundLayer is not null && _backgroundMaskLayer is not null) backgroundLayer.Mask = null; @@ -291,7 +291,7 @@ void SetClip() mask ??= MaskLayer = new StaticCAShapeLayer(); mask.Path = nativePath; - var backgroundLayer = GetBackgroundLayer(); + var backgroundLayer = WrapperView.GetBackgroundLayer(); // We wrap some controls for certain visual effects like applying background gradient etc. // For this reason, we have to clip the background layer as well if it exists. @@ -342,7 +342,7 @@ void SetBorder() _borderView.UpdateMauiCALayer(Border); } - CALayer? GetLayer() + static CALayer? GetLayer() { var sublayers = Layer?.Sublayers; if (sublayers is null) @@ -355,7 +355,7 @@ void SetBorder() return Layer; } - CALayer? GetBackgroundLayer() + static CALayer? GetBackgroundLayer() { var sublayers = Layer?.Sublayers; if (sublayers is null) diff --git a/src/Core/src/Primitives/KeyboardFlags.cs b/src/Core/src/Primitives/KeyboardFlags.cs index e75e323a753c..b8ca91118808 100644 --- a/src/Core/src/Primitives/KeyboardFlags.cs +++ b/src/Core/src/Primitives/KeyboardFlags.cs @@ -12,37 +12,37 @@ public enum KeyboardFlags /// Indicates that nothing will be automatically capitalized. /// None = 0, - + /// /// Indicates that the first letters of the first words of each sentence will be automatically capitalized. /// CapitalizeSentence = 1, - + /// /// Perform spellcheck on text that the user enters. /// Spellcheck = 1 << 1, - + /// /// Offer suggested word completions on text that the user enters. /// Suggestions = 1 << 2, - + /// /// Indicates that the first letter of each word will be automatically capitalized. /// CapitalizeWord = 1 << 3, - + /// /// Indicates that every character will be automatically capitalized. /// CapitalizeCharacter = 1 << 4, - + /// /// Indicates that nothing will be automatically capitalized. /// CapitalizeNone = 1 << 5, - + /// /// Capitalize the first letter of the first words of sentences, perform spellcheck, and offer suggested word completions on text that the user enters. /// diff --git a/src/Core/tests/DeviceTests/Handlers/DatePicker/DatePickerHandlerTests.Windows.cs b/src/Core/tests/DeviceTests/Handlers/DatePicker/DatePickerHandlerTests.Windows.cs index 3f63aa7c6596..c077a59de555 100644 --- a/src/Core/tests/DeviceTests/Handlers/DatePicker/DatePickerHandlerTests.Windows.cs +++ b/src/Core/tests/DeviceTests/Handlers/DatePicker/DatePickerHandlerTests.Windows.cs @@ -30,7 +30,7 @@ public override async Task ReturnsNonEmptyNativeBoundingBox(int size) var expectedSize = new Size(size, size); AssertWithinTolerance(expectedSize, nativeBoundingBox.Size); } - + [Fact] public override async Task DisconnectHandlerDoesntCrash() { diff --git a/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs b/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs index 881348cb7ec0..80d0b77ec218 100644 --- a/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs +++ b/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs @@ -118,7 +118,7 @@ await handler.PlatformView.AttachAndRun(async () => }); } - UI.Xaml.Controls.Slider GetNativeSlider(SliderHandler sliderHandler) => + UI.Xaml.Controls.Slider GetNativeSlider(SliderHandler sliderHandler) => sliderHandler.PlatformView; double GetNativeProgress(SliderHandler sliderHandler) => @@ -163,7 +163,7 @@ async Task ValidateNativeThumbColor(ISlider slider, Color color) return solidThumb.Color.ToColor(); } } - + return null; }); diff --git a/src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.Windows.cs b/src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.Windows.cs index 47b1241fb7ed..a0900a7a1dbc 100644 --- a/src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.Windows.cs +++ b/src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.Windows.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; -using Microsoft.UI.Xaml.Controls; using Microsoft.Maui.DeviceTests.Stubs; +using Microsoft.UI.Xaml.Controls; using Xunit; using Color = Microsoft.Maui.Graphics.Color; diff --git a/src/Core/tests/DeviceTests/Memory/CALayerAutosizeObserverTests.cs b/src/Core/tests/DeviceTests/Memory/CALayerAutosizeObserverTests.cs index 75436bc8805e..3548fb8d8851 100644 --- a/src/Core/tests/DeviceTests/Memory/CALayerAutosizeObserverTests.cs +++ b/src/Core/tests/DeviceTests/Memory/CALayerAutosizeObserverTests.cs @@ -1,9 +1,9 @@ #if IOS || MACCATALYST -using Microsoft.Maui.Platform; using System; using System.Threading.Tasks; using CoreAnimation; +using Microsoft.Maui.Platform; using UIKit; using Xunit; diff --git a/src/Essentials/src/Connectivity/Connectivity.uwp.cs b/src/Essentials/src/Connectivity/Connectivity.uwp.cs index fe8f8360d668..b5f0bfae060d 100644 --- a/src/Essentials/src/Connectivity/Connectivity.uwp.cs +++ b/src/Essentials/src/Connectivity/Connectivity.uwp.cs @@ -81,7 +81,7 @@ public IEnumerable ConnectionProfiles { networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); } - catch (NetworkInformationException ex) + catch (NetworkInformationException ex) { Debug.WriteLine($"Unable to get network interfaces. Error: {ex.Message}"); } diff --git a/src/Essentials/src/Screenshot/Screenshot.uwp.cs b/src/Essentials/src/Screenshot/Screenshot.uwp.cs index 98a197d5b6f1..55e56ba40a8c 100644 --- a/src/Essentials/src/Screenshot/Screenshot.uwp.cs +++ b/src/Essentials/src/Screenshot/Screenshot.uwp.cs @@ -2,12 +2,12 @@ using System.IO; using System.Runtime.InteropServices.WindowsRuntime; using System.Threading.Tasks; -using Windows.Graphics.Imaging; -using Windows.Storage.Streams; using Microsoft.Maui.ApplicationModel; using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Media.Imaging; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media.Imaging; +using Windows.Graphics.Imaging; +using Windows.Storage.Streams; namespace Microsoft.Maui.Media { diff --git a/src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs b/src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs index 1948554b0247..3b55a1c7bc9a 100644 --- a/src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs +++ b/src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs @@ -406,11 +406,11 @@ protected override void PlatformDrawLine(float x1, float y1, float x2, float y2) } // Normalize the angle to be between 0 and 2PI - float NormalizeAngle(float angle) - { - var twoPi = MathF.PI * 2; - return (angle % twoPi + twoPi) % twoPi; - } + float NormalizeAngle(float angle) + { + var twoPi = MathF.PI * 2; + return (angle % twoPi + twoPi) % twoPi; + } protected override void PlatformDrawArc(float x, float y, float width, float height, float startAngle, float endAngle, bool clockwise, bool close) { diff --git a/src/Graphics/tests/Graphics.Tests/SkiaSharpScenarioTests.cs b/src/Graphics/tests/Graphics.Tests/SkiaSharpScenarioTests.cs index ab4a90ddce10..edbc0f0df1b9 100644 --- a/src/Graphics/tests/Graphics.Tests/SkiaSharpScenarioTests.cs +++ b/src/Graphics/tests/Graphics.Tests/SkiaSharpScenarioTests.cs @@ -35,7 +35,7 @@ public void Scenario(string scenarioName) Directory.CreateDirectory(Path.GetDirectoryName(newImageFilename)); bmp.WriteToFile(newImageFilename); - + Assert.Fail($"Image file did not exist, created: {newImageFilename}"); } diff --git a/src/SingleProject/Resizetizer/src/SkiaSharpTools.cs b/src/SingleProject/Resizetizer/src/SkiaSharpTools.cs index 2ca629a7103e..99e5db95fa7f 100644 --- a/src/SingleProject/Resizetizer/src/SkiaSharpTools.cs +++ b/src/SingleProject/Resizetizer/src/SkiaSharpTools.cs @@ -1,8 +1,8 @@ using System; using System.Diagnostics; using System.IO; -using System.Threading; using System.Runtime.InteropServices; +using System.Threading; using SkiaSharp; namespace Microsoft.Maui.Resizetizer @@ -23,11 +23,12 @@ internal abstract class SkiaSharpTools /// set. /// /// The value of DOTNET_ANDROID_FILE_WRITE_RETRY_ATTEMPTS or the default of DEFAULT_FILE_WRITE_RETRY_ATTEMPTS - public static int GetFileWriteRetryAttempts () + public static int GetFileWriteRetryAttempts() { - if (fileWriteRetry == -1) { - var retryVariable = Environment.GetEnvironmentVariable ("DOTNET_ANDROID_FILE_WRITE_RETRY_ATTEMPTS"); - if (string.IsNullOrEmpty (retryVariable) || !int.TryParse (retryVariable, out fileWriteRetry)) + if (fileWriteRetry == -1) + { + var retryVariable = Environment.GetEnvironmentVariable("DOTNET_ANDROID_FILE_WRITE_RETRY_ATTEMPTS"); + if (string.IsNullOrEmpty(retryVariable) || !int.TryParse(retryVariable, out fileWriteRetry)) fileWriteRetry = DEFAULT_FILE_WRITE_RETRY_ATTEMPTS; } return fileWriteRetry; @@ -39,15 +40,16 @@ public static int GetFileWriteRetryAttempts () /// set. /// /// The value of DOTNET_ANDROID_FILE_WRITE_RETRY_DELAY_MS or the default of DEFAULT_FILE_WRITE_RETRY_DELAY_MS - public static int GetFileWriteRetryDelay () + public static int GetFileWriteRetryDelay() { - if (fileWriteRetryDelay == -1) { - var delayVariable = Environment.GetEnvironmentVariable ("DOTNET_ANDROID_FILE_WRITE_RETRY_DELAY_MS"); - if (string.IsNullOrEmpty (delayVariable) || !int.TryParse (delayVariable, out fileWriteRetryDelay)) + if (fileWriteRetryDelay == -1) + { + var delayVariable = Environment.GetEnvironmentVariable("DOTNET_ANDROID_FILE_WRITE_RETRY_DELAY_MS"); + if (string.IsNullOrEmpty(delayVariable) || !int.TryParse(delayVariable, out fileWriteRetryDelay)) fileWriteRetryDelay = DEFAULT_FILE_WRITE_RETRY_DELAY_MS; } return fileWriteRetryDelay; - } + } static SkiaSharpTools() { @@ -193,8 +195,8 @@ void Draw(SKBitmap tempBitmap, double additionalScale, SKSize originalSize, floa void Save(string destination, SKBitmap tempBitmap) { int attempt = 0; - int attempts = GetFileWriteRetryAttempts (); - int delay = GetFileWriteRetryDelay (); + int attempts = GetFileWriteRetryAttempts(); + int delay = GetFileWriteRetryDelay(); while (attempt <= attempts) { try @@ -210,7 +212,7 @@ void Save(string destination, SKBitmap tempBitmap) case UnauthorizedAccessException: case IOException: var code = Marshal.GetHRForException(ex); - if ((code != ERROR_ACCESS_DENIED && code != ERROR_SHARING_VIOLATION) || attempt >= attempts) + if ((code != ERROR_ACCESS_DENIED && code != ERROR_SHARING_VIOLATION) || attempt >= attempts) { throw; } diff --git a/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs b/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs index a7c83e7f9be8..3732f1a2f43c 100644 --- a/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs +++ b/src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs @@ -10,10 +10,10 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Automation; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media.Imaging; using Windows.Graphics.DirectX; using Windows.Storage.Streams; -using Microsoft.UI.Xaml.Input; using Xunit; using Xunit.Sdk; using WColor = Windows.UI.Color; diff --git a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MacTemplateTest.cs b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MacTemplateTest.cs index 18a761e91589..a5625b047538 100644 --- a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MacTemplateTest.cs +++ b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MacTemplateTest.cs @@ -109,10 +109,10 @@ public void CheckPrivacyManifestForiOS(string id, string config, string framewor List buildWithCodeSignProps = new List(BuildProps); - if(!sign && config == "Release") + if (!sign && config == "Release") { // Skipping Release build without code signing." - buildWithCodeSignProps.Add("EnableCodeSigning=false"); + buildWithCodeSignProps.Add("EnableCodeSigning=false"); buildWithCodeSignProps.Add("_RequireCodeSigning=false"); } else if (sign) diff --git a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs index 30db22f8093a..0a12c99e9e4d 100644 --- a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs +++ b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs @@ -7,7 +7,7 @@ public class SimpleTemplateTest : BaseTemplateTests { [Test] // Parameters: short name, target framework, build config, use pack target, additionalDotNetNewParams, additionalDotNetBuildParams - [TestCase("maui", DotNetPrevious, "Debug", false, "","")] + [TestCase("maui", DotNetPrevious, "Debug", false, "", "")] [TestCase("maui", DotNetPrevious, "Release", false, "", "")] [TestCase("maui", DotNetCurrent, "Debug", false, "", "")] [TestCase("maui", DotNetCurrent, "Release", false, "", "TrimMode=partial")] @@ -17,13 +17,13 @@ public class SimpleTemplateTest : BaseTemplateTests [TestCase("maui-blazor", DotNetPrevious, "Release", false, "", "")] [TestCase("maui-blazor", DotNetCurrent, "Debug", false, "", "")] [TestCase("maui-blazor", DotNetCurrent, "Release", false, "", "TrimMode=partial")] - [TestCase("maui-blazor", DotNetCurrent, "Debug", false, "--Empty","")] - [TestCase("maui-blazor", DotNetCurrent, "Release", false, "--Empty","TrimMode=partial")] + [TestCase("maui-blazor", DotNetCurrent, "Debug", false, "--Empty", "")] + [TestCase("maui-blazor", DotNetCurrent, "Release", false, "--Empty", "TrimMode=partial")] [TestCase("mauilib", DotNetPrevious, "Debug", true, "", "")] - [TestCase("mauilib", DotNetPrevious, "Release", true, "","")] + [TestCase("mauilib", DotNetPrevious, "Release", true, "", "")] [TestCase("mauilib", DotNetCurrent, "Debug", true, "", "")] [TestCase("mauilib", DotNetCurrent, "Release", true, "", "TrimMode=partial")] - public void Build(string id, string framework, string config, bool shouldPack, string additionalDotNetNewParams, string additionalDotNetBuildParams) + public void Build(string id, string framework, string config, bool shouldPack, string additionalDotNetNewParams, string additionalDotNetBuildParams) { var projectDir = TestDirectory; var projectFile = Path.Combine(projectDir, $"{Path.GetFileName(projectDir)}.csproj"); @@ -49,7 +49,7 @@ public void Build(string id, string framework, string config, bool shouldPack, s "XC0103", // https://github.com/CommunityToolkit/Maui/issues/2205 }; } - + var buildProps = BuildProps; if (additionalDotNetBuildParams is not "" and not null) @@ -131,9 +131,9 @@ public void BuildsWithSpecialCharacters(string id, string projectName, string ex [TestCase("maui", DotNetPrevious, "Release", false, "")] [TestCase("maui", DotNetCurrent, "Debug", false, "")] [TestCase("maui", DotNetCurrent, "Release", false, "TrimMode=partial")] - [TestCase("maui-blazor", DotNetPrevious, "Debug", false, "")] - [TestCase("maui-blazor", DotNetPrevious, "Release", false, "")] - [TestCase("maui-blazor", DotNetCurrent, "Debug", false, "")] + [TestCase("maui-blazor", DotNetPrevious, "Debug", false, "")] + [TestCase("maui-blazor", DotNetPrevious, "Release", false, "")] + [TestCase("maui-blazor", DotNetCurrent, "Debug", false, "")] [TestCase("maui-blazor", DotNetCurrent, "Release", false, "TrimMode=partial")] [TestCase("mauilib", DotNetPrevious, "Debug", true, "")] [TestCase("mauilib", DotNetPrevious, "Release", true, "")] @@ -301,7 +301,7 @@ public void BuildWithoutPackageReference(string id, string framework, string con [TestCase("maui", "Release", "2.0", "2", "TrimMode=partial")] [TestCase("maui", "Release", "0.3", "3", "TrimMode=partial")] [TestCase("maui-blazor", "Debug", "2.0", "2", "")] - [TestCase("maui-blazor", "Release", "2.0", "2", "TrimMode=partial")] + [TestCase("maui-blazor", "Release", "2.0", "2", "TrimMode=partial")] [TestCase("maui-blazor", "Release", "0.3", "3", "TrimMode=partial")] public void BuildWithDifferentVersionNumber(string id, string config, string display, string version, string additionalDotNetBuildParams) { @@ -325,7 +325,7 @@ public void BuildWithDifferentVersionNumber(string id, string config, string dis { additionalDotNetBuildParams.Split(" ").ToList().ForEach(p => buildProps.Add(p)); } - + Assert.IsTrue(DotnetInternal.Build(projectFile, config, properties: buildProps, msbuildWarningsAsErrors: true), $"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors."); } diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumAndroidSpecificActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumAndroidSpecificActions.cs index f439cd45af1d..f894153f5dfa 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumAndroidSpecificActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumAndroidSpecificActions.cs @@ -134,7 +134,7 @@ CommandResponse ToggleSystemAnimations(IDictionary parameters) return CommandResponse.FailedEmptyResponse; } } - + CommandResponse GetSystemBars(IDictionary parameters) { if (_appiumApp.Driver is AndroidDriver androidDriver) diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumCatalystSpecificActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumCatalystSpecificActions.cs index 75c1f2dfc627..63b8f64b15f6 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumCatalystSpecificActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumCatalystSpecificActions.cs @@ -6,7 +6,7 @@ public class AppiumCatalystSpecificActions : ICommandExecutionGroup { const string EnterFullScreenCommand = "enterFullScreen"; const string ExitFullScreenCommand = "exitFullScreen"; - + readonly AppiumApp _appiumApp; readonly List _commands = new() @@ -34,7 +34,7 @@ public CommandResponse Execute(string commandName, IDictionary p _ => CommandResponse.FailedEmptyResponse, }; } - + CommandResponse EnterFullScreen(IDictionary parameters) { try @@ -48,7 +48,7 @@ CommandResponse EnterFullScreen(IDictionary parameters) return CommandResponse.FailedEmptyResponse; } } - + CommandResponse ExitFullScreen(IDictionary parameters) { try diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumClipboardActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumClipboardActions.cs index 37124f298b03..5cae1f96cc1b 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumClipboardActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumClipboardActions.cs @@ -49,12 +49,12 @@ CommandResponse GetClipboardText(IDictionary parameters) if (!string.IsNullOrEmpty(clipboardText)) return new CommandResponse(clipboardText, CommandResponseResult.Success); - + return CommandResponse.FailedEmptyResponse; } CommandResponse SetClipboardText(IDictionary parameters) - { + { var content = (string)parameters["content"]; var label = (string?)parameters["label"]; diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumOrientationActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumOrientationActions.cs index 3d3a9de76cbd..ec96cbef0854 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumOrientationActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumOrientationActions.cs @@ -15,7 +15,7 @@ public class AppiumOrientationActions : ICommandExecutionGroup SetOrientationPortraitCommand, SetOrientationLandscapeCommand, GetOrientationCommand, - }; + }; public AppiumOrientationActions(AppiumApp app) { diff --git a/src/TestUtils/src/UITest.Appium/HelperExtensions.cs b/src/TestUtils/src/UITest.Appium/HelperExtensions.cs index 07bd4cbe4678..61aa047d11ab 100644 --- a/src/TestUtils/src/UITest.Appium/HelperExtensions.cs +++ b/src/TestUtils/src/UITest.Appium/HelperExtensions.cs @@ -1236,7 +1236,7 @@ public static string GetClipboardText(this IApp app) } var response = app.CommandExecutor.Execute("getClipboardText", new Dictionary()); - + if (response?.Value != null) { return (string)response.Value; @@ -1727,8 +1727,8 @@ public static void ToggleSystemAnimations(this IApp app, bool enableSystemAnimat { "enableSystemAnimations", enableSystemAnimations }, }); } - - /// + + /// /// Switch the state of data service. /// Functionality that's only available on Android. /// This API does not work for Android API level 21+ because it requires system or carrier privileged permission, @@ -1773,13 +1773,13 @@ public static IList GetPerformanceData(this IApp app, string performance throw new InvalidOperationException($"Could not get the performance data"); } - + /// /// Maximize the active App window. /// /// Represents the main gateway to interact with an app. public static void EnterFullScreen(this IApp app) - { + { if (app is not AppiumCatalystApp) { throw new InvalidOperationException($"EnterFullScreen is only supported on AppiumCatalystApp"); @@ -1793,7 +1793,7 @@ public static void EnterFullScreen(this IApp app) /// /// Represents the main gateway to interact with an app. public static void ExitFullScreen(this IApp app) - { + { if (app is not AppiumCatalystApp) { throw new InvalidOperationException($"ExitFullScreen is only supported on AppiumCatalystApp"); @@ -1801,7 +1801,7 @@ public static void ExitFullScreen(this IApp app) app.CommandExecutor.Execute("exitFullScreen", new Dictionary()); } - + /// /// Retrieve visibility and bounds information of the status and navigation bars /// @@ -1822,8 +1822,8 @@ public static IDictionary GetSystemBars(this IApp app) } throw new InvalidOperationException($"Could not get the Android System Bars"); - } - + } + /// /// Navigates back in the application by simulating a tap on the platform-specific back navigation button or using a custom identifier. /// @@ -1847,7 +1847,7 @@ public static void TapBackArrow(this IApp app, IQuery query) { app.Tap(query); } - + /// /// Gets the default query for the back arrow button based on the app type. /// @@ -1895,7 +1895,7 @@ static IQuery GetCustomBackArrowQuery(IApp app, string customBackButtonIdentifie /// Optional timeout for the wait operation. Default is null, which uses the default timeout. public static void WaitForElementTillPageNavigationSettled(this IApp app, string elementId, TimeSpan? timeout = null) { - if(app is AppiumCatalystApp) + if (app is AppiumCatalystApp) app.WaitForElement(AppiumQuery.ById(elementId), timeout: timeout); app.WaitForElement(elementId, timeout: timeout); @@ -1910,7 +1910,7 @@ public static void WaitForElementTillPageNavigationSettled(this IApp app, string /// Optional timeout for the wait operation. Default is null, which uses the default timeout. public static void WaitForElementTillPageNavigationSettled(this IApp app, IQuery query, TimeSpan? timeout = null) { - if(app is AppiumCatalystApp) + if (app is AppiumCatalystApp) app.WaitForElement(query, timeout: timeout); app.WaitForElement(query, timeout: timeout); @@ -1924,17 +1924,19 @@ public static void WaitForElementTillPageNavigationSettled(this IApp app, IQuery /// Indicates whether the app is using Shell navigation (default is true). public static void WaitForFlyoutIcon(this IApp app, string automationId = "", bool isShell = true) { - if(app is AppiumAndroidApp) + if (app is AppiumAndroidApp) { app.WaitForElement(AppiumQuery.ByXPath("//android.widget.ImageButton[@content-desc=\"Open navigation drawer\"]")); } else if (app is AppiumIOSApp || app is AppiumCatalystApp || app is AppiumWindowsApp) { - if(isShell){ + if (isShell) + { app.WaitForElement("OK"); } - if (!isShell){ - if(app is AppiumWindowsApp) + if (!isShell) + { + if (app is AppiumWindowsApp) { app.WaitForElement(AppiumQuery.ByAccessibilityId("TogglePaneButton")); } @@ -1995,7 +1997,7 @@ private static void TapFlyoutIcon(this IApp app, string title = "", bool isShell } else { - if(app is AppiumWindowsApp) + if (app is AppiumWindowsApp) { app.Tap(AppiumQuery.ByAccessibilityId("TogglePaneButton")); }