Styles and Templates
Adonis UI offers the following resource kinds:
- Brushes - accessible via
AdonisUI.Brushes
- Colors - accessible via
AdonisUI.Colors
- Dimensions - accessible via
AdonisUI.Dimensions
- Icons - accessible via
AdonisUI.Icons
- Styles - accessible via
AdonisUI.Styles
- Templates - accessible via
AdonisUI.Templates
For brushes and colors see here. For dimensions see here. In this article, styles, templates and icons are addressed.
Usage
All resources of Adonis UI including styles, templates and icons can be referenced using ComponentResourceKeys.
Example:
<!-- xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI" -->
<Button Style="{DynamicResource {x:Static adonisUi:Styles.AccentButtonStyle}}"/>
Templates and icons are usually of type DataTemplate
. The easiest way to use them is via a ContentControl
:
<!-- xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI" -->
<ContentControl Content="{Binding}"
ContentTemplate="{DynamicResource {x:Static adonisUi:Templates.LoadingCircle}}"
Width="32"
Height="32"
Focusable="False"/>
Available styles
Styles.AccentButton
- For buttons that should gain attention (accent color as background)Styles.AccentToolbarButton
- For buttons being placed in a toolbar that should gain attention when hoveringStyles.DefaultToAccentToggleButton
- For toggle buttons switching to accent color when checkedStyles.RippleListBoxItem
- For list box items that release a ripple effect when clickedStyles.ToolbarButton
- For buttons being placed in a toolbar (transparent background until hovering)Styles.ToolbarToggleButton
- For toggle buttons being placed in a toolbar (transparent background until hovering)Styles.AccentComboBox
- For combo boxes that should gain attention (accent color as background)Styles.AccentComboBoxItem
- Matching combo box item style forAccentComboBox
Styles.ToggleSwitch
- Alternative look for check boxes and toggle buttonsStyles.WindowButton
- For buttons placed in the window’s title barStyles.WindowToggleButton
- For toggle buttons placed in the window’s title bar
Available templates
Templates.DatePickerDropDownButton
- Button in date pickers that opens the calender popupTemplates.Expander
- Small expander triangle that is used in combo boxes, tree views, etc.Templates.LoadingCircle
- Loading throbber with dots running in circlesTemplates.LoadingBars
- Loading throbber with three bars growing and shrinkingTemplates.LoadingDots
- Loading throbber with appearing and disappearing dotsTemplates.ValidationErrorTemplate
- Generic validation error template
Available Icons
Icons.AdonisUI
- Favicon of Adonis UIIcons.AdonisUIGrayscale
- Favicon of Adonis UI in grayscale colorsIcons.Error
- Error icon used for displaying validation errorsIcons.WindowMinimize
- Minimize icon used forAdonisWindow
’s minimize buttonIcons.WindowMaximize
- Maximize icon used forAdonisWindow
’s maximize buttonIcons.WindowRestore
- Restore icon used forAdonisWindow
’s restore buttonIcons.WindowClose
- Close icon used forAdonisWindow
’s close button