I have created 3 Expanders in 3 different User Controls,and these User Controls is invoked from a Master User Control from within an Expander. How can I enable Expand/Collapse i.e.,when one Expander is expanded others should be collapsed. Initially when the App comes up, First Expander should be expanded and others should be collapsed.
Thanks in advance!
<UserControl x:Class="WpfUserControlLibrary.MasterTaskControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:myUserDisplayControl="clr-namespace:WpfUserControlLibrary"
mc:Ignorable="d"
d:DesignHeight="941" d:DesignWidth="1213">
<DockPanel Name="MasterDockPanel" Grid.Row="1" Grid.Column="0" Height="Auto">
<Expander
x:Name="Expander1"
ExpandDirection="Left"
DockPanel.Dock="Left"
IsExpanded="True"
>
<Grid Background="DarkSlateBlue" Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Content="BasicImagingControlArea"
Grid.Row="0"
Name="BasicImagingLabel"
FontWeight="Bold"/>
<myUserDisplayControl:DisplayControl Grid.Row="1" Visibility="Visible" x:Name="DisplayControl"/>
<myUserDisplayControl:ExamControl Grid.Row="2" Visibility="Visible" x:Name="ExamControl"/>
<myUserDisplayControl:Visualization Grid.Row="3" Visibility="Visible" x:Name="Visualization"/>
</Grid>
</Expander>
</DockPanel>
</UserControl>
Display Control,ExamControl,Visualization are the 3 User Controls that has the respective Expanders.
I have included the main parts of the xaml.Please reply with an answer asap