XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
UTF-8
using XFEExtension.NetCore.AutoConfig;
using XFEExtension.NetCore.WinUIHelper.Interface.Services;
using XFEExtension.NetCore.WinUIHelper.Utilities;
using XFEExtension.NetCore.WinUIHelper.Utilities.Helper;

namespace SpaceEngineersBlueprintEditor.Profiles.CrossVersionProfiles;

/// <summary>
/// 系统配置文件
/// </summary>
public partial class SystemProfile : XFEProfile
{
    /// <summary>
    /// 系统配置文件
    /// </summary>
    SystemProfile() => ProfilePath = $@"{AppPathHelper.LocalProfile}\{nameof(SystemProfile)}";
    /// <summary>
    /// 游戏根目录
    /// </summary>
    [ProfileProperty]
    private string gameRootPath = "";
    /// <summary>
    /// 服务器IP地址
    /// </summary>
    [ProfileProperty]
    private string serverIp = "http://175.178.121.98:29188/";
    /// <summary>
    /// 导航栏样式
    /// </summary>
    [ProfileProperty]
    private NavigationViewPaneDisplayMode navigationStyle = NavigationViewPaneDisplayMode.Left;
    /// <summary>
    /// 应用程序主题样式
    /// </summary>
    [ProfileProperty]
    private ElementTheme theme = ElementTheme.Default;

    static partial void SetThemeProperty(ref ElementTheme value) => AppThemeHelper.ChangeTheme(value);

    static partial void SetNavigationStyleProperty(ref NavigationViewPaneDisplayMode value)
    {
        if (ServiceManager.GetGlobalService<INavigationViewService>() is INavigationViewService navigationViewService && navigationViewService.NavigationView is not null)
            navigationViewService.NavigationView.PaneDisplayMode = value;
    }
}