From a17bb06a050bf9c6d93a304bb215bbbc37777375 Mon Sep 17 00:00:00 2001 From: Markus Wenzl Date: Thu, 6 Jan 2022 09:38:40 +0100 Subject: [PATCH] Added 'Custom PseudoClasses' section to styles.md --- docs/styling/styles.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/styling/styles.md b/docs/styling/styles.md index 814a0c8..c27139c 100644 --- a/docs/styling/styles.md +++ b/docs/styling/styles.md @@ -108,6 +108,15 @@ Another example that involves changing properties inside of control [template](s Other pseudoclasses include `:focus`, `:disabled`, `:pressed` for buttons, `:checked` for checkboxes etc. +### Custom PseudoClasses + +You can create own pseudoclasses for your `CustomControl` or `TemplatedControl`. +The function below adds or remove a pseudoclass depending on a boolean value on a `StyledElement`. + ````csharp + PseudoClasses.Set(":className", bool); + ```` +***Remember:** PseudoClasses always starts with a `:`!* + ### Selectors _Selectors_ select a control using a custom selector syntax which is very similar to the syntax used for CSS selectors. An example of some selectors: