<Page
    x:Class="KoloryUWP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:KoloryUWP"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mw="using:KoloryMVVM.ModelWidoku"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Page.DataContext>
        <mw:EdycjaKoloru />
    </Page.DataContext>
    <Page.Resources>
        <local:ByteToDoubleConverter x:Key="konwersjaByteDouble" />
    </Page.Resources>
    <StackPanel>
        <Rectangle x:ConnectionId='2' x:Name="panel" Margin="10" Height="300" >
            <Rectangle.Fill>
                <SolidColorBrush Color="{Binding Kolor}" />
            </Rectangle.Fill>
        </Rectangle>
        <Slider x:ConnectionId='3' x:Name="sliderR" Margin="10" Maximum="255"
                Value="{Binding R, Mode=TwoWay, Converter={StaticResource konwersjaByteDouble}}" />
        <Slider x:ConnectionId='4' x:Name="sliderG" Margin="10" Maximum="255"
                Value="{Binding G, Mode=TwoWay, Converter={StaticResource konwersjaByteDouble}}" />
        <Slider x:ConnectionId='5' x:Name="sliderB" Margin="10" Maximum="255" 
                Value="{Binding B, Mode=TwoWay, Converter={StaticResource konwersjaByteDouble}}" />
        <Button Content="Resetuj" Margin="10" Width="100" Height="30" HorizontalAlignment="Left"
                Command="{Binding Resetuj}" />
        <Button x:ConnectionId='6' x:Name="przyciskZamknij" Content="Zamknij" Margin="10" Width="100" Height="30" HorizontalAlignment="Right" />
        <!--<Rectangle x:Name="panel" Margin="10" Fill="{Binding Kolor, Converter={StaticResource konwersjaColorBrush}}" />-->
    </StackPanel>
</Page>

