Category / Section
How to Expand or Collapse the Taskbar programmatically?
1 min read
You can easily expand or collapse the TaskBar in XAML by using the IsOpened property. To expand or collapse the TaskBar in code behind, use the SetIsOpened method of the TaskBar.
The following code example demonstrates the same.
XAML
<syncfusion:TaskBar Name="downloadTaskBar" > <syncfusion:TaskBarItem Name="showprogressTaskBarItem" Header="Show Progress" > <StackPanel Margin="10" HorizontalAlignment="Center" VerticalAlignment="Stretch"> <TextBlock TextWrapping="Wrap">Shows the current send/receive status</TextBlock> </StackPanel> </syncfusion:TaskBarItem> <syncfusion:TaskBarItem Header="Download Preferences"> <StackPanel Margin="10" HorizontalAlignment="Center" VerticalAlignment="Stretch"> <TextBlock TextWrapping="Wrap">Changes the preferences for downloading message headers</TextBlock> </StackPanel> </syncfusion:TaskBarItem> <syncfusion:TaskBarItem Header="Process Marked headers"> <StackPanel Margin="10" HorizontalAlignment="Center" VerticalAlignment="Stretch"> <TextBlock TextWrapping="Wrap">The content of all marked headers in the folder</TextBlock> </StackPanel> </syncfusion:TaskBarItem> </syncfusion:TaskBar>
C#
TaskBar.SetIsOpened(downloadTaskBar, false); TaskBar.SetIsOpened(showprogressTaskBarItem, true);
The following screenshots display the Collapsed TaskBar and Expanded TaskBarItem.
Figure 1: Collapsed TaskBar
Figure 2: Expanded TaskBarItem