Skip to content

Commit

Permalink
[create-pull-request] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 29, 2024
1 parent 7c7bf67 commit f9ba909
Show file tree
Hide file tree
Showing 81 changed files with 464 additions and 450 deletions.
2 changes: 1 addition & 1 deletion src/Compatibility/Core/src/Tizen/ResourcePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static string GetPath(string res)
return res;
}

foreach (AppFW.ResourceManager.Category category in Enum.GetValues<AppFW.ResourceManager.Category>())
foreach (AppFW.ResourceManager.Category category in Enum.GetValues<AppFW.ResourceManager.Category>())
{
var path = AppFW.ResourceManager.TryGetPath(category, res);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using Microsoft.UI.Xaml;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
Expand All @@ -26,24 +26,24 @@ namespace Maui.Controls.Sample.WinUI;
/// </summary>
public partial class App : Microsoft.UI.Xaml.Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
}
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
}

/// <summary>
/// Invoked when the application is launched.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new MainWindow();
m_window.Activate();
}
/// <summary>
/// Invoked when the application is launched.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new MainWindow();
m_window.Activate();
}

private Microsoft.UI.Xaml.Window? m_window;
private Microsoft.UI.Xaml.Window? m_window;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#nullable enable
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;

namespace Maui.Controls.Sample.Pages.CollectionViewGalleries.EmptyViewGalleries
{
Expand All @@ -17,59 +17,59 @@ public partial class EmptyViewWithDataTemplateSelector : ContentPage
public EmptyViewWithDataTemplateSelector()
{
InitializeComponent();
var emptyViewTemplateSelector = new SearchTermDataTemplateSelector
{
DefaultTemplate = (DataTemplate)Resources["AdvancedTemplate"],
OtherTemplate = (DataTemplate)Resources["BasicTemplate"]
};
collectionView.EmptyViewTemplate = emptyViewTemplateSelector;
BindingContext = new EmptyViewWithDataTemplateSelectorViewModel();
var emptyViewTemplateSelector = new SearchTermDataTemplateSelector
{
DefaultTemplate = (DataTemplate)Resources["AdvancedTemplate"],
OtherTemplate = (DataTemplate)Resources["BasicTemplate"]
};
collectionView.EmptyViewTemplate = emptyViewTemplateSelector;
BindingContext = new EmptyViewWithDataTemplateSelectorViewModel();
}

public class Monkey
{
public string? Name { get; set; }
public string? Location { get; set; }
public string? Details { get; set; }
}
{
public string? Name { get; set; }
public string? Location { get; set; }
public string? Details { get; set; }
}

public class SearchTermDataTemplateSelector : DataTemplateSelector
{
public DataTemplate? DefaultTemplate { get; set; }
public DataTemplate? OtherTemplate { get; set; }
{
public DataTemplate? DefaultTemplate { get; set; }
public DataTemplate? OtherTemplate { get; set; }

protected override DataTemplate? OnSelectTemplate(object item, BindableObject container)
protected override DataTemplate? OnSelectTemplate(object item, BindableObject container)
{
string query = (string)item;
return query.Equals("xamarin", StringComparison.OrdinalIgnoreCase) ? OtherTemplate : DefaultTemplate;
}
}
}

internal class EmptyViewWithDataTemplateSelectorViewModel
{
public ObservableCollection<Monkey> Monkeys { get; } = new();
public ICommand FilterCommand => new Command<string>(FilterItems);
public ICommand FilterCommand => new Command<string>(FilterItems);

public EmptyViewWithDataTemplateSelectorViewModel()
{
// Directly populate the ObservableCollection
Monkeys.Add(new Monkey
{
Name = "Baboon",
Location = "Africa & Asia",
Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae."
});
}
public EmptyViewWithDataTemplateSelectorViewModel()
{
// Directly populate the ObservableCollection
Monkeys.Add(new Monkey
{
Name = "Baboon",
Location = "Africa & Asia",
Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae."
});
}

private void FilterItems(string filter)
{
var filteredItems = Monkeys.Where(monkey => monkey.Name?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false).ToList();
Monkeys.Clear();
foreach (var monkey in filteredItems)
{
Monkeys.Add(monkey);
}
}
private void FilterItems(string filter)
{
var filteredItems = Monkeys.Where(monkey => monkey.Name?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false).ToList();
Monkeys.Clear();
foreach (var monkey in filteredItems)
{
Monkeys.Add(monkey);
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ static bool TryParsePath(ILContext context, string path, TypeReference tSourceRe
{
if (previousPartTypeRef.IsArray)
previousPartTypeRef = previousPartTypeRef.GetElementType();

previousPartTypeRef.ResolveCached(context.Cache);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#nullable disable
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Graphics;

namespace Microsoft.Maui.Controls.Handlers.Compatibility
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class CarouselViewHandler : ItemsViewHandler<CarouselView>
ScrollViewer _scrollViewer;
WScrollBarVisibility? _horizontalScrollBarVisibilityWithoutLoop;
WScrollBarVisibility? _verticalScrollBarVisibilityWithoutLoop;
Size _currentSize;
Size _currentSize;
bool _isCarouselViewReady;
NotifyCollectionChangedEventHandler _collectionChanged;
readonly WeakNotifyCollectionChangedProxy _proxy = new();
Expand Down Expand Up @@ -195,7 +195,7 @@ public static void MapPosition(CarouselViewHandler handler, CarouselView carouse
{
handler.UpdatePosition();
}

}

public static void MapIsBounceEnabled(CarouselViewHandler handler, CarouselView carouselView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ object FindBoundItem(ScrollToRequestEventArgs args)
{
// CollectionGroups property is of type IObservableVector, but these objects should implement ICollectionViewGroup
var itemGroup = CollectionViewSource.View.CollectionGroups[args.GroupIndex] as ICollectionViewGroup;
if (itemGroup != null &&
if (itemGroup != null &&
args.Index < itemGroup.GroupItems.Count)
{
return itemGroup.GroupItems[args.Index];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal void SelectItem(object selectedItem)

if (index.Section > -1 && index.Item > -1)
{
// Ensure the selected index is updated after the collection view's items generation is completed
// Ensure the selected index is updated after the collection view's items generation is completed
CollectionView.PerformBatchUpdates(null, _ =>
{
CollectionView.SelectItem(index, true, UICollectionViewScrollPosition.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal void SelectItem(object selectedItem)

if (index.Section > -1 && index.Item > -1)
{
// Ensure the selected index is updated after the collection view's items generation is completed
// Ensure the selected index is updated after the collection view's items generation is completed
CollectionView.PerformBatchUpdates(null, _ =>
{
CollectionView.SelectItem(index, true, UICollectionViewScrollPosition.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ public VisualElement? Element
if (_element == value)
return;

if (_element is View && ElementGestureRecognizers is {} gestureRecognizersBefore)
if (_element is View && ElementGestureRecognizers is { } gestureRecognizersBefore)
{
gestureRecognizersBefore.CollectionChanged -= _collectionChangedHandler;
}

_element = value;

if (_element is View && ElementGestureRecognizers is {} gestureRecognizersAfter)
if (_element is View && ElementGestureRecognizers is { } gestureRecognizersAfter)
{
gestureRecognizersAfter.CollectionChanged += _collectionChangedHandler;
}
Expand Down Expand Up @@ -385,7 +385,7 @@ protected virtual void Dispose(bool disposing)

ClearContainerEventHandlers();

if (_element is View && ElementGestureRecognizers is {} gestureRecognizers)
if (_element is View && ElementGestureRecognizers is { } gestureRecognizers)
{
gestureRecognizers.CollectionChanged -= _collectionChangedHandler;
}
Expand Down Expand Up @@ -425,7 +425,7 @@ void HandlePan(ManipulationDeltaRoutedEventArgs e, View view)
{
if (view == null)
return;

_isPanning = true;

foreach (IPanGestureController recognizer in view.GestureRecognizers.GetGesturesFor<PanGestureRecognizer>().Where(g => g.TouchPoints == _fingers.Count))
Expand Down Expand Up @@ -517,7 +517,7 @@ void OnPointerExited(object sender, PointerRoutedEventArgs e)
if (_fingers.Contains(id))
_fingers.Remove(id);
}

SwipeComplete(true);
PinchComplete(true);
}
Expand Down Expand Up @@ -756,7 +756,7 @@ void UpdateDragAndDropGestureRecognizers()
if (allowDrop)
{
_subscriptionFlags |= SubscriptionFlags.ContainerDropEventsSubscribed;

_container.AllowDrop = true;
_container.DragOver += HandleDragOver;
_container.Drop += HandleDrop;
Expand Down Expand Up @@ -784,7 +784,7 @@ void UpdatingGestureRecognizers()
{
_subscriptionFlags |= SubscriptionFlags.ContainerTapAndRightTabEventSubscribed;
_tappedEventHandler = new TappedEventHandler(OnTap);
_container.AddHandler(FrameworkElement.TappedEvent,_tappedEventHandler, true);
_container.AddHandler(FrameworkElement.TappedEvent, _tappedEventHandler, true);
_container.RightTapped += OnTap;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ internal void Realize()
var content = dataTemplate.CreateContent();
_visualElement = content as VisualElement;

if(_visualElement is null)
if (_visualElement is null)
{
throw new InvalidOperationException($"{dataTemplate} could not be created from {content}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ IEnumerator IEnumerable.GetEnumerator()
return ((IEnumerable)_internal).GetEnumerator();
}

void OnItemsVectorChanged(global::Windows.Foundation.Collections.IObservableVector<object> sender,
void OnItemsVectorChanged(global::Windows.Foundation.Collections.IObservableVector<object> sender,
global::Windows.Foundation.Collections.IVectorChangedEventArgs @event)
{
_vectorChanged.Invoke(sender, @event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ internal static void JumpToIndexAsync(ListViewBase list, int index, ScrollToPosi

public static async Task JumpToItemAsync(ListViewBase list, object targetItem, ScrollToPosition scrollToPosition)
{
if(!list.IsLoaded)
if (!list.IsLoaded)
{
list.OnLoaded(async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ internal static void SetLineBreakMode(this TextBlock textBlock, LineBreakMode li
throw new ArgumentOutOfRangeException();
}
}

internal static void SetTextReadingOrder(this TextBlock platformControl, bool detectReadingOrderFromContent) =>
platformControl.TextReadingOrder = detectReadingOrderFromContent
? TextReadingOrder.DetectFromContent
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/RadioButton/RadioButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ public string ContentAsString()

Font ITextStyle.Font => this.ToFont();

#if ANDROID
#if ANDROID
object IContentView.Content
{
get
Expand Down
8 changes: 4 additions & 4 deletions src/Controls/src/Core/Shell/ShellContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ internal void EvaluateDisconnect()

Shell shell = null;

if (Parent is ShellSection shellSection &&
shellSection.Parent is ShellItem shellItem &&
shellItem.Parent is Shell shellInstance)
if (Parent is ShellSection shellSection &&
shellSection.Parent is ShellItem shellItem &&
shellItem.Parent is Shell shellInstance)
{
shell = shellInstance;
disconnect =
disconnect =
!this.IsVisible || // user has set the IsVisible property to false
(_contentCache is not null && !_contentCache.IsVisible) || // user has set IsVisible on the Page to false
shell.CurrentItem != shellItem || // user has navigated to a different TabBar or a different FlyoutItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public async Task InnerCornerRadiusInitializesCorrectly(int cornerRadius)

var border = new Border()
{
Content = new Label
{
Text = "Background",
TextColor = Colors.Red,
FontFamily = "Segoe UI",
HorizontalOptions = LayoutOptions.Center,
Content = new Label
{
Text = "Background",
TextColor = Colors.Red,
FontFamily = "Segoe UI",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
},
HorizontalOptions = LayoutOptions.Center,
Expand Down
Loading

0 comments on commit f9ba909

Please sign in to comment.