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 Jan 31, 2025
1 parent 1f9c530 commit b364fa5
Show file tree
Hide file tree
Showing 356 changed files with 2,475 additions and 2,444 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);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async void PushNewTitleBarPage_Clicked(object sender, EventArgs e)

void ToggleTitleBarOnWindow_Clicked(object sender, EventArgs e)
{
if (Window.TitleBar is not null)
if (Window.TitleBar is not null)
Window.TitleBar = null;
else
Window.TitleBar = _customTitleBar;
Expand Down Expand Up @@ -169,7 +169,7 @@ private void TallModeCheckBox_CheckedChanged(object sender, CheckedChangedEventA
_customTitleBar.HeightRequest = 36;
#else
_customTitleBar.HeightRequest = 32;
#endif
#endif
}
}
}
Expand Down
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 @@ -264,10 +264,10 @@ protected override void Dispose(bool disposing)
_secondaryToolbar.RemoveFromSuperview();
_secondaryToolbar.Dispose();
_secondaryToolbar = null;
if(_currentBarBackgroundBrush is GradientBrush gb)

if (_currentBarBackgroundBrush is GradientBrush gb)
gb.InvalidateGradientBrushRequested -= OnBarBackgroundChanged;

_currentBarBackgroundBrush = null;
_currentBarBackgroundColor = null;

Expand Down Expand Up @@ -727,7 +727,7 @@ void OnBarBackgroundChanged(object sender, EventArgs e)

void UpdateBarBackground()
{
if(_currentBarBackgroundBrush is GradientBrush oldGradientBrush)
if (_currentBarBackgroundBrush is GradientBrush oldGradientBrush)
{
oldGradientBrush.Parent = null;
oldGradientBrush.InvalidateGradientBrushRequested -= OnBarBackgroundChanged;
Expand All @@ -753,7 +753,7 @@ void RefreshBarBackground()
_currentBarBackgroundColor = newSolidColorBrush.Color;
_currentBarBackgroundBrush = null;
}

if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsMacCatalystVersionAtLeast(13))
{
var navigationBarAppearance = NavigationBar.StandardAppearance;
Expand All @@ -767,7 +767,7 @@ void RefreshBarBackground()
}
else
{
if(_currentBarBackgroundColor?.Alpha < 1f)
if (_currentBarBackgroundColor?.Alpha < 1f)
navigationBarAppearance.ConfigureWithTransparentBackground();
else
navigationBarAppearance.ConfigureWithOpaqueBackground();
Expand All @@ -788,7 +788,7 @@ void RefreshBarBackground()
}
else
{
if(_currentBarBackgroundColor?.Alpha == 0f)
if (_currentBarBackgroundColor?.Alpha == 0f)
{
NavigationBar.SetTransparentNavigationBar();
}
Expand Down Expand Up @@ -1328,7 +1328,7 @@ public override void WillMoveToParentViewController(UIViewController parent)
{
return;
}

if (parent is null)
{
_tracker.CollectionChanged -= TrackerOnCollectionChanged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected virtual void UpdateTabBarVisible()
{
return;
}

var tabBarVisible =
(Page.FindParentOfType<ShellItem>() as IShellItemController)?.ShowTabs ?? Shell.GetTabBarIsVisible(Page);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ public override UIViewController PopViewController(bool animated)
{
return tabBarController.MoreNavigationController.PopViewController(animated);
}

return base.PopViewController(animated);
}

Expand Down Expand Up @@ -645,7 +645,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
Loading

0 comments on commit b364fa5

Please sign in to comment.