<?xml version="1.0" encoding="utf-8"?>
<ContentDialog
    x:Class="was.droidtransfer.features.calendars.CalendarEventDetailsContentDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:was.droidtransfer.features.calendars"
    xmlns:converters="using:was.droidtransfer.features.calendars.converters"
    xmlns:commonConverters="using:was.droidtransfer.features.converters"
    xmlns:icalcomponents="using:Ical.Net.CalendarComponents"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Uid="CalendarEventDetailsContentDialog"
    CloseButtonText="XX Dismiss"
    DefaultButton="Close">
    <ContentDialog.Resources>
        <converters:CalendarEventToStringConverter x:Key="CalendarEventToStringConverter"/>
        <converters:ICalPropertiesToColorConverter x:Key="ICalPropertiesToColorConverter"/>
        <converters:ICalPropertiesToCalendarName x:Key="ICalPropertiesToCalendarName"/>
        <commonConverters:ValueToVisibilityConverter x:Key="ValueToVisibilityConverter"/>
    </ContentDialog.Resources>
    <ContentDialog.TitleTemplate>
        <DataTemplate x:DataType="icalcomponents:CalendarEvent">
            <StackPanel Orientation="Horizontal" Spacing="16">
                <Border Width="12" CornerRadius="4" Background="{x:Bind Properties, Converter={StaticResource ICalPropertiesToColorConverter}}" />
                <TextBlock Text="{x:Bind Summary}" Style="{ThemeResource TitleTextBlockStyle}" />
            </StackPanel>
        </DataTemplate>
    </ContentDialog.TitleTemplate>
    <ScrollViewer Margin="0,8,0,0" VerticalScrollBarVisibility="Auto">
        <StackPanel Margin="24,0,0,0">
            <Grid ColumnSpacing="12">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <FontIcon Glyph="&#xE787;" VerticalAlignment="Top" Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" />
                <TextBlock Grid.Column="1" Text="{x:Bind CalendarEvent, Converter={StaticResource CalendarEventToStringConverter}}" Style="{ThemeResource CaptionTextBlockStyle}" VerticalAlignment="Center" />
            </Grid>
            <MenuFlyoutSeparator Visibility="{x:Bind CalendarEvent.Location, Converter={StaticResource ValueToVisibilityConverter}}" Padding="0" Margin="36,8,0,8" />
            <Grid Visibility="{x:Bind CalendarEvent.Location, Converter={StaticResource ValueToVisibilityConverter}}" ColumnSpacing="12">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <FontIcon Glyph="&#xE707;" VerticalAlignment="Top" Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" />
                <TextBlock Grid.Column="1" Text="{x:Bind CalendarEvent.Location}" Style="{ThemeResource BodyTextBlockStyle}" VerticalAlignment="Center"  />
            </Grid>
            <MenuFlyoutSeparator Visibility="{x:Bind CalendarEvent.Description, Converter={StaticResource ValueToVisibilityConverter}}" Padding="0" Margin="36,8,0,8" />
            <Grid Visibility="{x:Bind CalendarEvent.Description, Converter={StaticResource ValueToVisibilityConverter}}" ColumnSpacing="12">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <FontIcon Glyph="&#xE70B;" VerticalAlignment="Top" Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" />
                <TextBlock Grid.Column="1" Text="{x:Bind CalendarEvent.Description}" Style="{ThemeResource BodyTextBlockStyle}" TextWrapping="Wrap" VerticalAlignment="Center" />
            </Grid>
        </StackPanel>
    </ScrollViewer>
</ContentDialog>
