XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

HaloPixelToolBox

【WinUI3】基于USB HID通讯的花再音响工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
using HaloPixelToolBox.Client.Interface.Services;

namespace HaloPixelToolBox.Client.Implements.Services;

public class PageService : IPageService
{
    Page? _page;
    public Page CurrentPage => _page ?? throw new InvalidOperationException("PageService has not been initialized. Please call Initialize() with a valid Page instance.");

    public event RoutedEventHandler? CurrentPageLoaded;

    public void Initialize(Page page)
    {
        _page = page;
        _page.Loaded += (s, e) => CurrentPageLoaded?.Invoke(s, e);
    }
}