Please look into the picture below. This is one Window
where I have placed multiple TextBlock
s inside a Grid
. Its actually the marketing team that compelled me to design the UI like this. But I am facing other issues like
I have code the XAML
like this as I can only achieve the UI design if I place the TextBlocks
in this way.
<TextBlock x:Name="BlueTextBlock"
Margin="100,10,0,0"
Foreground="Blue"
Text="{Binding ElementName=GridAlltextBlocks, Path=??? Mode=TwoWay}"/>
<Grid x:Name="GridAlltextBlocks">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Focusable="True" Text="Value 1"/>
<TextBlock Grid.Row="1" Grid.Column="0" Focusable="True" Text="Value 6"/>
<TextBlock Grid.Row="2" Grid.Column="1" Focusable="True" Text="Value 2"/>
<TextBlock Grid.Row="3" Grid.Column="3" Focusable="True" Text="Value 3"/>
<TextBlock Grid.Row="1" Grid.Column="1" Focusable="True" Text="Value 4"/>
<TextBlock Grid.Row="2" Grid.Column="3" Focusable="True" Text="Value 5"/>
</Grid>
Now the question is: How I bind the value of the BlueTextBlock
with one of the value of the textBlocks
inside the Grid.
Lets say I have selected the textBlock having text="Value 2
" then the BlueTextBlock
text should also be Value 2
.
how can I achieve this?