Page completed

This commit is contained in:
2026-01-17 01:18:35 +00:00
parent d8bdf5472f
commit b1749b1347
3 changed files with 424 additions and 3 deletions

View File

@@ -118,12 +118,26 @@ public class SkiaPage : SkiaView
public bool IsBusy { get; set; }
/// <summary>
/// Icon image source for this page (used by navigation containers).
/// </summary>
public SKBitmap? IconImage { get; set; }
/// <summary>
/// Background image source for this page.
/// </summary>
public SKBitmap? BackgroundImage { get; set; }
// Lifecycle events
public event EventHandler? Appearing;
public event EventHandler? Disappearing;
public event EventHandler? NavigatedTo;
public event EventHandler? NavigatedFrom;
public event EventHandler? NavigatingFrom;
protected override void OnDraw(SKCanvas canvas, SKRect bounds)
{
// Draw background
// Draw background color
if (BackgroundColor != SKColors.Transparent)
{
using var bgPaint = new SKPaint
@@ -134,6 +148,13 @@ public class SkiaPage : SkiaView
canvas.DrawRect(bounds, bgPaint);
}
// Draw background image if set
if (BackgroundImage != null)
{
var destRect = new SKRect(bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
canvas.DrawBitmap(BackgroundImage, destRect);
}
var contentTop = bounds.Top;
// Draw navigation bar if visible
@@ -254,6 +275,21 @@ public class SkiaPage : SkiaView
Disappearing?.Invoke(this, EventArgs.Empty);
}
public void OnNavigatedTo()
{
NavigatedTo?.Invoke(this, EventArgs.Empty);
}
public void OnNavigatedFrom()
{
NavigatedFrom?.Invoke(this, EventArgs.Empty);
}
public void OnNavigatingFrom()
{
NavigatingFrom?.Invoke(this, EventArgs.Empty);
}
protected override SKSize MeasureOverride(SKSize availableSize)
{
// Page takes all available space