<?xml version="1.0" encoding="utf-8"?>
<Page x:ConnectionId='1'
    x:Class="TodoXaml.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TodoXaml.Views"
    xmlns:titem="using:TodoXaml.Models"
    xmlns:conv="using:TodoXaml.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.Resources>
        <conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
        <local:PriorityToBrushConverter x:Key="PriorityToBrushConverter"/>
        <conv:PriorityToIndexConverter x:Key="PriorityToIndexConverter"/>
    </Page.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="500" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <!-- BAL OLDAL: lista -->
        <StackPanel Background="{ThemeResource AppBarBackgroundThemeBrush}"
                    Grid.Column="0" Margin="20">
            <CommandBar VerticalContentAlignment="Center"
                        Background="{ThemeResource AppBarBackgroundThemeBrush}"
                        DefaultLabelPosition="Right">
                <CommandBar.Content>
                    <TextBlock Margin="12,0,0,0"
                               Style="{ThemeResource SubtitleTextBlockStyle}"
                               Text="To-Dos" />
                </CommandBar.Content>
                <AppBarButton x:ConnectionId='16' Icon="Add"
                              Label="Add"
                                                  />
            </CommandBar>

            <ListView x:ConnectionId='9' x:Name="TodoListView"
                                                  
                      Margin="0,20,0,0"
                      SelectionMode="Single"
                      Background="{ThemeResource AppBarBackgroundThemeBrush}">
                <ListView.ItemTemplate>
                    <DataTemplate                            >
                        <Grid x:ConnectionId='11' Margin="10">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <StackPanel>
                                <TextBlock x:ConnectionId='13'                                   
                                           FontWeight="SemiBold"
                                                                                                                              />
                                <TextBlock x:ConnectionId='14'                                         
                                           Opacity="0.7"/>
                                <TextBlock x:ConnectionId='15'                                                        
                                           FontSize="12"/>
                            </StackPanel>
                            <SymbolIcon x:ConnectionId='12' Grid.Column="1"
                                        Symbol="Accept"
                                        VerticalAlignment="Center"
                                                                                                                          />
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackPanel>

        <!-- JOBB OLDAL: fejléc + űrlap -->
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0"
                       Text="To-Do item"
                       FontSize="25"
                       HorizontalAlignment="Left"
                       VerticalAlignment="Center"
                       Margin="20,0,0,0"/>

            <ScrollViewer x:ConnectionId='2' Grid.Row="1"
                          Margin="8,0,8,8"
                                                                                                                                >
                <StackPanel Spacing="15"
                            Padding="10,15,10,15"
                            BorderThickness="1"
                            BorderBrush="LightGray">

                    <TextBox x:ConnectionId='3' Header="Title"
                                                                       />

                    <TextBox x:ConnectionId='4' Header="Description"
                             AcceptsReturn="True"
                             Height="160"
                             TextWrapping="Wrap"
                             ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                                             />

                    <DatePicker x:ConnectionId='5' Header="Deadline"
                                Language="en-US"
                                HorizontalAlignment="Left"
                                                                             />

                    <ComboBox x:ConnectionId='6' Header="Priority"
                                                                                                                     >
                        <ComboBoxItem Content="Low"/>
                        <ComboBoxItem Content="Normal"/>
                        <ComboBoxItem Content="High"/>
                    </ComboBox>

                    <CheckBox x:ConnectionId='7' Content="Is Done"
                                                                              />

                    <Button x:ConnectionId='8' Content="Save"
                            HorizontalAlignment="Right"
                            Style="{StaticResource AccentButtonStyle}"
                                                 />
                </StackPanel>
            </ScrollViewer>
        </Grid>
    </Grid>
</Page>

