110,538
社区成员
发帖
与我相关
我的任务
分享
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:ia="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:iv="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
x:Class="SilverlightApplication1.MainPage"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<Style x:Key="VisiblityStyleKey" TargetType="sdk:Label">
<iv:Interaction.Triggers>
<ia:DataTrigger Binding="{Binding ElementName=xianshi,Path=IsChecked}" Value="True">
<ia:ChangePropertyAction PropertyName="Visibility" Value="Visible"/>
</ia:DataTrigger>
<ia:DataTrigger Binding="{Binding ElementName=yincang,Path=IsChecked}" Value="True">
<ia:ChangePropertyAction PropertyName="Visibility" Value="Collapsed"/>
</ia:DataTrigger>
</iv:Interaction.Triggers>
</Style>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
<RadioButton Canvas.Left="630.499" Canvas.Top="511" Content="显示" Height="16" IsChecked="True" x:Name="xianshi" GroupName="Group1" Margin="61,188,233,96"/>
<RadioButton Canvas.Left="752.499" Canvas.Top="511" Content="隐藏" Height="16" x:Name="yincang" GroupName="Group1" Margin="229,188,54,96"/>
<sdk:Label Content="为毛不隐藏" HorizontalAlignment="Left" Height="27" Margin="133,108,0,0" VerticalAlignment="Top" Width="153" Style="{StaticResource VisiblityStyleKey}"/>
</Grid>
</UserControl>