<Window x:Class="TwitterClient.PinDialogBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Podaj pin" Height="136" Width="300" Name="PinWindow">
    <Window.Resources>
        <Style x:Key="textBoxErrorStyle" TargetType="TextBox">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip"
                            Value="{Binding RelativeSource={x:Static RelativeSource.Self},
                        Path=(Validation.Errors)[0].ErrorContent}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Grid Background="{DynamicResource AppBackgroundBrush}">
        <TextBox Height="44" Margin="12,12,12,0" Name="textBox" VerticalAlignment="Top" Opacity="0.4" FontSize="24" Style="{DynamicResource textBoxErrorStyle }">
            <TextBox.Text >
                <Binding Path="Pin" ElementName="PinWindow"  ValidatesOnExceptions="True"
                 UpdateSourceTrigger="PropertyChanged">
                    <Binding.ValidationRules>
                        <DataErrorValidationRule/>
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </TextBox>
        <Button Style="{DynamicResource RoundedButtonStyle}" Height="23" Margin="0,0,93,12" Name="buttonOK" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75" Click="ButtonOk_Click" IsEnabled="{Binding ElementName=PinWindow, Path=IsValid}">
            <Viewbox >
                <Path HorizontalAlignment="Center" Data="M50.0625,6.75 L32.263,23.2625 20.013845,10.512614 25.95158,4.7624397 32.451289,11.887963 44.450751,0.82542674 z"  Stretch="Fill" />
            </Viewbox>
        </Button>
        <Button Style="{DynamicResource RoundedButtonStyle}" Margin="0,0,12,12" Name="buttonCancel" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75" IsCancel="True">
            <Rectangle HorizontalAlignment="Center" VerticalAlignment="Center" Width="25" Height="9"/>
        </Button>
    </Grid>
</Window>
