<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="CustomDialogs.ShowRemindersControl" x:Name="root_element" Loaded="root_Loaded" Width="450" Height="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls">
    <Grid x:Name="LayoutRoot" Margin="5">
        <Grid.Resources>
            <SolidColorBrush x:Key="BorderBrush" Color="#3F000000" />
            <c1:C1_Schedule_ShowReminders x:Key="C1_Schedule_ShowReminders" />
        </Grid.Resources>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MinHeight="24" Height="Auto" />
                <RowDefinition MinHeight="48" Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <MediaElement x:Name="media" Source="/C1.Silverlight.Schedule.5;component/Resources/ding.mp3" />
            <ScrollViewer Grid.Row="2" Padding="0" x:Name="viewer" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Auto">
                <c1:C1DockPanel Height="{Binding ViewportHeight, ElementName=viewer}">
                    <Border BorderThickness="0.5" BorderBrush="{StaticResource BorderBrush}" Margin="0,0,0,0.5" c1:C1DockPanel.Dock="Top" CornerRadius="3,3,0,0" Padding="3,1,1,1">
                        <Grid x:Name="listHeader">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="3" />
                            </Grid.ColumnDefinitions>
                            <Border Grid.Column="0" HorizontalAlignment="Stretch" SizeChanged="colSubject_SizeChanged" x:Name="colSubject">
                                <TextBlock Text="{Binding colSubject, Source={StaticResource C1_Schedule_ShowReminders}}" Margin="5,2,15,2" FontWeight="SemiBold" HorizontalAlignment="Center" />
                            </Border>
                            <controls:GridSplitter Grid.Column="0" Padding="1" Margin="1" Width="3" HorizontalAlignment="Right" VerticalAlignment="Stretch" />
                            <Border x:Name="colDueIn" Grid.Column="1" SizeChanged="colDueIn_SizeChanged">
                                <TextBlock Text="{Binding colTime, Source={StaticResource C1_Schedule_ShowReminders}}" Margin="5,2,15,2" FontWeight="SemiBold" HorizontalAlignment="Center" />
                            </Border>
                            <controls:GridSplitter Grid.Column="1" Padding="1" Margin="1" Width="3" HorizontalAlignment="Right" VerticalAlignment="Stretch" />
                        </Grid>
                    </Border>
                    <Border BorderThickness="0.5" BorderBrush="{StaticResource BorderBrush}" CornerRadius="0,0,3,3" Background="White" Margin="0" Padding="0">
                        <c1:RemindersListBox Margin="0" x:Name="remList" SelectionMode="Extended" ItemsSource="{Binding Scheduler.ActiveReminders, ElementName=root_element}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Margin="0,1,0,1">
                                        <Border Width="{Binding FirstColumnWidth, ElementName=remList}" Padding="2,0">
                                            <TextBlock Text="{Binding ParentAppointment.Subject}" />
                                        </Border>
                                        <Border Width="{Binding SecondColumnWidth, ElementName=remList}" Padding="2,0">
                                            <TextBlock Tag="{Binding ParentAppointment.Start}" />
                                        </Border>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="ListBoxItem">
                                    <Setter Property="Margin" Value="0" />
                                    <Setter Property="Padding" Value="0" />
                                </Style>
                            </ListBox.ItemContainerStyle>
                        </c1:RemindersListBox>
                    </Border>
                </c1:C1DockPanel>
            </ScrollViewer>
            <StackPanel x:Name="subject" Orientation="Horizontal" Grid.Row="0" Visibility="Collapsed">
                <Image Height="16" Stretch="Uniform">
                    <Image.Source>
                        <BitmapImage UriSource="/C1.Silverlight.Schedule.5;component/Resources/appointment.png" />
                    </Image.Source>
                </Image>
                <TextBlock Margin="10,2,0,2" VerticalAlignment="Center" FontWeight="Bold" Text="{Binding Path=SelectedItem.ParentAppointment.Subject, Mode=OneWay}" />
            </StackPanel>
            <StackPanel x:Name="info" Grid.Row="1" Margin="16, 5, 5, 5" Visibility="Collapsed">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Margin="10,2,0,2" VerticalAlignment="Center" Text="{Binding lblStart, Source={StaticResource C1_Schedule_ShowReminders}}" />
                    <TextBlock Margin="10,2,0,2" VerticalAlignment="Center" Text="{Binding Path=SelectedItem.ParentAppointment.Start}" />
                </StackPanel>
                <StackPanel Name="locationPanel" Orientation="Horizontal" Margin="0, 5, 0, 0">
                    <TextBlock Margin="10,2,0,2" VerticalAlignment="Center" Text="{Binding lblLocation, Source={StaticResource C1_Schedule_ShowReminders}}" />
                    <TextBlock Margin="10,2,0,2" VerticalAlignment="Center" Text="{Binding Path=SelectedItem.ParentAppointment.Location}" />
                </StackPanel>
            </StackPanel>
            <StackPanel x:Name="selectedReminders" Grid.Row="1" Margin="16, 5, 5, 5">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Margin="10,2,0,2" VerticalAlignment="Center" Text="{Binding SelectedRemindersNumber, Source={StaticResource C1_Schedule_ShowReminders}}" />
                    <TextBlock VerticalAlignment="Center" Margin="3,2,0,2" Text="{Binding Path=SelectedItems.Count}" />
                </StackPanel>
            </StackPanel>
            <c1:C1DockPanel Grid.Row="3" LastChildFill="false" x:Name="buttonsGrid">
                <Button x:Name="dismissAllButton" c1:C1DockPanel.Dock="Left" TabIndex="1" Margin="0,2,0,2" c1:CommandExtensions.Command="c1:C1Scheduler.DismissCommand" c1:CommandExtensions.CommandTarget="{Binding Scheduler, ElementName=root_element}" VerticalAlignment="Center" Padding="5" MinWidth="70" Content="{Binding btnDismissAll_Text, Source={StaticResource C1_Schedule_ShowReminders}}" />
                <Button x:Name="dismissButton" c1:C1DockPanel.Dock="Right" TabIndex="3" Margin="10,2,0,2" VerticalAlignment="Center" c1:CommandExtensions.CommandParameter="{Binding SelectedItems}" c1:CommandExtensions.CommandTarget="{Binding Scheduler, ElementName=root_element}" Padding="5" MinWidth="70" c1:CommandExtensions.Command="c1:C1Scheduler.DismissCommand" Content="{Binding btnDismiss_Text, Source={StaticResource C1_Schedule_ShowReminders}}" />
                <Button x:Name="openButton" c1:C1DockPanel.Dock="Right" TabIndex="2" Margin="10,2,0,2" VerticalAlignment="Center" c1:CommandExtensions.CommandParameter="{Binding Path=SelectedItems}" c1:CommandExtensions.CommandTarget="{Binding Scheduler, ElementName=root_element}" c1:CommandExtensions.Command="c1:C1Scheduler.EditAppointmentDialogCommand" Padding="5" MinWidth="70" Content="{Binding btnOpen_Text, Source={StaticResource C1_Schedule_ShowReminders}}" />
             </c1:C1DockPanel>
            <TextBlock Grid.Row="4" VerticalAlignment="Center" Margin="0,2,0,2" Text="{Binding lblSnooze, Source={StaticResource C1_Schedule_ShowReminders}}" />
            <Grid x:Name="snoozeGrid" Grid.Row="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <c1:C1TimeEditor x:Name="snoozeTimeSpansCombo" TabIndex="4" Margin="0,2,0,2" CycleChangesOnBoundaries="False" Format="TimeSpan" Increment="00:10" Minimum="0:01" Padding="1" VerticalAlignment="Center" />             
                <Button x:Name="snoozeButton" Grid.Column="1" TabIndex="5" Click="snoozeButton_Click" Margin="10,2,0,2" VerticalAlignment="Center" Padding="5" MinWidth="70" Content="{Binding btnSnooze_Text, Source={StaticResource C1_Schedule_ShowReminders}}" />
            </Grid>
        </Grid>
    </Grid>
</UserControl>