A dropdown control for selecting a global size (DaisySize) that affects (almost) all Flowery.NET controls.
DaisySizeDropdown provides a user-friendly way to let users choose their preferred UI size. When the user selects a size, it's applied globally via FlowerySizeManager. All Daisy controls with a Size property automatically update.
xmlns:controls="clr-namespace:Flowery.Controls;assembly=Flowery.NET"
<controls:DaisySizeDropdown Width="180" />
This displays a dropdown with all five sizes (ExtraSmall, Small, Medium, Large, ExtraLarge) using localized display names.
| Property | Type | Default | Description |
|---|---|---|---|
SelectedSize |
DaisySize |
Medium |
The currently selected size |
Size |
DaisySize |
Medium |
The size of the dropdown control itself |
ShowAbbreviations |
bool |
false |
Show abbreviations (XS, S, M, L, XL) instead of full names |
SizeOptions |
IList |
null |
Custom size options to display |
By default, all five sizes are shown. You can customize which sizes appear and what they're called using the SizeOptions property.
| Property | Type | Default | Description |
|---|---|---|---|
Size |
DaisySize |
- | The enum value (required) |
Name |
string |
- | Internal name for localization lookup (e.g., "Small") |
IsVisible |
bool |
true |
Set to false to hide this size from the dropdown |
DisplayNameOverride |
string? |
null |
Custom label that overrides localized text |
Abbreviation |
string |
- | Short form for compact display (XS, S, M, L, XL) |
<controls:DaisySizeDropdown>
<controls:DaisySizeDropdown.SizeOptions>
<x:Array Type="{x:Type controls:SizePreviewInfo}">
<controls:SizePreviewInfo Size="Small" Name="Small"
DisplayNameOverride="Compact" Abbreviation="C" />
<controls:SizePreviewInfo Size="Medium" Name="Medium"
DisplayNameOverride="Normal" Abbreviation="N" />
<controls:SizePreviewInfo Size="Large" Name="Large"
DisplayNameOverride="Large" Abbreviation="L" />
</x:Array>
</controls:DaisySizeDropdown.SizeOptions>
</controls:DaisySizeDropdown>
<controls:DaisySizeDropdown>
<controls:DaisySizeDropdown.SizeOptions>
<x:Array Type="{x:Type controls:SizePreviewInfo}">
<controls:SizePreviewInfo Size="ExtraSmall" Name="ExtraSmall" IsVisible="False" />
<controls:SizePreviewInfo Size="Small" Name="Small" />
<controls:SizePreviewInfo Size="Medium" Name="Medium" />
<controls:SizePreviewInfo Size="Large" Name="Large" />
<controls:SizePreviewInfo Size="ExtraLarge" Name="ExtraLarge" IsVisible="False" />
</x:Array>
</controls:DaisySizeDropdown.SizeOptions>
</controls:DaisySizeDropdown>
Size names are automatically localized based on the current culture. The display name resolution order is:
1. DisplayNameOverride (if set) – your custom label
2. Localized text – from FloweryLocalization (e.g., "Klein" in German)
3. Name (fallback) – the enum name like "ExtraSmall"
Size names are localized in 12 languages:
If you need to override the built-in translations, add these keys to your localization:
{
"Size_ExtraSmall": "Extra Small",
"Size_Small": "Small",
"Size_Medium": "Medium",
"Size_Large": "Large",
"Size_ExtraLarge": "Extra Large"
}
The dropdown respects global size changes. When a new size is selected, the dropdown itself also updates its appearance.
<!-- Use the dropdown's own Size property for its appearance -->
<controls:DaisySizeDropdown Size="Small" Width="120" />
<controls:DaisySizeDropdown Size="Large" Width="200" />
If you need to change the size without the UI:
using Flowery.Controls;
// Apply a size globally
FlowerySizeManager.ApplySize(DaisySize.Large);
// Or by name
FlowerySizeManager.ApplySize("Large");
// Check current size
DaisySize current = FlowerySizeManager.CurrentSize;
The dropdown automatically syncs with FlowerySizeManager.CurrentSize.
DaisySizeDropdown is designed to work seamlessly with the global sizing system:
FlowerySizeManager.ApplySize()For comprehensive documentation on the sizing system, see SizingScaling.
1. Place in settings or sidebar – Give users easy access to change the size preference.
2. Consider visibility – For most apps, 3 sizes (Small, Medium, Large) may be enough.
3. Use meaningful names – If "Small" doesn't fit your domain, use DisplayNameOverride (e.g., "Compact", "Dense").
4. Test all sizes – Ensure your layouts work at both ExtraSmall and ExtraLarge.
5. Persist preference – Save the user's selection and restore it on app startup.