<Window x:Class="R10_WyzwalaczeDanych.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:R10_WyzwalaczeDanych"
        mc:Ignorable="d"
        Title="Wyzwalacze danych" Height="180" Width="300">
    
        <StackPanel>
            <StackPanel.Resources>
                <Style x:Key="stylKwadrat" TargetType="Rectangle">
                    <Setter Property="Margin" Value="10"/>
                    <Setter Property="Fill" Value="LightBlue"/>
                    <Setter Property="Width" Value="30"/>
                    <Setter Property="Height" Value="30"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=cbOn, Path=IsChecked}" Value="True">
                            <Setter Property="Fill" Value="Red" />
                            <Setter Property="Width" Value="50"/>
                            <Setter Property="Height" Value="50"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            <Style x:Key="stylPolaTekstowego" TargetType="TextBox">
                <Setter Property="MaxLength" Value="11"/>
                <Setter Property="Width" Value="80"/>
                <Setter Property="Background" Value="LightPink"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text.Length}" Value="11">
                        <Setter Property="Background" Value="White"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            </StackPanel.Resources>
            <CheckBox x:Name="cbOn" Content="Zmień kolor i rozmiar" Margin="5"/>
            <Rectangle Style="{StaticResource stylKwadrat}"/>
            <WrapPanel>
                <Label Content="Wpisz nr PESEL"/>
                <TextBox Style="{StaticResource stylPolaTekstowego}"/>
            </WrapPanel>
    </StackPanel>
</Window>
