Created
March 25, 2023 04:53
-
-
Save eeevans/23ea1ee547826cb457f13b0488598523 to your computer and use it in GitHub Desktop.
XAML for window that creates buttons that have a binding for FontSize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="Wpf.Binding.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:Wpf.Binding" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="450" Width="800"> | |
<Window.Resources> | |
<Style TargetType="Button"> | |
<Setter Property="FontSize" Value="{Binding FontSizeLabel}" /> | |
</Style> | |
</Window.Resources> | |
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto" /> | |
<RowDefinition Height="Auto" /> | |
<RowDefinition Height="*" /> | |
</Grid.RowDefinitions> | |
<Button Grid.Row="0" x:Name="AddButton" Click="AddButton_Click">Add Button</Button> | |
<Button Grid.Row="1" x:Name="ToggleSizeButton" Margin="0 5" Click="ToggleSizeButton_Click">Toggle Size Button</Button> | |
<ItemsControl Grid.Row="2" x:Name="ButtonList"> | |
<Button>Existing Button</Button> | |
</ItemsControl> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment