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 Dec 28, 2024
1 parent 2e0e688 commit fe000d4
Show file tree
Hide file tree
Showing 267 changed files with 1,565 additions and 1,530 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
2 changes: 1 addition & 1 deletion src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void UpdateBarIcons()
#pragma warning disable RS0030 // Do not use banned APIs; Panel.Children is banned for performance reasons.
var stackPanelItem = stackPanel.Children[i];
#pragma warning restore RS0030 // Do not use banned APIs

if (stackPanelItem is WImage tabBarImage)
{
// Update icon image.
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/NodeILExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static IEnumerable<Instruction> PushConvertedValue(this ValueNode node, I
var typeConverter = bpRef.GetBindablePropertyTypeConverter(context.Cache, module);

//we're gonna SetValue. if the BP type is Nullable, we only need to convert/box to the non-nullable type? why, because the CSC compiler does it like that
if (targetTypeRef.ResolveCached(context.Cache).FullName == "System.Nullable`1")
if (targetTypeRef.ResolveCached(context.Cache).FullName == "System.Nullable`1")
targetTypeRef = ((GenericInstanceType)targetTypeRef).GenericArguments[0];

return node.PushConvertedValue(context, targetTypeRef, typeConverter, pushServiceProvider, boxValueTypes,
Expand Down
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 @@ -683,7 +683,7 @@ static bool TryParsePath(ILContext context, string path, TypeReference tSourceRe
{
if (previousPartTypeRef.IsArray)
previousPartTypeRef = previousPartTypeRef.GetElementType();

previousPartTypeRef.ResolveCached(context.Cache);
}

Expand Down
6 changes: 4 additions & 2 deletions src/Controls/src/Build.Tasks/XamlCTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,16 @@ public override bool Execute(out IList<Exception> thrownExceptions)

LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Parsing Xaml");
ILRootNode rootnode = null;
try {
try
{
rootnode = ParseXaml(resource.GetResourceStream(), typeDef);
if (rootnode == null)
{
LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}failed.");
continue;
}
} catch (XamlParseException xpe)
}
catch (XamlParseException xpe)
{
LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}failed.");
xamlFilePath = LoggingHelper.GetXamlFilePath(xamlFilePath);
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 @@ -8,6 +8,7 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.Maui.ApplicationModel;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.Platform.Compatibility;
Expand All @@ -19,7 +20,6 @@
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.Maui.ApplicationModel;
using Windows.Foundation;
using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListView;
using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void PushPage(Page page, bool animated, TaskCompletionSource<bool> completionSou
_completionTasks[pageViewController] = completionSource;

PushViewController(pageViewController, animated);

if (completionSource != null && !showsPresentation)
completionSource.TrySetResult(true);
}
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 @@ -483,7 +483,7 @@ internal void UpdateFromCurrentItem()
{
if (!InitialPositionSet)
return;

if (ItemsView is not CarouselView carousel)
{
return;
Expand All @@ -507,7 +507,7 @@ internal void UpdateFromPosition()
{
return;
}

if (ItemsView is not CarouselView carousel)
{
return;
Expand Down Expand Up @@ -557,7 +557,7 @@ async Task UpdateInitialPosition()
{
position = positionCurrentItem;
}
}
}

await Task.Delay(100).ContinueWith((t) =>
{
Expand All @@ -567,17 +567,17 @@ await Task.Delay(100).ContinueWith((t) =>
{
return;
}

InitialPositionSet = true;

if (ItemsSource is null || ItemsSource.ItemCount == 0)
{
return;
}


carousel.ScrollTo(position, -1, Microsoft.Maui.Controls.ScrollToPosition.Center, false);

SetCurrentItem(position);
UpdateVisualStates();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ internal virtual bool UpdateConstraints(CGSize size)
ClearCellSizeCache();

EstimatedItemSize = CGSize.Empty;

_currentSize = size;

var newSize = new CGSize(Math.Floor(size.Width), Math.Floor(size.Height));
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 All @@ -53,7 +53,7 @@ internal void ClearSelection()
{
var selectedItemIndexes = CollectionView.GetIndexPathsForSelectedItems();

if(selectedItemIndexes is not null && selectedItemIndexes.Any())
if (selectedItemIndexes is not null && selectedItemIndexes.Any())
{
CollectionView.PerformBatchUpdates(null, _ =>
{
Expand Down Expand Up @@ -167,7 +167,7 @@ void SynchronizePlatformSelectionWithSelectedItems()
CollectionView.PerformBatchUpdates(null, _ =>
{
CollectionView.DeselectItem(path, true);
});
});
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected override UICollectionViewLayout SelectLayout()

var itemSizingStrategy = ItemsView.ItemSizingStrategy;
var itemsLayout = ItemsView.ItemsLayout;

SubscribeToItemsLayoutPropertyChanged(itemsLayout);

if (itemsLayout is GridItemsLayout gridItemsLayout)
Expand Down Expand Up @@ -199,7 +199,7 @@ public static void MapItemSizingStrategy(CollectionViewHandler2 handler, Structu

void SubscribeToItemsLayoutPropertyChanged(IItemsLayout itemsLayout)
{
if(itemsLayout is not null)
if (itemsLayout is not null)
{
itemsLayout.PropertyChanged += (sender, args) =>
{
Expand Down
Loading

0 comments on commit fe000d4

Please sign in to comment.