The following quick start guide is intended to get you up and running with the Accordion control. In this quick start, you'll start with creating a new WinUI application, add the Accordion control to it, and then add items in the content area of the control.
The following GIF displays the Accordion control in action.
XAML |
Copy Code
|
---|---|
xmlns:c1="using:C1.WinUI.Accordion" xmlns:core="using:C1.WinUI.Core" xmlns:calendar="using:C1.WinUI.Calendar" |
XAML |
Copy Code
|
---|---|
<Grid.Resources> <Style x:Key="ExpanderStyle" TargetType="c1:C1Expander"> <Setter Property="Margin" Value="3"/> <Setter Property="HeaderStyle"> <Setter.Value> <Style TargetType="core:C1ToggleButton"> <Setter Property="Background" Value="BurlyWood"/> <Setter Property="Foreground" Value="White"/> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="CornerRadius" Value="8"/> </Style> </Setter.Value> </Setter> </Style> </Grid.Resources> <!--Accordion control--> <c1:C1Accordion x:Name="accordion" Width="300" Margin="25"></c1:C1Accordion> |
XAML |
Copy Code
|
---|---|
<!--First Expander with a ListView--> <c1:C1Expander Header="Mail" Style="{StaticResource ExpanderStyle}"> <ListView> <ListViewItem Content="All Items"/> <ListViewItem Content="Inbox"/> <ListViewItem Content="Drafts"/> <ListViewItem Content="Sent Items"/> <ListViewItem Content="Deleted Items"/> </ListView> </c1:C1Expander> <!--Second Expander with a Calendar--> <c1:C1Expander Header="Calendar" Style="{StaticResource ExpanderStyle}"> <calendar:C1Calendar Background="Beige" VerticalAlignment="Top" DayOfWeekFormat="d" Margin="4"/> </c1:C1Expander> <!--Third Expander with a ListView--> <c1:C1Expander Header="Contacts" Style="{StaticResource ExpanderStyle}"> <ListView> <ListViewItem Content="John Smith"/> <ListViewItem Content="Bob Martin"/> <ListViewItem Content="Ricky Dylan"/> <ListViewItem Content="Joey Martin"/> <ListViewItem Content="James Geller"/> </ListView> </c1:C1Expander> <!--Fourth Expander with a ListView--> <c1:C1Expander Header="Tasks" Style="{StaticResource ExpanderStyle}"> <ListView> <ListViewItem Content="All Tasks"/> <ListViewItem Content="Completed Tasks"/> <ListViewItem Content="Active Tasks"/> <ListViewItem Content="Overdue Tasks"/> <ListViewItem Content="Halted Tasks"/> </ListView> </c1:C1Expander> |