Fix compilation: restore clean RC1 codebase

- Restore clean BindableProperty.Create syntax from RC1 commit
- Remove decompiler artifacts with mangled delegate types
- Add Svg.Skia package reference for icon support
- Fix duplicate type definitions
- Library now compiles successfully (0 errors)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-01 07:43:44 -05:00
parent 33914bf572
commit 2a4e35cd39
258 changed files with 35256 additions and 49900 deletions

View File

@@ -1,88 +1,93 @@
using System;
using System.Runtime.CompilerServices;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.Maui.Controls;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Graphics;
using SkiaSharp;
namespace Microsoft.Maui.Platform.Linux.Handlers;
public class ShellHandler : ViewHandler<Shell, SkiaShell>
/// <summary>
/// Handler for Shell on Linux using Skia rendering.
/// </summary>
public partial class ShellHandler : ViewHandler<Shell, SkiaShell>
{
public static IPropertyMapper<Shell, ShellHandler> Mapper = (IPropertyMapper<Shell, ShellHandler>)(object)new PropertyMapper<Shell, ShellHandler>((IPropertyMapper[])(object)new IPropertyMapper[1] { (IPropertyMapper)ViewHandler.ViewMapper });
public static IPropertyMapper<Shell, ShellHandler> Mapper = new PropertyMapper<Shell, ShellHandler>(ViewHandler.ViewMapper)
{
};
public static CommandMapper<Shell, ShellHandler> CommandMapper = new CommandMapper<Shell, ShellHandler>((CommandMapper)(object)ViewHandler.ViewCommandMapper);
public static CommandMapper<Shell, ShellHandler> CommandMapper = new(ViewHandler.ViewCommandMapper)
{
};
public ShellHandler()
: base((IPropertyMapper)(object)Mapper, (CommandMapper)(object)CommandMapper)
{
}
public ShellHandler() : base(Mapper, CommandMapper)
{
}
public ShellHandler(IPropertyMapper? mapper, CommandMapper? commandMapper = null)
: base((IPropertyMapper)(((object)mapper) ?? ((object)Mapper)), (CommandMapper)(((object)commandMapper) ?? ((object)CommandMapper)))
{
}
public ShellHandler(IPropertyMapper? mapper, CommandMapper? commandMapper = null)
: base(mapper ?? Mapper, commandMapper ?? CommandMapper)
{
}
protected override SkiaShell CreatePlatformView()
{
return new SkiaShell();
}
protected override SkiaShell CreatePlatformView()
{
return new SkiaShell();
}
protected override void ConnectHandler(SkiaShell platformView)
{
base.ConnectHandler(platformView);
platformView.FlyoutIsPresentedChanged += OnFlyoutIsPresentedChanged;
platformView.Navigated += OnNavigated;
if (base.VirtualView != null)
{
base.VirtualView.Navigating += OnShellNavigating;
base.VirtualView.Navigated += OnShellNavigated;
}
}
protected override void ConnectHandler(SkiaShell platformView)
{
base.ConnectHandler(platformView);
platformView.FlyoutIsPresentedChanged += OnFlyoutIsPresentedChanged;
platformView.Navigated += OnNavigated;
protected override void DisconnectHandler(SkiaShell platformView)
{
platformView.FlyoutIsPresentedChanged -= OnFlyoutIsPresentedChanged;
platformView.Navigated -= OnNavigated;
if (base.VirtualView != null)
{
base.VirtualView.Navigating -= OnShellNavigating;
base.VirtualView.Navigated -= OnShellNavigated;
}
base.DisconnectHandler(platformView);
}
// Subscribe to Shell navigation events
if (VirtualView != null)
{
VirtualView.Navigating += OnShellNavigating;
VirtualView.Navigated += OnShellNavigated;
}
}
private void OnFlyoutIsPresentedChanged(object? sender, EventArgs e)
{
}
protected override void DisconnectHandler(SkiaShell platformView)
{
platformView.FlyoutIsPresentedChanged -= OnFlyoutIsPresentedChanged;
platformView.Navigated -= OnNavigated;
private void OnNavigated(object? sender, ShellNavigationEventArgs e)
{
}
if (VirtualView != null)
{
VirtualView.Navigating -= OnShellNavigating;
VirtualView.Navigated -= OnShellNavigated;
}
private void OnShellNavigating(object? sender, ShellNavigatingEventArgs e)
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(36, 1);
defaultInterpolatedStringHandler.AppendLiteral("[ShellHandler] Shell Navigating to: ");
ShellNavigationState target = e.Target;
defaultInterpolatedStringHandler.AppendFormatted((target != null) ? target.Location : null);
Console.WriteLine(defaultInterpolatedStringHandler.ToStringAndClear());
if (base.PlatformView != null)
{
ShellNavigationState target2 = e.Target;
if (((target2 != null) ? target2.Location : null) != null)
{
string text = e.Target.Location.ToString().TrimStart('/');
Console.WriteLine("[ShellHandler] Routing to: " + text);
base.PlatformView.GoToAsync(text);
}
}
}
base.DisconnectHandler(platformView);
}
private void OnShellNavigated(object? sender, ShellNavigatedEventArgs e)
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(35, 1);
defaultInterpolatedStringHandler.AppendLiteral("[ShellHandler] Shell Navigated to: ");
ShellNavigationState current = e.Current;
defaultInterpolatedStringHandler.AppendFormatted((current != null) ? current.Location : null);
Console.WriteLine(defaultInterpolatedStringHandler.ToStringAndClear());
}
private void OnFlyoutIsPresentedChanged(object? sender, EventArgs e)
{
// Sync flyout state to virtual view
}
private void OnNavigated(object? sender, ShellNavigationEventArgs e)
{
// Handle platform navigation events
}
private void OnShellNavigating(object? sender, ShellNavigatingEventArgs e)
{
Console.WriteLine($"[ShellHandler] Shell Navigating to: {e.Target?.Location}");
// Route to platform view
if (PlatformView != null && e.Target?.Location != null)
{
var route = e.Target.Location.ToString().TrimStart('/');
Console.WriteLine($"[ShellHandler] Routing to: {route}");
PlatformView.GoToAsync(route);
}
}
private void OnShellNavigated(object? sender, ShellNavigatedEventArgs e)
{
Console.WriteLine($"[ShellHandler] Shell Navigated to: {e.Current?.Location}");
}
}