benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.7k stars 143 forks source link

Sorry for stupid question #153

Closed ZhmerenkaSolution closed 3 years ago

ZhmerenkaSolution commented 3 years ago

How to add ToggleSwitch on Window in xaml? изображение I thot that is custom control and I didn't found that in <AdnousUi.Controls:ToggleSwitch or AdonisUI:ToggleSwitch or even your documentation.

alexhelms commented 3 years ago

The ToggleSwitch is available as a style, see https://benruehl.github.io/adonis-ui/docs/guides/styles-and-templates/

You would do something like this:

<Button Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch }}"/>
benruehl commented 3 years ago

@alexhelms Thanks for answering! You're right, it's a style. Just a little addition: It targets toggle buttons so you can use it on ToggleButton or CheckBox for example.

ZhmerenkaSolution commented 3 years ago

Yep, that's it, thanks my dudes. <ToggleButton Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch }}" /> work fine.