diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs index ab7eaf2018fb..36e8017ec288 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs @@ -178,7 +178,7 @@ void UpdateSearchBarBackgroundColor(UITextField textField) if (_defaultBackgroundColor == null) _defaultBackgroundColor = backgroundView.BackgroundColor; - UIColor backgroundColor = backGroundColor.ToPlatform(); + UIColor backgroundColor = backGroundColor.ToPlatform(); backgroundView.BackgroundColor = backgroundColor; textField.BackgroundColor = backgroundColor; } diff --git a/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Android.cs b/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Android.cs index 502f954534d5..dbd8ebf39306 100644 --- a/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Android.cs +++ b/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Android.cs @@ -270,7 +270,7 @@ public ModalFragment(IMauiContext mauiContext, Page modal) var statusBarColor = mainActivityWindow.StatusBarColor; #pragma warning disable CA1422 dialog.Window.SetNavigationBarColor(new AColor(navigationBarColor)); - dialog.Window.SetStatusBarColor(new AColor(statusBarColor)); + dialog.Window.SetStatusBarColor(new AColor(statusBarColor)); #pragma warning restore CA1422 } diff --git a/src/Controls/tests/Core.UnitTests/ItemDisplayBindingTests.cs b/src/Controls/tests/Core.UnitTests/ItemDisplayBindingTests.cs index 7ad0fd122f40..7807ab2a6720 100644 --- a/src/Controls/tests/Core.UnitTests/ItemDisplayBindingTests.cs +++ b/src/Controls/tests/Core.UnitTests/ItemDisplayBindingTests.cs @@ -42,7 +42,7 @@ public void TestItemDisplayBinding() Assert.Equal(binding, testView.ItemDisplayBinding); Assert.Equal(binding, testView.picker.ItemDisplayBinding); } - + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicOptionsPage.xaml.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicOptionsPage.xaml.cs index 2e540dcc64be..b3fdb1976b7a 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicOptionsPage.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicOptionsPage.xaml.cs @@ -2,7 +2,7 @@ namespace Maui.Controls.Sample; public partial class CollectionViewDynamicOptionsPage : ContentPage { -private CollectionViewViewModel _viewModel; + private CollectionViewViewModel _viewModel; public CollectionViewDynamicOptionsPage(CollectionViewViewModel viewModel) { @@ -37,7 +37,7 @@ private void OnEmptyViewChanged(object sender, CheckedChangedEventArgs e) grid.Children.Add(new Label { Text = "No Items Available(Grid View)", - + TextColor = Colors.Blue }); _viewModel.EmptyView = grid; @@ -124,7 +124,7 @@ private void OnEmptyViewTemplateChanged(object sender, CheckedChangedEventArgs e TextColor = Colors.Blue }); return grid; - + }); _viewModel.IsEmptyViewTemplateSelected = true; } @@ -201,7 +201,7 @@ private void OnGroupHeaderTemplateChanged(object sender, CheckedChangedEventArgs if (GroupHeaderTemplateNone.IsChecked) { _viewModel.GroupHeaderTemplate = null; - + } else if (GroupHeaderTemplateGrid.IsChecked) @@ -233,7 +233,7 @@ private void OnGroupFooterTemplateChanged(object sender, CheckedChangedEventArgs if (GroupFooterTemplateNone.IsChecked) { _viewModel.GroupFooterTemplate = null; - + } else if (GroupFooterTemplateGrid.IsChecked) { @@ -274,7 +274,7 @@ private void OnItemTemplateChanged(object sender, CheckedChangedEventArgs e) label.SetBinding(Label.TextProperty, new Binding("Caption")); return label; }); - _viewModel.IsItemTemplateSelected = true; + _viewModel.IsItemTemplateSelected = true; } } @@ -298,7 +298,7 @@ private void OnItemsSourceChanged(object sender, CheckedChangedEventArgs e) _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; else if (radioButton == ItemsSourceGroupedList) _viewModel.ItemsSourceType = ItemsSourceType.GroupedListT; - else if (radioButton == ItemsSourceNone) + else if (radioButton == ItemsSourceNone) _viewModel.ItemsSourceType = ItemsSourceType.None; - } -} \ No newline at end of file + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicPage.xaml.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicPage.xaml.cs index 78668d6567de..848649387372 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicPage.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewDynamicChanges/CollectionViewDynamicPage.xaml.cs @@ -2,547 +2,547 @@ namespace Maui.Controls.Sample; public partial class CollectionViewDynamicPage : ContentPage { - private CollectionViewViewModel _viewModel; - - public CollectionViewDynamicPage() - { - InitializeComponent(); - _viewModel = new CollectionViewViewModel(); - _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; - BindingContext = _viewModel; - } - - private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) - { - BindingContext = _viewModel = new CollectionViewViewModel(); - _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; - await Navigation.PushAsync(new CollectionViewDynamicOptionsPage(_viewModel)); - } - - private bool _isHeaderString1 = true; - private bool _isFooterString1 = true; - private bool _isFooterGrid1 = true; - private bool _isHeaderGrid1 = true; - private bool _isHeaderTemplate1 = true; - private bool _isFooterTemplate1 = true; - private bool _isGroupFooterTemplate1 = true; - private bool _isGroupHeaderTemplate1 = true; - private bool _isEmptyViewGrid1 = true; - private bool _isEmptyViewString1 = true; - - private bool _isEmptyViewTemplate1 = true; - private bool _isItemTemplate1 = true; - - private void OnHeaderStringButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsHeaderStringSelected) // If HeaderString is active - { - if (_isHeaderString1) - { - _viewModel.Header = "Header String1"; - } - else - { - _viewModel.Header = "Header String2"; - } - _isHeaderString1 = !_isHeaderString1; - } - } - - private void OnFooterStringButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsFooterStringSelected) // If FooterString is active - { - if (_isFooterString1) - { - _viewModel.Footer = "Footer String1"; - } - else - { - _viewModel.Footer = "Footer String2"; - } - _isFooterString1 = !_isFooterString1; - } - } - - private void OnHeaderGridButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsHeaderGridSelected) - { - if (_isHeaderGrid1) - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - - grid.Children.Add(new Label - { - Text = "Header Grid1", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Blue, - FontSize = 18, - FontAttributes = FontAttributes.Bold - }); - - _viewModel.Header = grid; - } - else - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - - grid.Children.Add(new Label - { - Text = "Header Grid2", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 20, - HeightRequest = 150, - }); - - _viewModel.Header = grid; - } - _isHeaderGrid1 = !_isHeaderGrid1; - } - } - - - private void OnFooterGridButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsFooterGridSelected) - { - if (_isFooterGrid1) - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - - grid.Children.Add(new Label - { - Text = "Footer Grid1", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Blue, - FontSize = 18, - FontAttributes = FontAttributes.Bold - }); - - _viewModel.Footer = grid; - } - else - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - - grid.Children.Add(new Label - { - Text = "Footer Grid2", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 20, - HeightRequest = 150, - }); - - _viewModel.Footer = grid; - } - _isFooterGrid1 = !_isFooterGrid1; - } - } - - - private void OnHeaderTemplateButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsHeaderTemplateViewSelected) - { - if (_isHeaderTemplate1) - { - _viewModel.HeaderTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - grid.Children.Add(new Label - { - Text = "Header Template1", - FontSize = 18, - FontAttributes = FontAttributes.Bold, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Blue, - }); - return grid; - }); - } - else - { - _viewModel.HeaderTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - grid.Children.Add(new Label - { - Text = "Header Template2", - FontSize = 20, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - HeightRequest = 150, - }); - return grid; - }); - } - - _isHeaderTemplate1 = !_isHeaderTemplate1; - } - } - - private void OnFooterTemplateButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsFooterTemplateViewSelected) - { - if (_isFooterTemplate1) - { - _viewModel.FooterTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - grid.Children.Add(new Label - { - Text = "Footer Template1", - FontSize = 18, - FontAttributes = FontAttributes.Bold, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Blue, - }); - return grid; - }); - } - else - { - _viewModel.FooterTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - grid.Children.Add(new Label - { - Text = "Footer Template2", - FontSize = 20, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - HeightRequest = 150, - }); - return grid; - }); - } - - _isFooterTemplate1 = !_isFooterTemplate1; - } - } - - - private void OnGroupHeaderTemplateButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsGroupHeaderTemplateViewSelected) - { - if (_isGroupHeaderTemplate1) - { - _viewModel.GroupHeaderTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - grid.Children.Add(new Label - { - Text = "GroupHeaderTemplate1", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Green, - FontSize = 18, - FontAttributes = FontAttributes.Bold, - }); - return grid; - }); - } - else - { - _viewModel.GroupHeaderTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - grid.Children.Add(new Label - { - Text = "GroupHeaderTemplate2", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 20, - }); - return grid; - }); - } - _isGroupHeaderTemplate1 = !_isGroupHeaderTemplate1; - } - } - - - - private void OnGroupFooterTemplateButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsGroupFooterTemplateViewSelected) - { - if (_isGroupFooterTemplate1) - { - _viewModel.GroupFooterTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - grid.Children.Add(new Label - { - Text = "GroupFooterTemplate1", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Green, - FontSize = 18, - FontAttributes = FontAttributes.Bold, - }); - return grid; - }); - } - else - { - _viewModel.GroupFooterTemplate = new DataTemplate(() => - { - var grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - grid.Children.Add(new Label - { - Text = "GroupFooterTemplate2", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 20, - }); - return grid; - }); - } - - _isGroupFooterTemplate1 = !_isGroupFooterTemplate1; - } - } - - private void OnEmptyViewStringButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsEmptyViewStringSelected) - { - if (_isEmptyViewString1) - { - _viewModel.EmptyView = "EmptyView String1: No items available"; - } - else - { - _viewModel.EmptyView = "EmptyView String2: No items available"; - } - - _isEmptyViewString1 = !_isEmptyViewString1; - } - } - - - - private void OnEmptyViewGridButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsEmptyViewGridSelected) - { - if (_isEmptyViewGrid1) - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightBlue, - Padding = new Thickness(10) - }; - - grid.Children.Add(new Label - { - Text = "EmptyView Grid1: No items available", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Blue, - FontSize = 18, - FontAttributes = FontAttributes.Bold - }); - - _viewModel.EmptyView = grid; - } - else - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - - grid.Children.Add(new Label - { - Text = "EmptyView Grid2: No items available", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 14, - }); - - _viewModel.EmptyView = grid; - } - - _isEmptyViewGrid1 = !_isEmptyViewGrid1; - } - } - - private void OnEmptyViewTemplateButtonClicked(object sender, EventArgs e) - { - if (_viewModel.IsEmptyViewTemplateSelected) - { - if (_isEmptyViewTemplate1) - { - _viewModel.EmptyViewTemplate = new DataTemplate(() => - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - - grid.Children.Add(new Label - { - Text = "EmptyViewTemplate1: No items available", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Green, - FontSize = 18, - FontAttributes = FontAttributes.Bold - }); - - return grid; - }); - } - else - { - _viewModel.EmptyViewTemplate = new DataTemplate(() => - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - - grid.Children.Add(new Label - { - Text = "EmptyViewTemplate2: No items available", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 14, - }); - - return grid; - }); - } - - _isEmptyViewTemplate1 = !_isEmptyViewTemplate1; - } - } - -private void OnItemTemplateButtonClicked(object sender, EventArgs e) -{ - if (_viewModel.IsItemTemplateSelected) - { - if (_isItemTemplate1) - { - _viewModel.ItemTemplate = new DataTemplate(() => - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightGray, - Padding = new Thickness(10) - }; - - Label label = new Label - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Blue, - FontSize = 18, - }; - - label.SetBinding(Label.TextProperty, new Binding("Caption", stringFormat: "Template 1 - {0}")); - - grid.Children.Add(label); - - return grid; - }); - } - else - { - _viewModel.ItemTemplate = new DataTemplate(() => - { - Grid grid = new Grid - { - BackgroundColor = Colors.LightYellow, - Padding = new Thickness(20) - }; - - Label label = new Label - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Colors.Red, - FontSize = 14, - }; - - label.SetBinding(Label.TextProperty, new Binding("Caption", stringFormat: "Template 2 - {0}")); - - grid.Children.Add(label); - - return grid; - }); - } - _isItemTemplate1 = !_isItemTemplate1; - } -} + private CollectionViewViewModel _viewModel; + + public CollectionViewDynamicPage() + { + InitializeComponent(); + _viewModel = new CollectionViewViewModel(); + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; + BindingContext = _viewModel; + } + + private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) + { + BindingContext = _viewModel = new CollectionViewViewModel(); + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; + await Navigation.PushAsync(new CollectionViewDynamicOptionsPage(_viewModel)); + } + + private bool _isHeaderString1 = true; + private bool _isFooterString1 = true; + private bool _isFooterGrid1 = true; + private bool _isHeaderGrid1 = true; + private bool _isHeaderTemplate1 = true; + private bool _isFooterTemplate1 = true; + private bool _isGroupFooterTemplate1 = true; + private bool _isGroupHeaderTemplate1 = true; + private bool _isEmptyViewGrid1 = true; + private bool _isEmptyViewString1 = true; + + private bool _isEmptyViewTemplate1 = true; + private bool _isItemTemplate1 = true; + + private void OnHeaderStringButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsHeaderStringSelected) // If HeaderString is active + { + if (_isHeaderString1) + { + _viewModel.Header = "Header String1"; + } + else + { + _viewModel.Header = "Header String2"; + } + _isHeaderString1 = !_isHeaderString1; + } + } + + private void OnFooterStringButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsFooterStringSelected) // If FooterString is active + { + if (_isFooterString1) + { + _viewModel.Footer = "Footer String1"; + } + else + { + _viewModel.Footer = "Footer String2"; + } + _isFooterString1 = !_isFooterString1; + } + } + + private void OnHeaderGridButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsHeaderGridSelected) + { + if (_isHeaderGrid1) + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + + grid.Children.Add(new Label + { + Text = "Header Grid1", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Blue, + FontSize = 18, + FontAttributes = FontAttributes.Bold + }); + + _viewModel.Header = grid; + } + else + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + + grid.Children.Add(new Label + { + Text = "Header Grid2", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 20, + HeightRequest = 150, + }); + + _viewModel.Header = grid; + } + _isHeaderGrid1 = !_isHeaderGrid1; + } + } + + + private void OnFooterGridButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsFooterGridSelected) + { + if (_isFooterGrid1) + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + + grid.Children.Add(new Label + { + Text = "Footer Grid1", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Blue, + FontSize = 18, + FontAttributes = FontAttributes.Bold + }); + + _viewModel.Footer = grid; + } + else + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + + grid.Children.Add(new Label + { + Text = "Footer Grid2", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 20, + HeightRequest = 150, + }); + + _viewModel.Footer = grid; + } + _isFooterGrid1 = !_isFooterGrid1; + } + } + + + private void OnHeaderTemplateButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsHeaderTemplateViewSelected) + { + if (_isHeaderTemplate1) + { + _viewModel.HeaderTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + grid.Children.Add(new Label + { + Text = "Header Template1", + FontSize = 18, + FontAttributes = FontAttributes.Bold, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Blue, + }); + return grid; + }); + } + else + { + _viewModel.HeaderTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + grid.Children.Add(new Label + { + Text = "Header Template2", + FontSize = 20, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + HeightRequest = 150, + }); + return grid; + }); + } + + _isHeaderTemplate1 = !_isHeaderTemplate1; + } + } + + private void OnFooterTemplateButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsFooterTemplateViewSelected) + { + if (_isFooterTemplate1) + { + _viewModel.FooterTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + grid.Children.Add(new Label + { + Text = "Footer Template1", + FontSize = 18, + FontAttributes = FontAttributes.Bold, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Blue, + }); + return grid; + }); + } + else + { + _viewModel.FooterTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + grid.Children.Add(new Label + { + Text = "Footer Template2", + FontSize = 20, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + HeightRequest = 150, + }); + return grid; + }); + } + + _isFooterTemplate1 = !_isFooterTemplate1; + } + } + + + private void OnGroupHeaderTemplateButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsGroupHeaderTemplateViewSelected) + { + if (_isGroupHeaderTemplate1) + { + _viewModel.GroupHeaderTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + grid.Children.Add(new Label + { + Text = "GroupHeaderTemplate1", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Green, + FontSize = 18, + FontAttributes = FontAttributes.Bold, + }); + return grid; + }); + } + else + { + _viewModel.GroupHeaderTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + grid.Children.Add(new Label + { + Text = "GroupHeaderTemplate2", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 20, + }); + return grid; + }); + } + _isGroupHeaderTemplate1 = !_isGroupHeaderTemplate1; + } + } + + + + private void OnGroupFooterTemplateButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsGroupFooterTemplateViewSelected) + { + if (_isGroupFooterTemplate1) + { + _viewModel.GroupFooterTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + grid.Children.Add(new Label + { + Text = "GroupFooterTemplate1", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Green, + FontSize = 18, + FontAttributes = FontAttributes.Bold, + }); + return grid; + }); + } + else + { + _viewModel.GroupFooterTemplate = new DataTemplate(() => + { + var grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + grid.Children.Add(new Label + { + Text = "GroupFooterTemplate2", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 20, + }); + return grid; + }); + } + + _isGroupFooterTemplate1 = !_isGroupFooterTemplate1; + } + } + + private void OnEmptyViewStringButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsEmptyViewStringSelected) + { + if (_isEmptyViewString1) + { + _viewModel.EmptyView = "EmptyView String1: No items available"; + } + else + { + _viewModel.EmptyView = "EmptyView String2: No items available"; + } + + _isEmptyViewString1 = !_isEmptyViewString1; + } + } + + + + private void OnEmptyViewGridButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsEmptyViewGridSelected) + { + if (_isEmptyViewGrid1) + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightBlue, + Padding = new Thickness(10) + }; + + grid.Children.Add(new Label + { + Text = "EmptyView Grid1: No items available", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Blue, + FontSize = 18, + FontAttributes = FontAttributes.Bold + }); + + _viewModel.EmptyView = grid; + } + else + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + + grid.Children.Add(new Label + { + Text = "EmptyView Grid2: No items available", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 14, + }); + + _viewModel.EmptyView = grid; + } + + _isEmptyViewGrid1 = !_isEmptyViewGrid1; + } + } + + private void OnEmptyViewTemplateButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsEmptyViewTemplateSelected) + { + if (_isEmptyViewTemplate1) + { + _viewModel.EmptyViewTemplate = new DataTemplate(() => + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + + grid.Children.Add(new Label + { + Text = "EmptyViewTemplate1: No items available", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Green, + FontSize = 18, + FontAttributes = FontAttributes.Bold + }); + + return grid; + }); + } + else + { + _viewModel.EmptyViewTemplate = new DataTemplate(() => + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + + grid.Children.Add(new Label + { + Text = "EmptyViewTemplate2: No items available", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 14, + }); + + return grid; + }); + } + + _isEmptyViewTemplate1 = !_isEmptyViewTemplate1; + } + } + + private void OnItemTemplateButtonClicked(object sender, EventArgs e) + { + if (_viewModel.IsItemTemplateSelected) + { + if (_isItemTemplate1) + { + _viewModel.ItemTemplate = new DataTemplate(() => + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + + Label label = new Label + { + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Blue, + FontSize = 18, + }; + + label.SetBinding(Label.TextProperty, new Binding("Caption", stringFormat: "Template 1 - {0}")); + + grid.Children.Add(label); + + return grid; + }); + } + else + { + _viewModel.ItemTemplate = new DataTemplate(() => + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightYellow, + Padding = new Thickness(20) + }; + + Label label = new Label + { + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red, + FontSize = 14, + }; + + label.SetBinding(Label.TextProperty, new Binding("Caption", stringFormat: "Template 2 - {0}")); + + grid.Children.Add(label); + + return grid; + }); + } + _isItemTemplate1 = !_isItemTemplate1; + } + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs index 84c115cee979..736b42248ff7 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs @@ -38,361 +38,361 @@ public enum ItemsSourceType } public class CollectionViewViewModel : INotifyPropertyChanged { - private object _emptyView; - private object _header; - private object _footer; - private DataTemplate _emptyViewTemplate; - private DataTemplate _headerTemplate; - private DataTemplate _footerTemplate; - private DataTemplate _groupHeaderTemplate; - private DataTemplate _groupFooterTemplate; - private DataTemplate _itemTemplate; - private IItemsLayout _itemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Vertical); - private ItemsSourceType _itemsSourceType = ItemsSourceType.None; - private bool _isGrouped = false; - private bool _canReorderItems = false; - private bool _canMixGroups = false; - private ItemSizingStrategy _itemSizingStrategy; - private ItemsUpdatingScrollMode _itemsUpdatingScrollMode; - private ObservableCollection _observableCollection; - private ObservableCollection _observableCollection25; - private ObservableCollection _observableCollection5; - private ObservableCollection _emptyObservableCollection; - private List> _groupedList; - private List> _emptyGroupedList; - private ObservableCollection _observableCollection3; - private ObservableCollection _observableCollection2; - private List> _groupedList3; - private List> _groupedList2; - private SelectionMode _selectionMode = SelectionMode.None; - private object _selectedItem; - private ObservableCollection _selectedItems = new ObservableCollection(); - private int _selectionChangedEventCount = 0; - private string _previousSelectionText; - private string _currentSelectionText; - private bool _isHeaderStringSelected; - private bool _isFooterStringSelected; - private bool _isHeaderGridSelected; - private bool _isFooterGridSelected; - private bool _isHeaderTemplateViewSelected; - private bool _isFooterTemplateViewSelected; - private bool _isGroupHeaderTemplateViewSelected; - private bool _isGroupFooterTemplateViewSelected; - private bool _isEmptyViewStringSelected; - private bool _isEmptyViewGridSelected; - private bool _isEmptyViewTemplateSelected; - private bool _isItemTemplateSelected; - - - public bool ShowAddRemoveButtons => ItemsSourceType == ItemsSourceType.ObservableCollectionT3 || ItemsSourceType == ItemsSourceType.GroupedListT3; - - - public event PropertyChangedEventHandler PropertyChanged; - - private readonly string[] _addSequenceFruits = - { - "Dragonfruit", "Passionfruit", "Starfruit", "Rambutan", "Durian", "Persimmon" - }; - private int _addIndex = 0; - - public ICommand AddItemCommand { get; } - - public CollectionViewViewModel() - { - LoadItems(); - - AddItemCommand = new Command(AddItem); - - GroupHeaderTemplate = new DataTemplate(() => - { - var stackLayout = new StackLayout - { - BackgroundColor = Colors.LightGray - }; - var label = new Label - { - FontAttributes = FontAttributes.Bold, - FontSize = 24, - }; - label.SetBinding(Label.TextProperty, "Key"); - stackLayout.Children.Add(label); - return stackLayout; - }); - - SetItemTemplate(); - SelectedItems = new ObservableCollection(); - SelectedItems.CollectionChanged += OnSelectedItemsChanged; - } - - public object EmptyView - { - get => _emptyView; - set { _emptyView = value; OnPropertyChanged(); } - } - - public object Header - { - get => _header; - set { _header = value; OnPropertyChanged(); } - } - - public object Footer - { - get => _footer; - set { _footer = value; OnPropertyChanged(); } - } - - public DataTemplate EmptyViewTemplate - { - get => _emptyViewTemplate; - set { _emptyViewTemplate = value; OnPropertyChanged(); } - } - - public DataTemplate HeaderTemplate - { - get => _headerTemplate; - set { _headerTemplate = value; OnPropertyChanged(); } - } - - public DataTemplate FooterTemplate - { - get => _footerTemplate; - set { _footerTemplate = value; OnPropertyChanged(); } - } - - public DataTemplate GroupHeaderTemplate - { - get => _groupHeaderTemplate; - set { _groupHeaderTemplate = value; OnPropertyChanged(); } - } - - public DataTemplate GroupFooterTemplate - { - get => _groupFooterTemplate; - set { _groupFooterTemplate = value; OnPropertyChanged(); } - } - - public DataTemplate ItemTemplate - { - get => _itemTemplate; - set { _itemTemplate = value; OnPropertyChanged(); } - } - - public IItemsLayout ItemsLayout - { - get => _itemsLayout; - set - { - if (_itemsLayout != value) - { - _itemsLayout = value; - OnPropertyChanged(); - } - } - } - - public ItemsSourceType ItemsSourceType - { - get => _itemsSourceType; - set - { - if (_itemsSourceType != value) - { - _itemsSourceType = value; - OnPropertyChanged(); - OnPropertyChanged(nameof(ItemsSource)); - OnPropertyChanged(nameof(ShowAddRemoveButtons)); - SetItemTemplate(); - } - } - } - - public bool CanReorderItems - { - get => _canReorderItems; - set - { - if (_canReorderItems != value) - { - _canReorderItems = value; - OnPropertyChanged(); - } - } - } - public bool CanMixGroups - { - get => _canMixGroups; - set - { - if (_canMixGroups != value) - { - _canMixGroups = value; - OnPropertyChanged(); - } - } - } - - public bool IsGrouped - { - get => _isGrouped; - set - { - if (_isGrouped != value) - { - _isGrouped = value; - OnPropertyChanged(); - } - } - } - - public object ItemsSource - { - get - { - return ItemsSourceType switch - { - ItemsSourceType.ObservableCollectionT => _observableCollection, - ItemsSourceType.ObservableCollection25T => _observableCollection25, - ItemsSourceType.ObservableCollection5T => _observableCollection5, - ItemsSourceType.ObservableCollectionT3 => _observableCollection3, - ItemsSourceType.ObservableCollectionT2 => _observableCollection2, - ItemsSourceType.GroupedListT => _groupedList, - ItemsSourceType.GroupedListT2 => _groupedList2, - ItemsSourceType.EmptyGroupedListT => _emptyGroupedList, - ItemsSourceType.GroupedListT3 => _groupedList3, - ItemsSourceType.EmptyObservableCollectionT => _emptyObservableCollection, - ItemsSourceType.None => null, - _ => null - }; - } - } - - public ItemSizingStrategy ItemSizingStrategy - { - get => _itemSizingStrategy; - set - { - if (_itemSizingStrategy != value) - { - _itemSizingStrategy = value; - OnPropertyChanged(); - } - } - } - - public ItemsUpdatingScrollMode ItemsUpdatingScrollMode - { - get => _itemsUpdatingScrollMode; - set - { - if (_itemsUpdatingScrollMode != value) - { - _itemsUpdatingScrollMode = value; - OnPropertyChanged(); - } - } - } - - public SelectionMode SelectionMode - { - get => _selectionMode; - set - { - if (_selectionMode != value) - { - _selectionMode = value; - OnPropertyChanged(); - } - } - } - - public object SelectedItem - { - get => _selectedItem; - set - { - if (_selectedItem != value) - { - _selectedItem = value; - OnPropertyChanged(); - OnPropertyChanged(nameof(SelectedItemText)); - OnPropertyChanged(nameof(SelectedItemsCount)); - } - } - } - - public ObservableCollection SelectedItems - { - get => _selectedItems; - set - { - if (_selectedItems != value) - { - _selectedItems = value; - OnPropertyChanged(); - OnPropertyChanged(nameof(SelectedItemsCount)); - OnPropertyChanged(nameof(SelectedItemText)); - } - } - } - public int SelectedItemsCount - { - get - { - if (SelectionMode == SelectionMode.Single) - { - return SelectedItem != null ? 1 : 0; - } - else if (SelectionMode == SelectionMode.Multiple) - { - return SelectedItems?.Count ?? 0; - } - return 0; - - } - } - public string SelectedItemText - { - get - { - if (SelectionMode == SelectionMode.Single && SelectedItem is CollectionViewTestItem item) - { - return $"{item.Caption}"; - } - else if (SelectionMode == SelectionMode.Multiple && SelectedItems?.Count > 0) - { - var selectedCaptions = SelectedItems - .OfType() - .Select(i => i.Caption); - return string.Join(", ", selectedCaptions); - } - return "No items selected"; - } - } - - public int SelectionChangedEventCount - { - get => _selectionChangedEventCount; - set - { - _selectionChangedEventCount = value; - OnPropertyChanged(); - } - } - - public string PreviousSelectionText - { - get => _previousSelectionText; - set { _previousSelectionText = value; OnPropertyChanged(); } - } - - public string CurrentSelectionText - { - get => _currentSelectionText; - set { _currentSelectionText = value; OnPropertyChanged(); } - } - - public bool IsHeaderStringSelected + private object _emptyView; + private object _header; + private object _footer; + private DataTemplate _emptyViewTemplate; + private DataTemplate _headerTemplate; + private DataTemplate _footerTemplate; + private DataTemplate _groupHeaderTemplate; + private DataTemplate _groupFooterTemplate; + private DataTemplate _itemTemplate; + private IItemsLayout _itemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Vertical); + private ItemsSourceType _itemsSourceType = ItemsSourceType.None; + private bool _isGrouped = false; + private bool _canReorderItems = false; + private bool _canMixGroups = false; + private ItemSizingStrategy _itemSizingStrategy; + private ItemsUpdatingScrollMode _itemsUpdatingScrollMode; + private ObservableCollection _observableCollection; + private ObservableCollection _observableCollection25; + private ObservableCollection _observableCollection5; + private ObservableCollection _emptyObservableCollection; + private List> _groupedList; + private List> _emptyGroupedList; + private ObservableCollection _observableCollection3; + private ObservableCollection _observableCollection2; + private List> _groupedList3; + private List> _groupedList2; + private SelectionMode _selectionMode = SelectionMode.None; + private object _selectedItem; + private ObservableCollection _selectedItems = new ObservableCollection(); + private int _selectionChangedEventCount = 0; + private string _previousSelectionText; + private string _currentSelectionText; + private bool _isHeaderStringSelected; + private bool _isFooterStringSelected; + private bool _isHeaderGridSelected; + private bool _isFooterGridSelected; + private bool _isHeaderTemplateViewSelected; + private bool _isFooterTemplateViewSelected; + private bool _isGroupHeaderTemplateViewSelected; + private bool _isGroupFooterTemplateViewSelected; + private bool _isEmptyViewStringSelected; + private bool _isEmptyViewGridSelected; + private bool _isEmptyViewTemplateSelected; + private bool _isItemTemplateSelected; + + + public bool ShowAddRemoveButtons => ItemsSourceType == ItemsSourceType.ObservableCollectionT3 || ItemsSourceType == ItemsSourceType.GroupedListT3; + + + public event PropertyChangedEventHandler PropertyChanged; + + private readonly string[] _addSequenceFruits = + { + "Dragonfruit", "Passionfruit", "Starfruit", "Rambutan", "Durian", "Persimmon" + }; + private int _addIndex = 0; + + public ICommand AddItemCommand { get; } + + public CollectionViewViewModel() + { + LoadItems(); + + AddItemCommand = new Command(AddItem); + + GroupHeaderTemplate = new DataTemplate(() => + { + var stackLayout = new StackLayout + { + BackgroundColor = Colors.LightGray + }; + var label = new Label + { + FontAttributes = FontAttributes.Bold, + FontSize = 24, + }; + label.SetBinding(Label.TextProperty, "Key"); + stackLayout.Children.Add(label); + return stackLayout; + }); + + SetItemTemplate(); + SelectedItems = new ObservableCollection(); + SelectedItems.CollectionChanged += OnSelectedItemsChanged; + } + + public object EmptyView + { + get => _emptyView; + set { _emptyView = value; OnPropertyChanged(); } + } + + public object Header + { + get => _header; + set { _header = value; OnPropertyChanged(); } + } + + public object Footer + { + get => _footer; + set { _footer = value; OnPropertyChanged(); } + } + + public DataTemplate EmptyViewTemplate + { + get => _emptyViewTemplate; + set { _emptyViewTemplate = value; OnPropertyChanged(); } + } + + public DataTemplate HeaderTemplate + { + get => _headerTemplate; + set { _headerTemplate = value; OnPropertyChanged(); } + } + + public DataTemplate FooterTemplate + { + get => _footerTemplate; + set { _footerTemplate = value; OnPropertyChanged(); } + } + + public DataTemplate GroupHeaderTemplate + { + get => _groupHeaderTemplate; + set { _groupHeaderTemplate = value; OnPropertyChanged(); } + } + + public DataTemplate GroupFooterTemplate + { + get => _groupFooterTemplate; + set { _groupFooterTemplate = value; OnPropertyChanged(); } + } + + public DataTemplate ItemTemplate + { + get => _itemTemplate; + set { _itemTemplate = value; OnPropertyChanged(); } + } + + public IItemsLayout ItemsLayout + { + get => _itemsLayout; + set + { + if (_itemsLayout != value) + { + _itemsLayout = value; + OnPropertyChanged(); + } + } + } + + public ItemsSourceType ItemsSourceType + { + get => _itemsSourceType; + set + { + if (_itemsSourceType != value) + { + _itemsSourceType = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(ItemsSource)); + OnPropertyChanged(nameof(ShowAddRemoveButtons)); + SetItemTemplate(); + } + } + } + + public bool CanReorderItems + { + get => _canReorderItems; + set + { + if (_canReorderItems != value) + { + _canReorderItems = value; + OnPropertyChanged(); + } + } + } + public bool CanMixGroups + { + get => _canMixGroups; + set + { + if (_canMixGroups != value) + { + _canMixGroups = value; + OnPropertyChanged(); + } + } + } + + public bool IsGrouped + { + get => _isGrouped; + set + { + if (_isGrouped != value) + { + _isGrouped = value; + OnPropertyChanged(); + } + } + } + + public object ItemsSource + { + get + { + return ItemsSourceType switch + { + ItemsSourceType.ObservableCollectionT => _observableCollection, + ItemsSourceType.ObservableCollection25T => _observableCollection25, + ItemsSourceType.ObservableCollection5T => _observableCollection5, + ItemsSourceType.ObservableCollectionT3 => _observableCollection3, + ItemsSourceType.ObservableCollectionT2 => _observableCollection2, + ItemsSourceType.GroupedListT => _groupedList, + ItemsSourceType.GroupedListT2 => _groupedList2, + ItemsSourceType.EmptyGroupedListT => _emptyGroupedList, + ItemsSourceType.GroupedListT3 => _groupedList3, + ItemsSourceType.EmptyObservableCollectionT => _emptyObservableCollection, + ItemsSourceType.None => null, + _ => null + }; + } + } + + public ItemSizingStrategy ItemSizingStrategy + { + get => _itemSizingStrategy; + set + { + if (_itemSizingStrategy != value) + { + _itemSizingStrategy = value; + OnPropertyChanged(); + } + } + } + + public ItemsUpdatingScrollMode ItemsUpdatingScrollMode + { + get => _itemsUpdatingScrollMode; + set + { + if (_itemsUpdatingScrollMode != value) + { + _itemsUpdatingScrollMode = value; + OnPropertyChanged(); + } + } + } + + public SelectionMode SelectionMode + { + get => _selectionMode; + set + { + if (_selectionMode != value) + { + _selectionMode = value; + OnPropertyChanged(); + } + } + } + + public object SelectedItem + { + get => _selectedItem; + set + { + if (_selectedItem != value) + { + _selectedItem = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(SelectedItemText)); + OnPropertyChanged(nameof(SelectedItemsCount)); + } + } + } + + public ObservableCollection SelectedItems + { + get => _selectedItems; + set + { + if (_selectedItems != value) + { + _selectedItems = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(SelectedItemsCount)); + OnPropertyChanged(nameof(SelectedItemText)); + } + } + } + public int SelectedItemsCount + { + get + { + if (SelectionMode == SelectionMode.Single) + { + return SelectedItem != null ? 1 : 0; + } + else if (SelectionMode == SelectionMode.Multiple) + { + return SelectedItems?.Count ?? 0; + } + return 0; + + } + } + public string SelectedItemText + { + get + { + if (SelectionMode == SelectionMode.Single && SelectedItem is CollectionViewTestItem item) + { + return $"{item.Caption}"; + } + else if (SelectionMode == SelectionMode.Multiple && SelectedItems?.Count > 0) + { + var selectedCaptions = SelectedItems + .OfType() + .Select(i => i.Caption); + return string.Join(", ", selectedCaptions); + } + return "No items selected"; + } + } + + public int SelectionChangedEventCount + { + get => _selectionChangedEventCount; + set + { + _selectionChangedEventCount = value; + OnPropertyChanged(); + } + } + + public string PreviousSelectionText + { + get => _previousSelectionText; + set { _previousSelectionText = value; OnPropertyChanged(); } + } + + public string CurrentSelectionText + { + get => _currentSelectionText; + set { _currentSelectionText = value; OnPropertyChanged(); } + } + + public bool IsHeaderStringSelected { get => _isHeaderStringSelected; set @@ -421,7 +421,7 @@ public bool IsHeaderGridSelected OnPropertyChanged(); } } - + public bool IsFooterGridSelected { get => _isFooterGridSelected; @@ -512,225 +512,225 @@ public bool IsItemTemplateSelected } } - private void LoadItems() - { - _observableCollection = new ObservableCollection(); - AddItems(_observableCollection, 7, "Fruits"); - AddItems(_observableCollection, 7, "Vegetables"); - - _observableCollection25 = new ObservableCollection(); - _observableCollection5 = new ObservableCollection(); - AddItems(_observableCollection5, 5, "Fruits"); - AddItems(_observableCollection25, 10, "Fruits"); - AddItems(_observableCollection25, 10, "Vegetables"); - - _emptyObservableCollection = new ObservableCollection(); - - _groupedList = new List> - { - new Grouping("Fruits", new List()), - new Grouping("Vegetables", new List()) - }; - - AddItems(_groupedList[0], 4, "Fruits"); - AddItems(_groupedList[1], 4, "Vegetables"); - - _emptyGroupedList = new List>(); - - _observableCollection2 = new ObservableCollection(); - AddItems2(_observableCollection2, 10); - - _observableCollection3 = new ObservableCollection(); - AddItems(_observableCollection3, 15, "Fruits"); - AddItems(_observableCollection3, 15, "Vegetables"); - - _groupedList3 = new List> - { - new Grouping("Fruits", new List()), - new Grouping("Vegetables", new List()) - - }; - - AddItems(_groupedList3[0], 12, "Fruits"); - AddItems(_groupedList3[1], 12, "Vegetables"); - - _groupedList2 = new List> - { - new Grouping("Group1", new List()), - new Grouping("Group2", new List()) - }; - AddItems2(_groupedList2[0], 3); - AddItems2(_groupedList2[1], 2); - - } - - - private void AddItems(IList list, int count, string category) - { - string[] fruits = - { - "Apple", "Banana", "Orange", "Grapes", "Mango", - "Pineapple", "Strawberry", "Blueberry", "Peach", "Cherry", - "Watermelon", "Papaya", "Kiwi", "Pear", "Plum", - "Avocado", "Fig", "Guava", "Lychee", "Pomegranate", - "Lime", "Lemon", "Coconut", "Apricot", "Blackberry" - }; - - string[] vegetables = - { - "Carrot", "Broccoli", "Spinach", "Potato", "Tomato", - "Cucumber", "Lettuce", "Onion", "Garlic", "Pepper", - "Zucchini", "Pumpkin", "Radish", "Beetroot", "Cabbage", - "Sweet Potato", "Turnip", "Cauliflower", "Celery", "Asparagus", - "Eggplant", "Chili", "Corn", "Peas", "Mushroom" - }; - - string[] items = category == "Fruits" ? fruits : vegetables; - - for (int n = 0; n < count; n++) - { - list.Add(new CollectionViewTestItem(items[n % items.Length], n)); - } - } - - private void AddItems2(IList list, int count) - { - string loremParagraph = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; - string[] sentences = loremParagraph.Split(new[] { ". " }, StringSplitOptions.RemoveEmptyEntries); - - double fixedFontSize = 16; - - for (int i = 0; i < count; i++) - { - int sentenceCount = (i % sentences.Length) + 1; - string text = string.Join(". ", sentences.Take(sentenceCount)) + "."; - list.Add(new ItemModel(text, fixedFontSize)); - } - } - - private void AddItem() - { - if (_addIndex >= _addSequenceFruits.Length) - _addIndex = 0; - - var fruitName = _addSequenceFruits[_addIndex++]; - var newItem = new CollectionViewTestItem(fruitName, _addIndex - 1); - - if (ItemsSourceType == ItemsSourceType.ObservableCollectionT3) - { - _observableCollection3.Insert(0, newItem); - } - else if (ItemsSourceType == ItemsSourceType.GroupedListT3 && _groupedList3.Count > 0) - { - _groupedList3[0].Insert(0, newItem); - } - - OnPropertyChanged(nameof(ItemsSource)); - } - - private void SetItemTemplate() - { - if (ItemsSourceType == ItemsSourceType.ObservableCollectionT2 || ItemsSourceType == ItemsSourceType.GroupedListT2) - { - - ItemTemplate = new DataTemplate(() => - { - var stackLayout = new StackLayout - { - BackgroundColor = Colors.LightBlue, - Margin = new Thickness(1), - - }; - - var label = new Label - { - TextColor = Colors.Black - }; - - label.SetBinding(Label.TextProperty, "Caption"); - label.SetBinding(Label.FontSizeProperty, "FontSize"); - - stackLayout.Children.Add(label); - - return stackLayout; - }); - } - else - { - ItemTemplate = new DataTemplate(() => - { - var stackLayout = new StackLayout - { - Padding = new Thickness(10), - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center - }; - - var label = new Label - { - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.Center - }; - label.SetBinding(Label.TextProperty, "Caption"); - stackLayout.Children.Add(label); - return stackLayout; - }); - } - } - - private void OnSelectedItemsChanged(object sender, NotifyCollectionChangedEventArgs e) - { - OnPropertyChanged(nameof(SelectedItemsCount)); - OnPropertyChanged(nameof(SelectedItemText)); - } - - protected void OnPropertyChanged([CallerMemberName] string propertyName = null) - { - if (propertyName == nameof(IsGrouped)) - { - OnPropertyChanged(nameof(ItemsSource)); - } - - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - - public class CustomDataTemplateSelector : DataTemplateSelector - { - public DataTemplate Template1 { get; set; } - public DataTemplate Template2 { get; set; } - - protected override DataTemplate OnSelectTemplate(object item, BindableObject container) - { - if (item is CollectionViewTestItem testItem) - { - return testItem.Index % 2 == 0 ? Template1 : Template2; - } - - return Template1; - } - } - - public class CollectionViewTestItem - { - public string Caption { get; set; } - public int Index { get; set; } - - public CollectionViewTestItem(string caption, int index) - { - Caption = caption; - Index = index; - } - } - - public class ItemModel - { - public string Caption { get; set; } - public double FontSize { get; set; } - - public ItemModel(string caption, double fontSize) - { - Caption = caption; - FontSize = fontSize; - } - } + private void LoadItems() + { + _observableCollection = new ObservableCollection(); + AddItems(_observableCollection, 7, "Fruits"); + AddItems(_observableCollection, 7, "Vegetables"); + + _observableCollection25 = new ObservableCollection(); + _observableCollection5 = new ObservableCollection(); + AddItems(_observableCollection5, 5, "Fruits"); + AddItems(_observableCollection25, 10, "Fruits"); + AddItems(_observableCollection25, 10, "Vegetables"); + + _emptyObservableCollection = new ObservableCollection(); + + _groupedList = new List> + { + new Grouping("Fruits", new List()), + new Grouping("Vegetables", new List()) + }; + + AddItems(_groupedList[0], 4, "Fruits"); + AddItems(_groupedList[1], 4, "Vegetables"); + + _emptyGroupedList = new List>(); + + _observableCollection2 = new ObservableCollection(); + AddItems2(_observableCollection2, 10); + + _observableCollection3 = new ObservableCollection(); + AddItems(_observableCollection3, 15, "Fruits"); + AddItems(_observableCollection3, 15, "Vegetables"); + + _groupedList3 = new List> + { + new Grouping("Fruits", new List()), + new Grouping("Vegetables", new List()) + + }; + + AddItems(_groupedList3[0], 12, "Fruits"); + AddItems(_groupedList3[1], 12, "Vegetables"); + + _groupedList2 = new List> + { + new Grouping("Group1", new List()), + new Grouping("Group2", new List()) + }; + AddItems2(_groupedList2[0], 3); + AddItems2(_groupedList2[1], 2); + + } + + + private void AddItems(IList list, int count, string category) + { + string[] fruits = + { + "Apple", "Banana", "Orange", "Grapes", "Mango", + "Pineapple", "Strawberry", "Blueberry", "Peach", "Cherry", + "Watermelon", "Papaya", "Kiwi", "Pear", "Plum", + "Avocado", "Fig", "Guava", "Lychee", "Pomegranate", + "Lime", "Lemon", "Coconut", "Apricot", "Blackberry" + }; + + string[] vegetables = + { + "Carrot", "Broccoli", "Spinach", "Potato", "Tomato", + "Cucumber", "Lettuce", "Onion", "Garlic", "Pepper", + "Zucchini", "Pumpkin", "Radish", "Beetroot", "Cabbage", + "Sweet Potato", "Turnip", "Cauliflower", "Celery", "Asparagus", + "Eggplant", "Chili", "Corn", "Peas", "Mushroom" + }; + + string[] items = category == "Fruits" ? fruits : vegetables; + + for (int n = 0; n < count; n++) + { + list.Add(new CollectionViewTestItem(items[n % items.Length], n)); + } + } + + private void AddItems2(IList list, int count) + { + string loremParagraph = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; + string[] sentences = loremParagraph.Split(new[] { ". " }, StringSplitOptions.RemoveEmptyEntries); + + double fixedFontSize = 16; + + for (int i = 0; i < count; i++) + { + int sentenceCount = (i % sentences.Length) + 1; + string text = string.Join(". ", sentences.Take(sentenceCount)) + "."; + list.Add(new ItemModel(text, fixedFontSize)); + } + } + + private void AddItem() + { + if (_addIndex >= _addSequenceFruits.Length) + _addIndex = 0; + + var fruitName = _addSequenceFruits[_addIndex++]; + var newItem = new CollectionViewTestItem(fruitName, _addIndex - 1); + + if (ItemsSourceType == ItemsSourceType.ObservableCollectionT3) + { + _observableCollection3.Insert(0, newItem); + } + else if (ItemsSourceType == ItemsSourceType.GroupedListT3 && _groupedList3.Count > 0) + { + _groupedList3[0].Insert(0, newItem); + } + + OnPropertyChanged(nameof(ItemsSource)); + } + + private void SetItemTemplate() + { + if (ItemsSourceType == ItemsSourceType.ObservableCollectionT2 || ItemsSourceType == ItemsSourceType.GroupedListT2) + { + + ItemTemplate = new DataTemplate(() => + { + var stackLayout = new StackLayout + { + BackgroundColor = Colors.LightBlue, + Margin = new Thickness(1), + + }; + + var label = new Label + { + TextColor = Colors.Black + }; + + label.SetBinding(Label.TextProperty, "Caption"); + label.SetBinding(Label.FontSizeProperty, "FontSize"); + + stackLayout.Children.Add(label); + + return stackLayout; + }); + } + else + { + ItemTemplate = new DataTemplate(() => + { + var stackLayout = new StackLayout + { + Padding = new Thickness(10), + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + }; + + var label = new Label + { + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.Center + }; + label.SetBinding(Label.TextProperty, "Caption"); + stackLayout.Children.Add(label); + return stackLayout; + }); + } + } + + private void OnSelectedItemsChanged(object sender, NotifyCollectionChangedEventArgs e) + { + OnPropertyChanged(nameof(SelectedItemsCount)); + OnPropertyChanged(nameof(SelectedItemText)); + } + + protected void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + if (propertyName == nameof(IsGrouped)) + { + OnPropertyChanged(nameof(ItemsSource)); + } + + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public class CustomDataTemplateSelector : DataTemplateSelector + { + public DataTemplate Template1 { get; set; } + public DataTemplate Template2 { get; set; } + + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + { + if (item is CollectionViewTestItem testItem) + { + return testItem.Index % 2 == 0 ? Template1 : Template2; + } + + return Template1; + } + } + + public class CollectionViewTestItem + { + public string Caption { get; set; } + public int Index { get; set; } + + public CollectionViewTestItem(string caption, int index) + { + Caption = caption; + Index = index; + } + } + + public class ItemModel + { + public string Caption { get; set; } + public double FontSize { get; set; } + + public ItemModel(string caption, double fontSize) + { + Caption = caption; + FontSize = fontSize; + } + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue20612.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue20612.cs index a513d8aaf0b8..35ddd0fe0a0f 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue20612.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue20612.cs @@ -5,90 +5,90 @@ namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 20612, "Disconnecting Map Handler causes Map to crash on second page entrance and moving to region.", PlatformAffected.iOS | PlatformAffected.macOS)] public class Issue20612 : TestNavigationPage { - protected override void Init() - { - PushAsync(new Issue20612page1()); - } + protected override void Init() + { + PushAsync(new Issue20612page1()); + } } public class Issue20612page1 : ContentPage { - public Issue20612page1() - { - var openMapButton = new Button - { - Text = "Navigate to Map page", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - AutomationId = "MapButton" - }; + public Issue20612page1() + { + var openMapButton = new Button + { + Text = "Navigate to Map page", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + AutomationId = "MapButton" + }; - openMapButton.Clicked += (s, e) => - { - Navigation.PushAsync(new Issue20612page2()); - }; - Content = openMapButton; - } + openMapButton.Clicked += (s, e) => + { + Navigation.PushAsync(new Issue20612page2()); + }; + Content = openMapButton; + } } public class Issue20612page2 : ContentPage { - private Microsoft.Maui.Controls.Maps.Map _map; + private Microsoft.Maui.Controls.Maps.Map _map; - public Issue20612page2() - { - _map = new Microsoft.Maui.Controls.Maps.Map - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - BackgroundColor = Colors.Red - }; + public Issue20612page2() + { + _map = new Microsoft.Maui.Controls.Maps.Map + { + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill, + BackgroundColor = Colors.Red + }; - var goBackButton = new Button - { - Text = "Go back", - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - AutomationId = "GoBackButton" - }; - goBackButton.Clicked += GoBack; + var goBackButton = new Button + { + Text = "Go back", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + AutomationId = "GoBackButton" + }; + goBackButton.Clicked += GoBack; - var grid = new Grid - { - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, // Row 0: for map + var grid = new Grid + { + RowDefinitions = + { + new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, // Row 0: for map new RowDefinition { Height = GridLength.Auto } // Row 1: for button } - }; + }; - grid.Children.Add(_map); - Grid.SetRow(_map, 0); + grid.Children.Add(_map); + Grid.SetRow(_map, 0); - grid.Children.Add(goBackButton); - Grid.SetRow(goBackButton, 1); - Content = grid; + grid.Children.Add(goBackButton); + Grid.SetRow(goBackButton, 1); + Content = grid; - MoveMap(); - } + MoveMap(); + } - private async void MoveMap() - { - await Task.Delay(1000).ConfigureAwait(false); + private async void MoveMap() + { + await Task.Delay(1000).ConfigureAwait(false); - MainThread.BeginInvokeOnMainThread(() => - { - var mapSpan = MapSpan.FromCenterAndRadius( - new Location(5, 5), - Distance.FromMeters(10000)); + MainThread.BeginInvokeOnMainThread(() => + { + var mapSpan = MapSpan.FromCenterAndRadius( + new Location(5, 5), + Distance.FromMeters(10000)); - _map.MoveToRegion(mapSpan); - }); - } + _map.MoveToRegion(mapSpan); + }); + } - void GoBack(object sender, EventArgs e) - { - _map.Handler?.DisconnectHandler(); - Navigation.PopAsync(); - } + void GoBack(object sender, EventArgs e) + { + _map.Handler?.DisconnectHandler(); + Navigation.PopAsync(); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_DynamicChangesFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_DynamicChangesFeatureTests.cs index faef39041cde..f6ac5e307fa5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_DynamicChangesFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_DynamicChangesFeatureTests.cs @@ -165,9 +165,9 @@ public void ValidateDynamicGroupHeaderTemplateDisplayed() App.WaitForElement("IsGroupedTrue"); App.Tap("IsGroupedTrue"); App.WaitForElement("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); + App.Tap("GroupHeaderTemplateGrid"); App.WaitForElement(Apply); - App.Tap(Apply); + App.Tap(Apply); App.WaitForElement("Default GroupHeaderTemplate"); App.WaitForElement("GroupHeaderTemplateButton"); App.Tap("GroupHeaderTemplateButton"); @@ -189,7 +189,7 @@ public void ValidateDynamicGroupFooterTemplateDisplayed() App.WaitForElement("GroupFooterTemplateGrid"); App.Tap("GroupFooterTemplateGrid"); App.WaitForElement(Apply); - App.Tap(Apply); + App.Tap(Apply); App.WaitForElement("Default GroupFooterTemplate"); App.WaitForElement("GroupFooterTemplateButton"); App.Tap("GroupFooterTemplateButton"); @@ -198,9 +198,9 @@ public void ValidateDynamicGroupFooterTemplateDisplayed() App.WaitForElement("GroupFooterTemplate2"); } -#if TEST_FAILS_ON_WINDOWS -//[Testing] EmptyView(null ItemsSource) elements Not Accessible via Automation on Windows Platform Issue Link: https://github.com/dotnet/maui/issues/28022 -//EmptyViewTemplate not shown in Windows Issue Link: https://github.com/dotnet/maui/issues/28334 +#if TEST_FAILS_ON_WINDOWS + //[Testing] EmptyView(null ItemsSource) elements Not Accessible via Automation on Windows Platform Issue Link: https://github.com/dotnet/maui/issues/28022 + //EmptyViewTemplate not shown in Windows Issue Link: https://github.com/dotnet/maui/issues/28334 [Test] [Category(UITestCategories.CollectionView)] public void ValidateDynamicEmptyViewStringDisplayed() diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15253.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15253.cs index 29442e6bb551..e1efd8560c6d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15253.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15253.cs @@ -1,6 +1,6 @@ using NUnit.Framework; -using UITest.Core; using UITest.Appium; +using UITest.Core; namespace Microsoft.Maui.TestCases.Tests.Issues { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19191.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19191.cs index 16b0d35cf7a2..74db8515d949 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19191.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19191.cs @@ -12,7 +12,7 @@ public Issue19191(TestDevice device) : base(device) { } - [Test] + [Test] [Category(UITestCategories.Picker)] public void PickerTitleShouldBeRed() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs index ffb0dd6d0caa..3ae52cef6923 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs @@ -10,14 +10,14 @@ public Issue28098(TestDevice device) : base(device) { } - [Test] - [Category(UITestCategories.Picker)] - public void BlankScreenOnNavigationBack() - { - App.WaitForElement("Button"); - App.Tap("Button"); - App.WaitForElement("BackButton"); - App.Tap("BackButton"); - VerifyScreenshot(); - } + [Test] + [Category(UITestCategories.Picker)] + public void BlankScreenOnNavigationBack() + { + App.WaitForElement("Button"); + App.Tap("Button"); + App.WaitForElement("BackButton"); + App.Tap("BackButton"); + VerifyScreenshot(); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28765.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28765.cs index a06db079a839..88d837a2f018 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28765.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28765.cs @@ -6,22 +6,22 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue28765 : _IssuesUITest { - public override string Issue => "[Android] Inconsistent footer scrolling in CollectionView when EmptyView as string"; - public Issue28765(TestDevice device) : base(device) - { - } + public override string Issue => "[Android] Inconsistent footer scrolling in CollectionView when EmptyView as string"; + public Issue28765(TestDevice device) : base(device) + { + } - [Test, Order(1)] - [Category(UITestCategories.CollectionView)] - public void EmptyViewStringWithHeaderAndFooterAsView() - { - App.WaitForElement("Footer View"); - } + [Test, Order(1)] + [Category(UITestCategories.CollectionView)] + public void EmptyViewStringWithHeaderAndFooterAsView() + { + App.WaitForElement("Footer View"); + } - [Test, Order(2)] - [Category(UITestCategories.CollectionView)] - public void EmptyViewStringWithHeaderAndFooterString() - { - App.WaitForElement("Footer String"); - } + [Test, Order(2)] + [Category(UITestCategories.CollectionView)] + public void EmptyViewStringWithHeaderAndFooterString() + { + App.WaitForElement("Footer String"); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29261.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29261.cs index c7ae0a8ba43f..56566621023d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29261.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29261.cs @@ -7,22 +7,22 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue29261 : _IssuesUITest { - public override string Issue => "CarouselViewHandler2 for iOS does not properly bounce back when reaching the end with Loop=false"; + public override string Issue => "CarouselViewHandler2 for iOS does not properly bounce back when reaching the end with Loop=false"; - public Issue29261(TestDevice device) - : base(device) - { } + public Issue29261(TestDevice device) + : base(device) + { } - [Test] - [Category(UITestCategories.CarouselView)] - public void VerifyCarouselViewBounceTest() - { - App.WaitForElement("carouselview"); - App.SwipeRightToLeft("carouselview"); - App.SwipeRightToLeft("carouselview"); - App.SwipeRightToLeft("carouselview"); - var text = App.FindElement("positionLabel").GetText(); - Assert.That(text, Is.EqualTo("CarouselView Position - 2")); - } + [Test] + [Category(UITestCategories.CarouselView)] + public void VerifyCarouselViewBounceTest() + { + App.WaitForElement("carouselview"); + App.SwipeRightToLeft("carouselview"); + App.SwipeRightToLeft("carouselview"); + App.SwipeRightToLeft("carouselview"); + var text = App.FindElement("positionLabel").GetText(); + Assert.That(text, Is.EqualTo("CarouselView Position - 2")); + } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29372.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29372.cs index ef1998bebc3f..c7e91ca29f31 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29372.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29372.cs @@ -6,19 +6,19 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Issue29372 : _IssuesUITest { - public override string Issue => "CarouselView ItemsLayout Not Updating at Runtime"; + public override string Issue => "CarouselView ItemsLayout Not Updating at Runtime"; - public Issue29372(TestDevice device) - : base(device) - { } + public Issue29372(TestDevice device) + : base(device) + { } - [Test] - [Category(UITestCategories.CarouselView)] - public void VerifyCarouselLayoutOrientationChange() - { - App.WaitForElement("carouselview"); - App.Tap("ChangeItemsLayoutButton"); - VerifyScreenshot(); - } + [Test] + [Category(UITestCategories.CarouselView)] + public void VerifyCarouselLayoutOrientationChange() + { + App.WaitForElement("carouselview"); + App.Tap("ChangeItemsLayoutButton"); + VerifyScreenshot(); + } } #endif \ No newline at end of file diff --git a/src/Core/src/Platform/iOS/PickerExtensions.cs b/src/Core/src/Platform/iOS/PickerExtensions.cs index 58fcdb4b40bc..b8daa4894126 100644 --- a/src/Core/src/Platform/iOS/PickerExtensions.cs +++ b/src/Core/src/Platform/iOS/PickerExtensions.cs @@ -36,7 +36,7 @@ internal static void UpdatePicker(this MauiPicker platformPicker, IPicker picker { platformPicker.Text = picker.GetItem(selectedIndex); } - else + else { platformPicker.UpdatePickerTitle(picker); } diff --git a/src/Graphics/src/Graphics/AbstractPattern.cs b/src/Graphics/src/Graphics/AbstractPattern.cs index 269b322ec023..16d35aaaaa15 100644 --- a/src/Graphics/src/Graphics/AbstractPattern.cs +++ b/src/Graphics/src/Graphics/AbstractPattern.cs @@ -9,17 +9,17 @@ public abstract class AbstractPattern : IPattern /// Gets the width of the pattern. /// public float Width { get; } - + /// /// Gets the height of the pattern. /// public float Height { get; } - + /// /// Gets the horizontal step size for repeating the pattern. /// public float StepX { get; } - + /// /// Gets the vertical step size for repeating the pattern. /// diff --git a/src/Graphics/src/Graphics/BitmapExportContext.cs b/src/Graphics/src/Graphics/BitmapExportContext.cs index f73fe25d6f51..0df2b615642c 100644 --- a/src/Graphics/src/Graphics/BitmapExportContext.cs +++ b/src/Graphics/src/Graphics/BitmapExportContext.cs @@ -16,12 +16,12 @@ public abstract class BitmapExportContext : IDisposable /// Gets the width of the bitmap in pixels. /// public int Width { get; } - + /// /// Gets the height of the bitmap in pixels. /// public int Height { get; } - + /// /// Gets the resolution (dots per inch) of the bitmap. /// diff --git a/src/Graphics/src/Graphics/BlendMode.cs b/src/Graphics/src/Graphics/BlendMode.cs index 43ea499b08af..fc4cd09ff675 100644 --- a/src/Graphics/src/Graphics/BlendMode.cs +++ b/src/Graphics/src/Graphics/BlendMode.cs @@ -9,137 +9,137 @@ public enum BlendMode /// Normal blending mode which simply draws the source over the destination. /// Normal, - + /// /// Multiplies the colors of the source with the destination, resulting in a darker image. /// Multiply, - + /// /// Multiplies the complements of the source and destination colors, then complements the result, resulting in a lighter image. /// Screen, - + /// /// Multiplies or screens the colors depending on the destination color, preserving highlights and shadows. /// Overlay, - + /// /// Selects the darker of the source and destination colors for each pixel. /// Darken, - + /// /// Selects the lighter of the source and destination colors for each pixel. /// Lighten, - + /// /// Brightens the destination color to reflect the source color, resulting in a lighter image. /// ColorDodge, - + /// /// Darkens the destination color to reflect the source color, resulting in a darker image. /// ColorBurn, - + /// /// Darkens or lightens the colors depending on the source color, creating a subtle effect. /// SoftLight, - + /// /// Similar to overlay but with source and destination reversed, creating a more dramatic effect. /// HardLight, - + /// /// Subtracts the darker of the two colors from the lighter color, creating an inverted effect. /// Difference, - + /// /// Similar to difference but with lower contrast, resulting in a more muted effect. /// Exclusion, - + /// /// Preserves the hue of the source color while using the saturation and luminosity of the destination. /// Hue, - + /// /// Preserves the saturation of the source color while using the hue and luminosity of the destination. /// Saturation, - + /// /// Preserves the hue and saturation of the source color while using the luminosity of the destination. /// Color, - + /// /// Preserves the luminosity of the source color while using the hue and saturation of the destination. /// Luminosity, - + /// /// Clears the destination area, making it fully transparent. /// Clear, - + /// /// Copies the source over the destination, ignoring the destination. /// Copy, - + /// /// Shows the source where both the source and destination overlap, otherwise displays transparency. /// SourceIn, - + /// /// Shows the source where it doesn't overlap with the destination, otherwise displays transparency. /// SourceOut, - + /// /// Shows the source where it overlaps with non-transparent parts of the destination. /// SourceAtop, - + /// /// Shows the destination over the source. /// DestinationOver, - + /// /// Shows the destination where both the source and destination overlap, otherwise displays transparency. /// DestinationIn, - + /// /// Shows the destination where it doesn't overlap with the source, otherwise displays transparency. /// DestinationOut, - + /// /// Shows the destination where it overlaps with non-transparent parts of the source. /// DestinationAtop, - + /// /// Shows the source where it doesn't overlap with the destination and shows the destination where it doesn't overlap with the source. /// Xor, - + /// /// Adds the source and destination colors, favoring darker results. /// PlusDarker, - + /// /// Adds the source and destination colors, favoring lighter results. /// diff --git a/src/Graphics/src/Graphics/CanvasDefaults.cs b/src/Graphics/src/Graphics/CanvasDefaults.cs index 28f6e92e9985..37ea446a6e4f 100644 --- a/src/Graphics/src/Graphics/CanvasDefaults.cs +++ b/src/Graphics/src/Graphics/CanvasDefaults.cs @@ -9,17 +9,17 @@ public static class CanvasDefaults /// The default shadow color, which is black with 50% opacity. /// public static readonly Color DefaultShadowColor = new Color(0f, 0f, 0f, .5f); - + /// /// The default shadow offset, which is 5 units in both x and y directions. /// public static readonly SizeF DefaultShadowOffset = new SizeF(5, 5); - + /// /// The default shadow blur value, which is 5. /// public const float DefaultShadowBlur = 5; - + /// /// The default miter limit value, which is 10. /// diff --git a/src/Graphics/src/Graphics/CanvasState.cs b/src/Graphics/src/Graphics/CanvasState.cs index 1261f77786ab..803ff0ed212a 100644 --- a/src/Graphics/src/Graphics/CanvasState.cs +++ b/src/Graphics/src/Graphics/CanvasState.cs @@ -12,12 +12,12 @@ public class CanvasState : IDisposable /// Gets or sets the pattern of dashes and gaps used to stroke paths. /// public float[] StrokeDashPattern { get; set; } - + /// /// Gets or sets the distance into the dash pattern to start the dash. /// public float StrokeDashOffset { get; set; } = 1; - + /// /// Gets or sets the width of the stroke used to draw an object's outline. /// @@ -44,17 +44,17 @@ public Matrix3x2 Transform TransformChanged(); } } - + /// /// Gets the uniform scale factor derived from the transformation matrix. /// public float Scale => this._scale; - + /// /// Gets the horizontal scale factor derived from the transformation matrix. /// public float ScaleX => this._scaleX; - + /// /// Gets the vertical scale factor derived from the transformation matrix. /// diff --git a/src/Graphics/src/Graphics/Color.cs b/src/Graphics/src/Graphics/Color.cs index 1e14e54df9eb..725cb28ad67c 100644 --- a/src/Graphics/src/Graphics/Color.cs +++ b/src/Graphics/src/Graphics/Color.cs @@ -18,17 +18,17 @@ public class Color /// The red component of the color, ranging from 0.0 to 1.0. /// public readonly float Red; - + /// /// The green component of the color, ranging from 0.0 to 1.0. /// public readonly float Green; - + /// /// The blue component of the color, ranging from 0.0 to 1.0. /// public readonly float Blue; - + /// /// The alpha (opacity) component of the color, ranging from 0.0 (transparent) to 1.0 (opaque). /// diff --git a/src/Graphics/src/Graphics/Font.cs b/src/Graphics/src/Graphics/Font.cs index 047cfd2ed787..6e551b77e0ed 100644 --- a/src/Graphics/src/Graphics/Font.cs +++ b/src/Graphics/src/Graphics/Font.cs @@ -16,82 +16,82 @@ public static class FontWeights /// Represents a thin font weight (100). /// public const int Thin = 100; - + /// /// Represents an extra light font weight (200). /// public const int ExtraLight = 200; - + /// /// Represents an ultra light font weight (200), equivalent to ExtraLight. /// public const int UltraLight = 200; - + /// /// Represents a light font weight (300). /// public const int Light = 300; - + /// /// Represents a semi-light font weight (400), equivalent to Normal. /// public const int SemiLight = 400; - + /// /// Represents a normal font weight (400). /// public const int Normal = 400; - + /// /// Represents a regular font weight (400), equivalent to Normal. /// public const int Regular = 400; - + /// /// Represents a medium font weight (500). /// public const int Medium = 500; - + /// /// Represents a demi-bold font weight (600), equivalent to SemiBold. /// public const int DemiBold = 600; - + /// /// Represents a semi-bold font weight (600). /// public const int SemiBold = 600; - + /// /// Represents a bold font weight (700). /// public const int Bold = 700; - + /// /// Represents an extra bold font weight (800). /// public const int ExtraBold = 800; - + /// /// Represents an ultra bold font weight (800), equivalent to ExtraBold. /// public const int UltraBold = 800; - + /// /// Represents a black font weight (900). /// public const int Black = 900; - + /// /// Represents a heavy font weight (900), equivalent to Black. /// public const int Heavy = 900; - + /// /// Represents an extra black font weight (950). /// public const int ExtraBlack = 950; - + /// /// Represents an ultra black font weight (950), equivalent to ExtraBlack. /// @@ -132,12 +132,12 @@ public Font(string name, int weight = FontWeights.Normal, FontStyleType styleTyp /// Gets the font name or family. /// public string Name { get; private set; } - + /// /// Gets the font weight. /// public int Weight { get; private set; } - + /// /// Gets the font style type. /// diff --git a/src/Graphics/src/Graphics/FontSource.cs b/src/Graphics/src/Graphics/FontSource.cs index f591d7cab772..ff6b32d4d0b8 100644 --- a/src/Graphics/src/Graphics/FontSource.cs +++ b/src/Graphics/src/Graphics/FontSource.cs @@ -22,17 +22,17 @@ public FontSource(string filename, int weight = FontWeights.Normal, FontStyleTyp Weight = weight; FontStyleType = fontStyleType; } - + /// /// Gets the font file name or font family name. /// public readonly string Name; - + /// /// Gets the font weight. /// public readonly int Weight; - + /// /// Gets the font style type. /// diff --git a/src/Graphics/src/Graphics/FontStyleType.cs b/src/Graphics/src/Graphics/FontStyleType.cs index e7b9d42c68a9..fa9f9fa39850 100644 --- a/src/Graphics/src/Graphics/FontStyleType.cs +++ b/src/Graphics/src/Graphics/FontStyleType.cs @@ -12,12 +12,12 @@ public enum FontStyleType /// A normal, upright font style. /// Normal, - + /// /// An italic font style, typically slanted and based on a specially designed italic typeface. /// Italic, - + /// /// An oblique font style, typically a slanted version of the regular typeface. /// diff --git a/src/Graphics/src/Graphics/HorizontalAlignment.cs b/src/Graphics/src/Graphics/HorizontalAlignment.cs index 276877aba85d..63a151909151 100644 --- a/src/Graphics/src/Graphics/HorizontalAlignment.cs +++ b/src/Graphics/src/Graphics/HorizontalAlignment.cs @@ -9,17 +9,17 @@ public enum HorizontalAlignment /// Aligns content to the left edge. /// Left = 0, - + /// /// Centers content horizontally. /// Center = 1, - + /// /// Aligns content to the right edge. /// Right = 2, - + /// /// Adjusts spacing to fill the available width, creating even left and right edges. /// diff --git a/src/Graphics/src/Graphics/IImage.cs b/src/Graphics/src/Graphics/IImage.cs index ca352574df21..832b42bd02e7 100644 --- a/src/Graphics/src/Graphics/IImage.cs +++ b/src/Graphics/src/Graphics/IImage.cs @@ -14,12 +14,12 @@ public enum ResizeMode /// May leave empty space if the aspect ratios don't match. /// Fit, - + /// /// Preserves aspect ratio and fills the target dimensions, potentially cropping the image. /// Bleed, - + /// /// Ignores aspect ratio and stretches the image to exactly fit the target dimensions. /// @@ -35,12 +35,12 @@ public interface IImage : IDrawable, IDisposable /// Gets the width of the image in pixels. /// float Width { get; } - + /// /// Gets the height of the image in pixels. /// float Height { get; } - + /// /// Creates a downsized version of the image with the same aspect ratio. /// @@ -48,7 +48,7 @@ public interface IImage : IDrawable, IDisposable /// Whether to dispose the original image after downsizing. /// A new with the downsized dimensions. IImage Downsize(float maxWidthOrHeight, bool disposeOriginal = false); - + /// /// Creates a downsized version of the image that fits within the specified dimensions. /// @@ -57,7 +57,7 @@ public interface IImage : IDrawable, IDisposable /// Whether to dispose the original image after downsizing. /// A new with the downsized dimensions. IImage Downsize(float maxWidth, float maxHeight, bool disposeOriginal = false); - + /// /// Resizes the image to the specified dimensions using the specified resize mode. /// @@ -67,7 +67,7 @@ public interface IImage : IDrawable, IDisposable /// Whether to dispose the original image after resizing. /// A new with the resized dimensions. IImage Resize(float width, float height, ResizeMode resizeMode = ResizeMode.Fit, bool disposeOriginal = false); - + /// /// Saves the image to a stream in the specified format. /// @@ -77,7 +77,7 @@ public interface IImage : IDrawable, IDisposable /// Thrown when is null. /// Thrown when is not between 0.0 and 1.0. void Save(Stream stream, ImageFormat format = ImageFormat.Png, float quality = 1); - + /// /// Asynchronously saves the image to a stream in the specified format. /// @@ -88,7 +88,7 @@ public interface IImage : IDrawable, IDisposable /// Thrown when is null. /// Thrown when is not between 0.0 and 1.0. Task SaveAsync(Stream stream, ImageFormat format = ImageFormat.Png, float quality = 1); - + /// /// Creates a platform-specific representation of this image. /// diff --git a/src/Graphics/src/Graphics/IPattern.cs b/src/Graphics/src/Graphics/IPattern.cs index c640472de5ac..b455f2a18b87 100644 --- a/src/Graphics/src/Graphics/IPattern.cs +++ b/src/Graphics/src/Graphics/IPattern.cs @@ -9,22 +9,22 @@ public interface IPattern /// Gets the width of the pattern. /// float Width { get; } - + /// /// Gets the height of the pattern. /// float Height { get; } - + /// /// Gets the horizontal step size for repeating the pattern. /// float StepX { get; } - + /// /// Gets the vertical step size for repeating the pattern. /// float StepY { get; } - + /// /// Draws the pattern onto the specified canvas. /// diff --git a/src/Graphics/src/Graphics/IPdfPage.cs b/src/Graphics/src/Graphics/IPdfPage.cs index e1909d5f863d..6e21fce4fa18 100644 --- a/src/Graphics/src/Graphics/IPdfPage.cs +++ b/src/Graphics/src/Graphics/IPdfPage.cs @@ -13,12 +13,12 @@ public interface IPdfPage : IDrawable, IDisposable /// Gets the width of the PDF page. /// float Width { get; } - + /// /// Gets the height of the PDF page. /// float Height { get; } - + /// /// Gets the page number within the PDF document. /// @@ -31,7 +31,7 @@ public interface IPdfPage : IDrawable, IDisposable /// Thrown when is null. /// Thrown when an I/O error occurs. void Save(Stream stream); - + /// /// Asynchronously saves the PDF page to the specified stream. /// diff --git a/src/Graphics/src/Graphics/IPlatformFonts.cs b/src/Graphics/src/Graphics/IPlatformFonts.cs index c51e1e8d06b8..def58094f0d5 100644 --- a/src/Graphics/src/Graphics/IPlatformFonts.cs +++ b/src/Graphics/src/Graphics/IPlatformFonts.cs @@ -15,7 +15,7 @@ public interface IPlatformFonts /// Gets the default platform font. /// IFont Default { get; } - + /// /// Gets the default bold platform font. /// diff --git a/src/Graphics/src/Graphics/ImageFormat.cs b/src/Graphics/src/Graphics/ImageFormat.cs index d6a55477e591..de2fb5ea300b 100644 --- a/src/Graphics/src/Graphics/ImageFormat.cs +++ b/src/Graphics/src/Graphics/ImageFormat.cs @@ -9,22 +9,22 @@ public enum ImageFormat /// Portable Network Graphics format, which supports lossless compression and transparency. /// Png, - + /// /// Joint Photographic Experts Group format, which uses lossy compression optimized for photographs. /// Jpeg, - + /// /// Graphics Interchange Format, which supports animation and a limited color palette with transparency. /// Gif, - + /// /// Tagged Image File Format, which supports multiple images, layers, and various compression methods. /// Tiff, - + /// /// Bitmap format, which stores pixel data with minimal or no compression. /// diff --git a/src/Graphics/src/Graphics/LineCap.cs b/src/Graphics/src/Graphics/LineCap.cs index 28ae1464af9a..66ea5fe02706 100644 --- a/src/Graphics/src/Graphics/LineCap.cs +++ b/src/Graphics/src/Graphics/LineCap.cs @@ -9,12 +9,12 @@ public enum LineCap /// The line ends at the endpoint with no extension. /// Butt, - + /// /// The line is capped with a semicircle whose diameter equals the line thickness. /// Round, - + /// /// The line is capped with a square that has the same width as the line thickness and extends beyond the end point by half the line thickness. /// diff --git a/src/Graphics/src/Graphics/LineJoin.cs b/src/Graphics/src/Graphics/LineJoin.cs index 28839fc48ebc..b5906207c50d 100644 --- a/src/Graphics/src/Graphics/LineJoin.cs +++ b/src/Graphics/src/Graphics/LineJoin.cs @@ -10,12 +10,12 @@ public enum LineJoin /// If the joint's angle is too sharp, a bevel join is used instead. /// Miter, - + /// /// Creates a rounded corner at the joint. The corner is filled with a circle with the diameter equal to the line width. /// Round, - + /// /// Creates a beveled corner at the joint. The joint is filled by a triangle that connects the outer edges of the lines. /// diff --git a/src/Graphics/src/Graphics/PaintPattern.cs b/src/Graphics/src/Graphics/PaintPattern.cs index d25f10ba26ab..ecb02b2f12be 100644 --- a/src/Graphics/src/Graphics/PaintPattern.cs +++ b/src/Graphics/src/Graphics/PaintPattern.cs @@ -9,7 +9,7 @@ public class PaintPattern : IPattern /// Gets the wrapped pattern that this pattern applies a paint to. /// public IPattern Wrapped { get; } - + /// /// Gets or sets the paint to apply to the wrapped pattern. /// @@ -19,17 +19,17 @@ public class PaintPattern : IPattern /// Gets the width of the pattern, which is the width of the wrapped pattern or 0 if there is no wrapped pattern. /// public float Width => Wrapped?.Width ?? 0; - + /// /// Gets the height of the pattern, which is the height of the wrapped pattern or 0 if there is no wrapped pattern. /// public float Height => Wrapped?.Height ?? 0; - + /// /// Gets the horizontal step size for repeating the pattern, which is the step X of the wrapped pattern or 0 if there is no wrapped pattern. /// public float StepX => Wrapped?.StepX ?? 0; - + /// /// Gets the vertical step size for repeating the pattern, which is the step Y of the wrapped pattern or 0 if there is no wrapped pattern. /// diff --git a/src/Graphics/src/Graphics/PathOperation.cs b/src/Graphics/src/Graphics/PathOperation.cs index 8afd01c2355f..5aa6f8decf1f 100644 --- a/src/Graphics/src/Graphics/PathOperation.cs +++ b/src/Graphics/src/Graphics/PathOperation.cs @@ -9,27 +9,27 @@ public enum PathOperation /// Moves the current point to a new location without drawing a line. /// Move, - + /// /// Draws a straight line from the current point to a new point. /// Line, - + /// /// Draws a quadratic Bézier curve using the current point, a control point, and an end point. /// Quad, - + /// /// Draws a cubic Bézier curve using the current point, two control points, and an end point. /// Cubic, - + /// /// Draws an elliptical arc from the current point to a specified point. /// Arc, - + /// /// Closes the current subpath by drawing a straight line from the current point to the first point of the subpath. /// diff --git a/src/Graphics/src/Graphics/PictureCommand.cs b/src/Graphics/src/Graphics/PictureCommand.cs index 129cba8d3607..93f53647a460 100644 --- a/src/Graphics/src/Graphics/PictureCommand.cs +++ b/src/Graphics/src/Graphics/PictureCommand.cs @@ -9,37 +9,37 @@ public enum PictureCommand /// Draws a line between two points. /// DrawLine = 0, - + /// /// Draws the outline of a rectangle. /// DrawRectangle = 1, - + /// /// Draws the outline of a rectangle with rounded corners. /// DrawRoundedRectangle = 2, - + /// /// Draws the outline of an ellipse. /// DrawEllipse = 3, - + /// /// Draws the outline of a path. /// DrawPath = 4, - + /// /// Draws an image. /// DrawImage = 5, - + /// /// Draws an arc. /// DrawArc = 6, - + /// /// Draws a PDF page. /// @@ -49,27 +49,27 @@ public enum PictureCommand /// Fills a rectangle with the current fill color or paint. /// FillRectangle = 10, - + /// /// Fills a rectangle with rounded corners with the current fill color or paint. /// FillRoundedRectangle = 11, - + /// /// Fills an ellipse with the current fill color or paint. /// FillEllipse = 12, - + /// /// Fills a path with the current fill color or paint. /// FillPath = 13, - + /// /// Fills an arc with the current fill color or paint. /// FillArc = 14, - + /// /// Alternative command for filling a path. /// @@ -79,17 +79,17 @@ public enum PictureCommand /// Draws text at a specific point. /// DrawStringAtPoint = 20, - + /// /// Draws text within a rectangle with alignment. /// DrawStringInRect = 21, - + /// /// Draws text along a path. /// DrawStringInPath = 22, - + /// /// Draws formatted text within a rectangle. /// @@ -99,27 +99,27 @@ public enum PictureCommand /// Sets the stroke width. /// StrokeSize = 30, - + /// /// Sets the stroke color. /// StrokeColor = 31, - + /// /// Sets the stroke dash pattern. /// StrokeDashPattern = 32, - + /// /// Sets the stroke line cap style. /// StrokeLineCap = 33, - + /// /// Sets the stroke line join style. /// StrokeLineJoin = 34, - + /// /// Sets the stroke location. /// @@ -127,22 +127,22 @@ public enum PictureCommand /// Sets the stroke location. /// StrokeLocation = 35, - + /// /// Sets the miter limit for stroke line joins. /// StrokeMiterLimit = 36, - + /// /// Controls whether stroke scaling is limited. /// LimitStrokeScaling = 37, - + /// /// Sets the stroke limit. /// StrokeLimit = 38, - + /// /// Sets the stroke brush. /// @@ -152,7 +152,7 @@ public enum PictureCommand /// Sets the fill color. /// FillColor = 40, - + /// /// Sets the fill paint (gradient, pattern, etc.). /// @@ -162,12 +162,12 @@ public enum PictureCommand /// Sets the font color. /// FontColor = 50, - + /// /// Sets the font name or family. /// FontName = 51, - + /// /// Sets the font size. /// @@ -177,22 +177,22 @@ public enum PictureCommand /// Applies a scaling transformation. /// Scale = 60, - + /// /// Applies a translation transformation. /// Translate = 61, - + /// /// Applies a rotation transformation around the origin. /// Rotate = 62, - + /// /// Applies a rotation transformation around a specified point. /// RotateAtPoint = 63, - + /// /// Concatenates a transformation matrix with the current transformation. /// @@ -202,12 +202,12 @@ public enum PictureCommand /// Sets shadow properties. /// Shadow = 70, - + /// /// Sets the global alpha (transparency) value. /// Alpha = 71, - + /// /// Sets the blend mode for compositing. /// @@ -217,17 +217,17 @@ public enum PictureCommand /// Subtracts a region from the current clipping area. /// SubtractFromClip = 80, - + /// /// Sets the clipping area to a path. /// ClipPath = 81, - + /// /// Sets the clipping area to a rectangle. /// ClipRectangle = 82, - + /// /// Subtracts a path from the current clipping area. /// @@ -237,12 +237,12 @@ public enum PictureCommand /// Saves the current graphics state on a stack. /// SaveState = 100, - + /// /// Restores the most recently saved graphics state. /// RestoreState = 101, - + /// /// Resets the graphics state to its default values. /// diff --git a/src/Graphics/src/Graphics/Size.cs b/src/Graphics/src/Graphics/Size.cs index 5ab44f9f6428..4a1558c9fc35 100644 --- a/src/Graphics/src/Graphics/Size.cs +++ b/src/Graphics/src/Graphics/Size.cs @@ -196,7 +196,7 @@ public void Deconstruct(out double width, out double height) width = Width; height = Height; } - + /// /// Implicitly converts a to a . /// diff --git a/src/Graphics/src/Graphics/StandardPicture.cs b/src/Graphics/src/Graphics/StandardPicture.cs index 5e11f9650ccd..052f97e7a0a5 100644 --- a/src/Graphics/src/Graphics/StandardPicture.cs +++ b/src/Graphics/src/Graphics/StandardPicture.cs @@ -17,22 +17,22 @@ public class StandardPicture : IPicture /// Gets the x-coordinate of the picture's origin. /// public float X { get; } - + /// /// Gets the y-coordinate of the picture's origin. /// public float Y { get; } - + /// /// Gets the width of the picture. /// public float Width { get; } - + /// /// Gets the height of the picture. /// public float Height { get; } - + /// /// Gets or sets a hash value that uniquely identifies this picture's content. /// diff --git a/src/Graphics/src/Graphics/TextFlow.cs b/src/Graphics/src/Graphics/TextFlow.cs index d80d90cbb773..98a25c3dcaaa 100644 --- a/src/Graphics/src/Graphics/TextFlow.cs +++ b/src/Graphics/src/Graphics/TextFlow.cs @@ -9,7 +9,7 @@ public enum TextFlow /// Text that exceeds the bounds will be clipped (not visible). /// ClipBounds = 0, - + /// /// Text that exceeds the bounds will still be rendered, potentially overlapping with other elements. /// diff --git a/src/Graphics/src/Graphics/VerticalAlignment.cs b/src/Graphics/src/Graphics/VerticalAlignment.cs index 1d0564dce025..e59fb9596114 100644 --- a/src/Graphics/src/Graphics/VerticalAlignment.cs +++ b/src/Graphics/src/Graphics/VerticalAlignment.cs @@ -9,12 +9,12 @@ public enum VerticalAlignment /// Aligns content to the top edge. /// Top = 0, - + /// /// Centers content vertically. /// Center = 1, - + /// /// Aligns content to the bottom edge. /// diff --git a/src/Graphics/src/Graphics/WindingMode.cs b/src/Graphics/src/Graphics/WindingMode.cs index 345e39d7129f..c5cbe25ed6d2 100644 --- a/src/Graphics/src/Graphics/WindingMode.cs +++ b/src/Graphics/src/Graphics/WindingMode.cs @@ -10,7 +10,7 @@ public enum WindingMode /// A point is inside the shape if a ray from that point to infinity crosses path segments with a non-zero net number of clockwise versus counter-clockwise crossings. /// NonZero = 0, - + /// /// Uses the even-odd rule, which fills regions based on alternating crossings. /// A point is inside the shape if a ray from that point to infinity crosses an odd number of path segments. diff --git a/src/Graphics/src/Graphics/XmlnsDefinitionAttribute.cs b/src/Graphics/src/Graphics/XmlnsDefinitionAttribute.cs index f3caaddd65af..30f8b60e288c 100644 --- a/src/Graphics/src/Graphics/XmlnsDefinitionAttribute.cs +++ b/src/Graphics/src/Graphics/XmlnsDefinitionAttribute.cs @@ -17,7 +17,7 @@ internal sealed class XmlnsDefinitionAttribute : Attribute /// Gets the XML namespace. /// public string XmlNamespace { get; } - + /// /// Gets the CLR namespace. /// diff --git a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs index b4d00a47bb90..48692ad4b6fe 100644 --- a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs +++ b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs @@ -20,7 +20,7 @@ public void BuildMultiProject(string config, string projectName) // Always remove WinUI project if the project name contains special characters that cause WinRT source generator issues // See: https://github.com/microsoft/CsWinRT/issues/1809 (under "Special characters in assembly name" section) bool containsSpecialChars = projectName.IndexOfAny(new[] { '@', '&', '+', '%', '!', '#', '$', '^', '*', ' ', '-' }) >= 0; - + if (!TestEnvironment.IsWindows || containsSpecialChars) { Assert.IsTrue(DotnetInternal.Run("sln", $"\"{solutionFile}\" remove \"{projectDir}/{name}.WinUI/{name}.WinUI.csproj\""), @@ -65,7 +65,7 @@ public void BuildMultiProjectSinglePlatform(string config, string platformArg) [TestCase("--windows")] [TestCase("--macos")] [TestCase("")] // no platform arg means all platforms - // https://github.com/dotnet/maui/issues/28695 + // https://github.com/dotnet/maui/issues/28695 public void VerifyIncludedPlatformsInSln(string platformArg) { var projectDir = TestDirectory; @@ -109,7 +109,7 @@ public void VerifyIncludedPlatformsInSln(string platformArg) expectedCsprojFiles.Remove("WinUI.csproj"); break; } - + // Depending on the platform argument, we assert if the expected projects are included in the solution foreach (var platformCsproj in expectedCsprojFiles) {