-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f670a1
commit 6f7581a
Showing
7 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Basic | ||
|
||
SukiUI provide a `SukiTheme` class that permits to easily manipulate the theming of your app easily. | ||
|
||
Get the SukiTheme Instance: | ||
|
||
```csharp | ||
SukiTheme theme = SukiTheme.GetInstance(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Color | ||
|
||
`SukiTheme` allows app to switch color themes easily | ||
|
||
<img src="https://i.ibb.co/ykzPqVY/theming-color.gif" alt="theming-color"> | ||
|
||
## Switch between available Color Theme | ||
|
||
```csharp | ||
SukiTheme.GetInstance().SwitchColorTheme(); | ||
``` | ||
|
||
## Switch to a specific Color Theme | ||
|
||
```csharp | ||
SukiTheme.GetInstance().ChangeColorTheme(SukiColor.Red); | ||
``` | ||
|
||
## Create a Custom Color Theme, register it and switch to it | ||
|
||
```csharp | ||
var PurpleTheme = new SukiColorTheme("Purple", Colors.Purple, Colors.DarkBlue); | ||
SukiTheme.GetInstance().AddColorTheme(PurpleTheme); | ||
SukiTheme.GetInstance().ChangeColorTheme(PurpleTheme); | ||
``` | ||
|
||
## ColorChanged Event | ||
|
||
```csharp | ||
SukiTheme.GetInstance().OnColorThemeChanged += theme => | ||
{ | ||
Console.WriteLine("Color theme change triggered !"); | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Light & Dark | ||
|
||
SukiUI use the [Theme Variant](https://docs.avaloniaui.net/docs/guides/styles-and-resources/how-to-use-theme-variants) system provided by `AvaloniaUI`. | ||
|
||
However, the SukiTheme class provide an easiest wrapper to change Light/Dark theme. | ||
|
||
<img src="https://i.ibb.co/XzzfB9r/theming-theme.gif" alt="theming-theme"> | ||
|
||
## Switch to Dark Theme | ||
|
||
```csharp | ||
SukiTheme.GetInstance().ChangeBaseTheme(ThemeVariant.Dark); | ||
``` | ||
|
||
## Switch to Light Theme | ||
|
||
```csharp | ||
SukiTheme.GetInstance().ChangeBaseTheme(ThemeVariant.Light); | ||
``` | ||
|
||
## Switch between Light/Dark Theme | ||
|
||
```csharp | ||
SukiTheme.GetInstance().SwitchBaseTheme(); | ||
``` | ||
|
||
## ThemeChanged Event | ||
|
||
```csharp | ||
SukiTheme.GetInstance().OnBaseThemeChanged += variant => | ||
{ | ||
Console.WriteLine("Theme changed triggered !"); | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 主题实例 | ||
|
||
SukiUI 提供 `SukiTheme`,通过该类可以实现对应用主题的修改 | ||
|
||
获取实例: | ||
|
||
```csharp | ||
SukiTheme theme = SukiTheme.GetInstance(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 主题色 | ||
|
||
`SukiTheme` 也可以十分简单地切换应用的主题色 | ||
|
||
<img src="https://i.ibb.co/ykzPqVY/theming-color.gif" alt="theming-color"> | ||
|
||
## 在可用的主题色间切换 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().SwitchColorTheme(); | ||
``` | ||
|
||
## 切换到一个指定的主题色 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().ChangeColorTheme(SukiColor.Red); | ||
``` | ||
|
||
## 创建/注册/切换到一个自定义主题色 | ||
|
||
```csharp | ||
var PurpleTheme = new SukiColorTheme("Purple", Colors.Purple, Colors.DarkBlue); | ||
SukiTheme.GetInstance().AddColorTheme(PurpleTheme); | ||
SukiTheme.GetInstance().ChangeColorTheme(PurpleTheme); | ||
``` | ||
|
||
## 订阅 ColorChanged 事件 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().OnColorThemeChanged += theme => | ||
{ | ||
Console.WriteLine("Color theme change triggered !"); | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 明暗主题切换 | ||
|
||
SukiUI 借助由 `AvaloniaUI` 提供的 [主题变体](https://docs.avaloniaui.net/zh-Hans/docs/guides/styles-and-resources/how-to-use-theme-variants) 轻松实现主题切换 | ||
|
||
<img src="https://i.ibb.co/XzzfB9r/theming-theme.gif" alt="theming-theme"> | ||
|
||
## 切换至暗色 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().ChangeBaseTheme(ThemeVariant.Dark); | ||
``` | ||
|
||
## 切换至亮色 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().ChangeBaseTheme(ThemeVariant.Light); | ||
``` | ||
|
||
## 明暗切换 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().SwitchBaseTheme(); | ||
``` | ||
|
||
## ThemeChanged 事件 | ||
|
||
```csharp | ||
SukiTheme.GetInstance().OnBaseThemeChanged += variant => | ||
{ | ||
Console.WriteLine("Theme changed triggered !"); | ||
}; | ||
``` |