<Window x:Class="Kolory.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:Kolory"
        xmlns:mw="clr-namespace:Kolory.ModelWidoku"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        mc:Ignorable="d"
        Title="MainWindow" Height="382.637" Width="525"
        local:KlawiszWyłączBehavior.Klawisz="Q">
    <!--Closed="Window_Closed">-->
    <Window.Resources>
        <local:RGBToBrushConverter x:Key="rgb2brush" />
    </Window.Resources>
    <Window.DataContext>
        <mw:EdycjaKoloru />
    </Window.DataContext>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closed">
            <i:InvokeCommandAction Command="{Binding Zapisz}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <i:Interaction.Behaviors>
        <local:ZamknięcieOknaPoNaciśnięciuKlawisza Klawisz="Esc" />
        <local:PrzyciskZamykającyOkno Przycisk="{Binding ElementName=przyciskZamykającyOkno}" />
    </i:Interaction.Behaviors>
    <DockPanel LastChildFill="True" local:KlawiszWyłączBehavior.Klawisz="W">
        <Slider Name="sliderB" DockPanel.Dock="Bottom" Margin="10,0,10,10" Maximum="255" SmallChange="1" Value="{Binding B, Mode=TwoWay}" />
        <Slider Name="sliderG" DockPanel.Dock="Bottom" Margin="10,0,10,10" Maximum="255" SmallChange="1" Value="{Binding G, Mode=TwoWay}" />
        <Slider Name="sliderR" DockPanel.Dock="Bottom" Margin="10,10,10,10" Maximum="255" SmallChange="1" Value="{Binding R, Mode=TwoWay}" local:KlawiszWyłączBehavior.Klawisz="E" />
        <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom">
            <TextBlock Name="tbColorHexCode" Text="{Binding ColorHexCode, StringFormat=HEX: {0}}" Margin="10,10,10,10" Width="100" VerticalAlignment="Center" />
            <Button Content="Kopiuj do schowka" Margin="10,10,10,10" Height="25" Command="{Binding Kopiuj}" />
            <TextBlock Name="tbVersion" Text="Wersja: 0.0.0.0" Margin="10,10,10,10" VerticalAlignment="Center" />
            <Button x:Name="przyciskZamykającyOkno" Content="Zamknij" Margin="10,10,10,10" />
            <Button Content="Resetuj" Margin="10,10,10,10" Command="{Binding Resetuj, Mode=OneWay}" />
        </StackPanel>
        <!--<Rectangle Name="rectangle" Fill="{Binding Brush, Mode=OneWay}" Margin="10,10,10,10" />-->
        <Rectangle Name="rectangle" Margin="10,10,10,10">
            <Rectangle.Fill>
                <MultiBinding Converter="{StaticResource rgb2brush}">
                    <Binding Path="R" />
                    <Binding Path="G" />
                    <Binding Path="B" />
                </MultiBinding>
            </Rectangle.Fill>
        </Rectangle>
    </DockPanel>
</Window>
