<Page
    x:Class="AsystentZakupówUA.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AsystentZakupówUA"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mw="using:AsystentZakupówUA.ModelWidoku"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Page.DataContext>
        <mw:ModelWidoku />
    </Page.DataContext>
    <Page.Resources>
        <local:BoolToBrushConverter x:Key="boolToBrush" />                
    </Page.Resources>
    <StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Border Background="Navy" >
            <TextBlock Text="Asystent zakupów" Margin="10" FontSize="40" Foreground="White" />
        </Border>
        <TextBlock Margin="20,20,20,10" FontSize="55" 
                   Foreground="{ThemeResource ApplicationForegroundThemeBrush}" >
            Suma: 
            <Run Foreground="White" FontFamily="Courier New" 
                 Text="{Binding Path=Suma, Mode=OneWay}" />
        </TextBlock>        
        <TextBox x:Name="tbKwota" Margin="20,10,20,10"
                 FontSize="55" FontFamily="Courier New" 
                 Text="0" 
                 TextAlignment="Right"
                 Foreground="{Binding ElementName=btnDodaj, Path=IsEnabled, Mode=OneWay, Converter={StaticResource boolToBrush}}"
                 Background="White" />
        <Button x:Name="btnDodaj" Margin="20,10,20,10" FontSize="40" HorizontalAlignment="Stretch"
                Content="Dodaj"                 
                Command="{Binding DodajKwotę}" 
                CommandParameter="{Binding ElementName=tbKwota, Path=Text}" 
                Foreground="{ThemeResource ApplicationForegroundThemeBrush}"/>    
    </StackPanel>
</Page>