Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
yagizhanNY committed Sep 28, 2023
1 parent 22505a2 commit 42dbba6
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,32 @@ Add `Theme` component to the page that you want to manipulate the theme.
Then use this methods to change theme.

```csharp
Theme themeProvider;
protected override async Task OnAfterRenderAsync(bool firstRender)
public partial class Index
{
if(firstRender)
Theme themeProvider;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await themeProvider.SetTheme("theme-classic-light");
}
if(firstRender)
{
await themeProvider.SetTheme("theme-classic-light");
}

}
}

private async Task CheckboxChanged()
{
await themeProvider.ToggleTheme();
}
private async Task CheckboxChanged()
{
await themeProvider.ToggleTheme();
}

private async Task SetDarkTheme()
{
await themeProvider.SetTheme("theme-classic-dark");
}
private async Task SetDarkTheme()
{
await themeProvider.SetTheme("theme-classic-dark");
}

private async Task ToggleSystemTheme()
{
await themeProvider.ToggleSystemTheme(true);
private async Task ToggleSystemTheme()
{
await themeProvider.ToggleSystemTheme(true);
}
}
```

Expand Down

0 comments on commit 42dbba6

Please sign in to comment.