Sss*_*Sss 0 .net c# silverlight stackpanel radio-button
我在程序上做这部分.我想将此堆栈面板上的UIElelemnts(radiobuttons)设置为部分可见,因此我想要任何可以使stackpanel属性IsEnabled设置为False的任何等效属性(任何quivalent属性或任何其他方式来实现此目的,因为stackpanel不支持IsEnabled ).
或者,如果有可能有另一个可能是stackpanel的父级并且还支持IsEnabled属性的conntainer.(当我在stackpanel上设置它们时,请不要建议为循环中的每个单选按钮设置IsEnabled为false因为我不能这样做,因为代码中的当前情况我想要一些可以设置为IsEnabled的大容器).
尝试使用内容模板包装堆栈面板,并将其IsEnabled属性设置为false.
<ContentControl IsEnabled="false">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="90"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Fullname" Grid.Row="0" Grid.Column="0" />
<TextBox Grid.Row="0" Grid.Column="1"/>
<TextBlock Text="Address" Grid.Row="1" Grid.Column="0"/>
<TextBox Grid.Row="1" Grid.Column="1"/>
</Grid>
<Button Content="Update" Margin="5" Width="100"/>
</StackPanel>
</ContentControl>
Run Code Online (Sandbox Code Playgroud)