Windows phone xaml ページにグリッド ビューがあり、このグリッドにはボタン、チェックボックス、テキスト ボックスなどの多くの UI 要素が含まれています。そのグリッドから特定の UIElement を名前で検索し、その UIElement の値を取得して、いくつかの新しい値も設定したいと考えています。コード ビハインドでビジュアル ツリー ヘルパーを使用して、そのグリッドからその UIElement を取得する方法。
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="120" />
<RowDefinition Height="120" />
<RowDefinition Height="120" />
<RowDefinition Height="120" />
<RowDefinition Height="120" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240" />
<ColumnDefinition Width="240" />
</Grid.ColumnDefinitions>
<Border BorderThickness="2" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Name="Border1">
<Image Width="110" Height="110" Stretch="Fill" Name="Image1" Tap="Image1_Tap" />
</Border>
<Border BorderThickness="2" BorderBrush="Transparent" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Name="Border2">
<Image Width="110" Height="110" Stretch="Fill" Name="Image2" Tap="Image2_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="0" Name="Border3">
<Image Width="110" Height="110" Stretch="Fill" Name="Image3" Tap="Image3_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Left" Grid.Row="3" Grid.Column="0" Name="Border4">
<Image Width="110" Height="110" Stretch="Fill" Name="Image4" Tap="Image4_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Left" Grid.Row="5" Grid.Column="0" Name="Border5">
<Image Width="110" Height="110" Stretch="Fill" Name="Image5" Tap="Image5_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Right" Grid.Row="0" Grid.Column="1" Name="Border11">
<Image Width="110" Height="110" Stretch="Fill" Name="Image11" Tap="Image11_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="1" Name="Border22">
<Image Width="110" Height="110" Stretch="Fill" Name="Image22" Tap="Image22_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1" Name="Border33">
<Image Width="110" Height="110" Stretch="Fill" Name="Image33" Tap="Image33_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Right" Grid.Row="3" Grid.Column="1" Name="Border44">
<Image Width="110" Height="110" Stretch="Fill" Name="Image44" Tap="Image44_Tap" />
</Border>
<Border BorderThickness="2" HorizontalAlignment="Right" Grid.Row="5" Grid.Column="1" Name="Border55">
<Image Width="110" Height="110" Stretch="Fill" Name="Image55" Tap="Image55_Tap" />
</Border>
</Grid>
I want to match options. Lets Say Left Side Some Images Are Clicked And Its Border Changed And Once On Right SIde Clicked Which Option is Matched Either Left SIde Have Some Selection or Not