我在3个不同的用户控件中创建了3个扩展器,并且这些用户控件是从扩展器中的主用户控件调用的。如何启用展开/折叠,即,当展开一个展开器时,其他应该折叠。 最初,当App出现时,First Expander应该扩展,其他应该崩溃。
提前致谢!
<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>
显示控制,ExamControl,可视化是具有相应扩展器的3个用户控件。
我已经包含了xaml的主要部分。请回复asap