I have the following code in XAML
:
<Button Grid.Column="0" Grid.Row="1" x:Name="btnSete" Click="btn_Click">
<ContentControl>
<Viewbox Margin="3">
<TextBlock Text="7"/>
</Viewbox>
</ContentControl>
</Button>
and no code behind:
private void btn_Click(object sender, RoutedEventArgs e)
{
Button btn = (Button)sender;
//txbDisplay.Text = btn.ContentStringFormat.ToString();
}
Doubt is now, how do I in the event of Click
get the content that is within:
<ContentControl>
<Viewbox Margin="3">
<TextBlock Text="7"/>
</Viewbox>
</ContentControl>
button?
I want to show in txbDisplay
the value that is in <TextBlock Text="7"/>
.