Good afternoon.
The following style is available:
<Style x:Key="Style_MainButtons" TargetType="ToggleButton"> <Setter Property="Width" Value="110" /> <Setter Property="Height" Value="110" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <TextBlock x:Name="Text" HorizontalAlignment="Center" /> <Image x:Name="Image" Grid.Row="1" /> </Grid> <ControlTemplate.Triggers> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
Since there are several buttons and each has its own text and picture, I would like to assign the content of the text and the address of the picture in the following code:
<ToggleButton x:Name="btnHorizontal" Style="{StaticResource Style_MainButtons}" Grid.Column="0" Grid.Row="1" Checked ="SetVersion" Unchecked ="SetVersion" IsChecked="True" > </ToggleButton>
How can this be done?
Content
. - VladD