DaisyExpandableCard is a versatile card component that can reveal a secondary content area when triggered. It is ideal for "Showcase" or "Detail" views where initial high-level information is presented, and additional details are revealed on demand (e.g., clicking a "Learn More" or "Play" button).
Key features:
ToggleCommand for easy binding from child buttons.UseBatteriesIncludedMode="True" to generate visual content from simple properties.ScrollViewer.| Property | Type | Default | Description |
|---|---|---|---|
| IsExpanded | bool |
false |
Controls whether the card is currently showing its expanded content. |
| ExpandedContent | object |
null |
The UI content to display in the revealed area (manual mode). |
| ToggleCommand | ICommand |
auto | A command that toggles IsExpanded. Typically bound to a button inside the card. |
| AnimationDuration | TimeSpan |
300ms |
Duration of the expand/collapse animation. |
When UseBatteriesIncludedMode="True", these properties generate the visual content automatically:
| Property | Type | Default | Description |
|---|---|---|---|
| UseBatteriesIncludedMode | bool |
false |
When true, generates content from convenience properties. |
| Title | string |
null |
Main title displayed on the card. |
| Subtitle | string |
null |
Subtitle displayed below the title. |
| GradientStart | Color |
#0f172a |
Starting color of the background gradient. |
| GradientEnd | Color |
#334155 |
Ending color of the background gradient. |
| CardWidth | double |
150 |
Width of the main card content area. |
| CardHeight | double |
225 |
Height of the card. |
| ExpandedText | string |
null |
Main text displayed in the expanded panel. |
| ExpandedSubtitle | string |
null |
Subtitle displayed in the expanded panel. |
| ExpandedBackground | Color |
#111827 |
Background color of the expanded panel. |
| ActionButtonText | string |
"Play" |
Text displayed on the action button. |
With just 8 attributes instead of 40+ lines of XAML:
<daisy:DaisyExpandableCard
UseBatteriesIncludedMode="True"
Padding="0"
Title="Summer"
Subtitle="Opening"
GradientStart="#0f172a"
GradientEnd="#334155"
ExpandedText="Join us for the Summer Opening event."
ExpandedSubtitle="Freddy K. · CEO" />
<daisy:DaisyExpandableCard x:Name="MyCard">
<!-- Main Content (Default) -->
<Grid Width="150" Height="225">
<daisy:DaisyButton Content="Expand"
Command="{Binding #MyCard.ToggleCommand}" />
</Grid>
<!-- Expanded Content -->
<daisy:DaisyExpandableCard.ExpandedContent>
<Border Width="150" Background="#111827">
<TextBlock Text="Detailed Info revealed!" />
</Border>
</daisy:DaisyExpandableCard.ExpandedContent>
</daisy:DaisyExpandableCard>
Width and Height on both the main content and the ExpandedContent container.StackPanel inside a ScrollViewer with HorizontalScrollBarVisibility="Auto".IsGlass="True" mode as DaisyCard for a modern frosted look.