Access control within datatemplate
问题 This is XAML: <Window.Resources> <DataTemplate x:Key="Temp"> <DockPanel Width="Auto" Background="White" LastChildFill="False"> <TextBox Name="txtBox" TextWrapping="Wrap" DockPanel.Dock="Left" Text="{Binding RelativeSource={RelativeSource AncestorType=ContentControl}, Path=Content}" Height="20" Width="100"/> <StackPanel Orientation="Vertical"> <RadioButton Content="Option1" HorizontalAlignment="Left" Height="16" Width="112" Click="RadioButton_Click" /> </StackPanel> </DockPanel> </DataTemplate