<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">
    <Page.DataContext>
        <mw:ModelWidoku />
    </Page.DataContext>
    <Page.Resources>
        <local:BoolToBrushConverter x:Key="boolToBrush" />                
    </Page.Resources>
    <!--
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*" />
            <RowDefinition Height="1*" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <TextBlock HorizontalAlignment="Left" Grid.Row="0"
                   FontSize="25" Foreground="Navy" Margin="10,10,10,10">
            Suma: 
            <Run Foreground="Black" FontFamily="Courier New" 
                 Text="{Binding Path=Suma, Mode=OneWay}" />
        </TextBlock>
        <TextBox x:Name="tbKwota" FontSize="30" FontFamily="Courier New" 
                 TextAlignment="Right" Margin="10,10,10,10" Grid.Row="1" Text="0" 
                 Foreground="{Binding ElementName=btnDodaj, Path=IsEnabled, Mode=OneWay, Converter={StaticResource boolToBrush}}" />
        <Button x:Name="btnDodaj" Content="Dodaj" FontSize="20" Margin="10,10,10,10"
                Grid.Row="2" Command="{Binding DodajKwotę}" 
                CommandParameter="{Binding ElementName=tbKwota, Path=Text}" />
    </Grid>
    -->
    <StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Border Background="Navy" >
            <TextBlock Text="Asystent zakupów" Margin="20" FontSize="50" Foreground="White" />
        </Border>
        <TextBlock Margin="20" FontSize="65" 
                   Foreground="{ThemeResource ApplicationForegroundThemeBrush}" >
            Suma: 
            <Run Foreground="White" FontFamily="Courier New" 
                 Text="{Binding Path=Suma, Mode=OneWay}" />
        </TextBlock>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>
        <TextBox x:Name="tbKwota" Margin="20" Grid.Column="0"
                 FontSize="70" FontFamily="Courier New" 
                 Text="0" 
                 TextWrapping="Wrap" TextAlignment="Right"
                 Foreground="{Binding ElementName=btnDodaj, Path=IsEnabled, Mode=OneWay, Converter={StaticResource boolToBrush}}"
                 Background="White" />
        <Button x:Name="btnDodaj" Margin="20" FontSize="50" Grid.Column="1" HorizontalAlignment="Stretch"
                Content="Dodaj"                 
                Command="{Binding DodajKwotę}" 
                CommandParameter="{Binding ElementName=tbKwota, Path=Text}" 
                Foreground="{ThemeResource ApplicationForegroundThemeBrush}"/>    
        </Grid>
    </StackPanel>
</Page>

