Table of Contents

IThemeService 接口

命名空间
ClassIsland.Core.Abstractions.Services
程序集
ClassIsland.Core.dll

应用主题服务,控制应用的主题外观。

public interface IThemeService

属性

CurrentRealThemeMode

当前颜色主题状态

int CurrentRealThemeMode { get; set; }

属性值

int

CurrentTheme

当前主题

ITheme? CurrentTheme { get; set; }

属性值

ITheme

IsTransientDisabled

是否禁用过渡动画

public static bool IsTransientDisabled { get; }

属性值

bool

IsWaitForTransientDisabled

是否禁用动画等待。默认情况下 ClassIsland 在进行阻塞 UI 线程的操作时,会确保动画播放完成。启用此选项后将不会等待动画播放完成,可以一定程度上地提升加载速度。

public static bool IsWaitForTransientDisabled { get; }

属性值

bool

方法

SetTheme(int, Color, Color)

设置主题

void SetTheme(int themeMode, Color primary, Color secondary)

参数

themeMode int

主题模式

primary Color

第一主题色

secondary Color

第二主题色

事件

ThemeUpdated

主题更新事件,当主题更变时会触发此事件。

event EventHandler<ThemeUpdatedEventArgs>? ThemeUpdated

事件类型

EventHandler<ThemeUpdatedEventArgs>