<Page
    x:Class="was.touchcopy.features.messaging.MessagingSettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    NavigationCacheMode="Enabled">

    <Grid>

        <Grid.Resources>
            <Style x:Key="HelpButtonBorderStyle" TargetType="Border">
                <Setter Property="CornerRadius" Value="12"/>
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="BorderBrush" Value="{StaticResource SystemAccentColor}"/>
                <Setter Property="Padding" Value="3"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
            </Style>
            <Style x:Key="HelpButtonFontIconStyle" TargetType="FontIcon">
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="FontWeight" Value="SemiBold"/>
                <Setter Property="Foreground" Value="{ThemeResource SystemAccentColor}"/>
                <Setter Property="Glyph" Value="&#xE897;"/>
            </Style>
        </Grid.Resources>
        <StackPanel Padding="20,10" >
            <StackPanel.Resources>
                <Style TargetType="ComboBox">
                    <Setter Property="Margin" Value="0,0,0,15"/>
                    <Setter Property="SelectedIndex" Value="0"/>
                </Style>
            </StackPanel.Resources>
            <TextBlock x:Uid="TextBlockMessageSettings" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,10,0,20" Text="XX Messages Settings"/>

            <!-- CONVERSATIONS -->
            <TextBlock x:Uid="TextBlockConversations" Style="{ThemeResource SubtitleTextBlockStyle}" Text="XX Conversations" Margin="0,0,0,15"/>

            <CheckBox x:Name="checkboxHideConversationsUnknownContacts" IsChecked="False" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockHideConvesationUnknownContacts" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Hide conversations from unknown contacts."/>
            </CheckBox>

            <StackPanel Orientation="Horizontal">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <ComboBox x:Uid="ComboBoxSortOrder" x:Name="comboBoxSortOrder" Header="XX Sort Conversations by">
                        <ComboBoxItem x:Uid="ComboBoxItemName" Content="XX Name"/>
                        <ComboBoxItem x:Uid="ComboBoxItemLastUpdated" Content="XX Last Updated"/>
                    </ComboBox>
                    <Border x:Name="borderConversavtionSortOrderHelp" Style="{StaticResource HelpButtonBorderStyle}" Tapped="BorderConversavtionSortOrderHelp_Tapped" Margin="20,1,0,0" >
                        <FontIcon Style="{StaticResource HelpButtonFontIconStyle}"/>
                    </Border>
                </StackPanel>
                <TeachingTip x:Uid="teachingTipConversationSortOrder" x:Name="teachingTipConversationSortOrder" Target="{x:Bind comboBoxSortOrder}" Title="XX Conversation Sort Order" 
                         Subtitle="XX This determines how your conversations are listed. Listed alphabetically by participant name or by date last updated."/>
            </StackPanel>

            <!-- MESSAGES -->
            <TextBlock x:Uid="TextBlockMessages" Style="{ThemeResource SubtitleTextBlockStyle}" Text="XX Messages" Margin="0,20,0,15"/>
            <ComboBox x:Uid="ComboBoxMessagesSortOrder" x:Name="comboBoxMessagesSortOrder" Header="XX Sort Messages by">
                <ComboBoxItem x:Uid="ComboBoxItemOldestToNewest" Content="XX Oldest to Newest"/>
                <ComboBoxItem x:Uid="ComboBoxItemNewestToOldest" Content="XX Newest to Oldest"/>
            </ComboBox>
            <CheckBox x:Name="checkboxShowContactImages" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockcheckboxShowContactImages" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Show contact images."/>
            </CheckBox>
            <CheckBox x:Name="checkboxShowNumbersInMessages" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockShowNumbersInMessages" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Show contact phone numbers and emails."/>
            </CheckBox>
            <CheckBox x:Name="checkboxShowDeletedMessages" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockShowDeletedMessages" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Show deleted messages where available."/>
            </CheckBox>
            <CheckBox x:Name="checkboxShowInternetPreviewInMessages" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockShowInternetPreviewInMessages" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Show internet previews in messages."/>
            </CheckBox>
            <CheckBox x:Name="checkboxAutoLoadFirstConversation" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockAutoLoadFirstConversation" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Automatically preview the first listed conversation." />
            </CheckBox>
            <CheckBox x:Name="checkboxClickToLoadMedia" Margin="0,0,0,10">
                <TextBlock x:Uid="TextBlockClickToLoadMedia" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Load media automatically in preview." />
            </CheckBox>
            <CheckBox x:Name="checkBoxShowCustomNumber" Margin="0,0,0,0">
                <TextBlock x:Uid="TextBlockShowCustomNumber" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Include my details above sent messages:" />
            </CheckBox>
            <StackPanel Orientation="Horizontal" Margin="30,2,0,10" Spacing="6">
                <TextBlock x:Name="textBlockShownCustomNameDescription" x:Uid="TextBlockShowCustomNameDescription" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Show my name as" VerticalAlignment="Center" />
                <TextBox x:Name="textBoxCustomName" VerticalAlignment="Center" Width="150" LostFocus="_textBoxCustomName_LostFocus" IsEnabled="{Binding IsChecked, ElementName=checkBoxShowCustomNumber, Mode=OneWay}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="30,0,0,0" Spacing="6">
                <TextBlock x:Name="textBlockShownCustomNumberDescription" x:Uid="TextBlockShowCustomNumberDescription" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Show my number as" VerticalAlignment="Center" />
                <TextBox x:Name="textBoxCustomNumber" VerticalAlignment="Center" Width="150" LostFocus="_textBoxCustomNumber_LostFocus" IsEnabled="{Binding IsChecked, ElementName=checkBoxShowCustomNumber, Mode=OneWay}" />
            </StackPanel>

            <!-- EXPORTING -->
            <TextBlock x:Uid="TextBlockExport" Style="{ThemeResource SubtitleTextBlockStyle}" Text="XX Exporting" Margin="0,20,0,15"/>
            <StackPanel Orientation="Horizontal">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
                    <ComboBox x:Uid="ComboBoxExportLayout" x:Name="comboBoxExportLayout" Header="XX Export layout">
                        <ComboBoxItem x:Uid="ComboBoxItemStandard" Content="XX Standard"/>
                        <ComboBoxItem x:Uid="ComboBoxItemCompact" Content="XX Compact"/>
                    </ComboBox>
                    <Border x:Name="borderExportLayout" Style="{StaticResource HelpButtonBorderStyle}" Tapped="BorderExportLayout_Tapped" Margin="20,1,0,0" >
                        <FontIcon Style="{StaticResource HelpButtonFontIconStyle}"/>
                    </Border>
                </StackPanel>
                <TeachingTip x:Uid="teachingTipExportLayout" x:Name="teachingTipExportLayout" Target="{x:Bind comboBoxExportLayout}" Title="XX Export Layout" 
                         Subtitle="XX This determines the amount of spacing used when exporting conversations to HTML or PDF."/>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="50,0,0,0">
                    <ComboBox x:Uid="ComboBoxFontSizeStyle" x:Name="comboBoxFontSizeStyle" Margin="0" Header="XX Font size">
                        <ComboBoxItem x:Uid="ComboBoxItemSmallest" Content="XX Smallest"/>
                        <ComboBoxItem x:Uid="ComboBoxItemSmall" Content="XX Small"/>
                        <ComboBoxItem x:Uid="ComboBoxItemMedium" Content="XX Medium"/>
                        <ComboBoxItem x:Uid="ComboBoxItemLarge" Content="XX Large"/>
                        <ComboBoxItem x:Uid="ComboBoxItemLargest" Content="XX Largest"/>
                    </ComboBox>
                    <Border x:Name="borderFontSizeStyle" Style="{StaticResource HelpButtonBorderStyle}" Tapped="BorderFontSizeStyle_Tapped" Margin="20,1,0,0" >
                        <FontIcon Style="{StaticResource HelpButtonFontIconStyle}"/>
                    </Border>

                </StackPanel>
                <TeachingTip x:Uid="teachingTipFontSizeStyle" x:Name="teachingTipFontSizeStyle" Target="{x:Bind comboBoxFontSizeStyle}" Title="XX Font Size" 
                        Subtitle="XX This determines the font size used when exporting conversations to HTML or PDF."/>
            </StackPanel>
            
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <CheckBox x:Name="checkBoxEmbedHTMLMedia" IsChecked="True">
                    <TextBlock x:Uid="TextBlockEmbedHTMLMedia" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Embed media data directly into the HTML file."/>
                </CheckBox>
                <Border x:Name="borderEmbedHTMLMediaHelp" Style="{StaticResource HelpButtonBorderStyle}" Tapped="BorderEmbedHTMLMediaHelp_Tapped" Margin="20,1,0,0">
                    <FontIcon Style="{StaticResource HelpButtonFontIconStyle}"/>
                </Border>
            </StackPanel>
            <TeachingTip x:Uid="TeachingTipEmbedHTMLMedia" x:Name="teachingTipEmbedHTMLMedia" Target="{x:Bind checkBoxEmbedHTMLMedia}" Title="XX Embed HTML Media" 
                         Subtitle="XX This embeds media data directly into the HTML file as opposed to exporting each media file as a separate file linked to within the HTML document."/>
            <CheckBox x:Name="checkBoxAttachmentsDateTime">
                <TextBlock x:Uid="checkBoxAttachmentsDateTime" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Include message date in attachments file name."/>
            </CheckBox>
            <CheckBox x:Name="checkBoxIncludeDateRangeInExportedFileName">
                <TextBlock x:Uid="TextBlockIncludeDateRangeInExportedFileName" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Include date range in conversation file name."/>
            </CheckBox>

            <!-- SEARCH OPTIONS -->
            <TextBlock x:Uid="TextBlockSearchOptions" Style="{ThemeResource SubtitleTextBlockStyle}" Text="XX Search" Margin="0,20,0,15"/>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <ComboBox x:Uid="ComboBoxSearchOption" x:Name="comboBoxSearchOption" Header="XX When searching, search">
                    <ComboBoxItem x:Uid="ComboBoxItemConversations" Content="XX Conversations"/>
                    <ComboBoxItem x:Uid="ComboBoxItemConversationsAndMessages" Content="XX Conversations and Messages"/>
                </ComboBox>
                <Border x:Name="borderSearchOptionHelp" Style="{StaticResource HelpButtonBorderStyle}" Tapped="BorderSearchOptionHelp_Tapped" Margin="20,1,0,0" >
                    <FontIcon Style="{StaticResource HelpButtonFontIconStyle}"/>
                </Border>
            </StackPanel>
            <TeachingTip x:Uid="teachingTipSearchOption" x:Name="teachingTipSearchOption" Target="{x:Bind comboBoxSearchOption}" Title="XX Search Option" 
                         Subtitle="XX This determines how message searching is carried out. Search conversation names and participants only for fast searching, or search message content also to find conversations containing search terms."/>

            <CheckBox x:Name="checkBoxShowMatchingSearchOnly" IsChecked="false" Margin="30,0,0,10" >
                <TextBlock x:Uid="TextBlockShowMatchingSearchOnly" Style="{ThemeResource BodyTextBlockStyle}" Text="XX Hide messages not matching search term."/>
            </CheckBox>

        </StackPanel>
    </Grid>
</Page>
