Created
December 21, 2020 17:17
-
-
Save zHaytam/106d568e77324f38aebf86704f0e658c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<CascadingValue Value="_theme"> | |
<CascadingValue Value="@((Action)(() => _theme = (_theme == "light" ? "dark" : "light")))"> | |
<div> | |
<MyButton Text="Click me!"></MyButton> | |
<br /> | |
<ThemeToggler></ThemeToggler> | |
</div> | |
</CascadingValue> | |
</CascadingValue> | |
@code { | |
private string _theme = "light"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment