﻿<common:PageBase
    x:Name="pageRoot"
    x:Class="FeedbackApp.UIF.Views.StartUpPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FeedbackApp.UIF.Views"
    xmlns:common="using:FeedbackApp.Common"
    xmlns:conv="using:FeedbackApp.Converters"    
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <common:PageBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="UIFStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Default">
                    <SolidColorBrush x:Key="BlueTitle" Color="#0078d7"/>
                    <SolidColorBrush x:Key="MainBG" Color="White"/>
                    <SolidColorBrush x:Key="SubmitBoxBG" Color="#C4C4C4"/>
                    <SolidColorBrush x:Key="ArrowStroke" Color="White"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="HighContrast">
                    <SolidColorBrush x:Key="BlueTitle" Color="{ThemeResource SystemColorWindowTextColor}"/>
                    <SolidColorBrush x:Key="MainBG" Color="{ThemeResource SystemColorWindowColor}"/>
                    <SolidColorBrush x:Key="SubmitBoxBG" Color="{ThemeResource SystemColorWindowColor}"/>
                    <SolidColorBrush x:Key="ArrowStroke" Color="{ThemeResource SystemColorWindowColor}"/>
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>

            <Style x:Key="DialogTitle" TargetType="TextBlock" BasedOn="{StaticResource PageHeaderPrefixText}">
                <Setter Property="Foreground" Value="{ThemeResource BlueTitle}"/>
                <Setter Property="FontSize" Value="34"/>
            </Style>

            <Style x:Key="SentenceStyle" TargetType="TextBlock">
                <Setter Property="Foreground" Value="{ThemeResource BlackTextColor}"/>
                <Setter Property="FontSize" Value="13"/>
            </Style>

            <conv:ReverseEnumToVisibilityConverter x:Key="ReverseEnumToVisibilityConverter"/>
            <conv:EnumToVisibilityConverter x:Key="EnumToVisibilityConverter"/>
            <conv:LoadingStateToBooleanConverter x:Key="LoadingStateToBooleanConverter"/>
            <conv:LoadingStateToVisibilityConverter x:Key="LoadingStateToVisibilityConverter"/>
            <conv:RelativeTimeConverter x:Key="RelativeTimeConverter" />


        </ResourceDictionary>
    </common:PageBase.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Background="{ThemeResource GrayBG}">
        
        <!-- Please Connect -->
        <StackPanel Width="480" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding DialogToShow, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Microsoft.Windows.Internal.Feedback.DialogType.InternetConnection}">
            <Border BorderThickness="1, 1, 1, 0" BorderBrush="#C4C4C4">
                <StackPanel Background="{ThemeResource MainBG}" MinHeight="350">
                    <StackPanel Margin="40, 20">
                        <TextBlock Style="{StaticResource DialogTitle}" Text="Please connect" x:Uid="/FeedbackApp.Resources/UIF_ConnectDialog_Title" TextWrapping="WrapWholeWords"/>
                        
                        <TextBlock Style="{StaticResource SentenceStyle}"  x:Uid="/FeedbackApp.Resources/UIF_ConnectDialog_Sentence"
                               Margin="0, 20, 0, 0" TextWrapping="WrapWholeWords"/>
                    </StackPanel>

                </StackPanel>
            </Border>
            <Border BorderThickness="1, 0, 1, 1" BorderBrush="#C4C4C4">
                <Grid Background="{ThemeResource SubmitBoxBG}" Height="80">
                    <Polygon Points="0,0 15,15, 30,0" Stroke="{ThemeResource ArrowStroke}" Fill="{ThemeResource ArrowStroke}" HorizontalAlignment="Center"/>
                    <Button  x:Uid="/FeedbackApp.Resources/UIF_Dialog_RefreshButton" HorizontalAlignment="Center" VerticalAlignment="Center" 
                            Command="{Binding RunCheckCommand}"
        					 Margin="0" Content="Button" MinWidth="100" Width="Auto" Style="{StaticResource UIFButton}" MinHeight="40"/>

                </Grid>
            </Border>
        </StackPanel>

        <!-- Build too old -->
        <StackPanel Width="480" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding DialogToShow, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Microsoft.Windows.Internal.Feedback.DialogType.OldBuild}">
            <Border BorderThickness="1, 1, 1, 0" BorderBrush="#C4C4C4">
                <StackPanel Background="{ThemeResource MainBG}" MinHeight="350">
                    <StackPanel Margin="40, 20">
                        <TextBlock Style="{StaticResource DialogTitle}" x:Uid="/FeedbackApp.Resources/UIF_UpgradeDialog_Title" Text="Thanks for helping" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_UpgradeDialog_Sentence"  Text="Sentence 1" Margin="0, 20, 0, 0" TextWrapping="WrapWholeWords"/>
                        
                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_PrivacyStatement"  Text="Privacy sentence" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"/>
                    </StackPanel>

                </StackPanel>
            </Border>
            <Border BorderThickness="1, 0, 1, 1" BorderBrush="#C4C4C4">
                <Grid Background="{ThemeResource SubmitBoxBG}" Height="80">
                    <Polygon Points="0,0 15,15, 30,0" Stroke="{ThemeResource ArrowStroke}" Fill="{ThemeResource ArrowStroke}" HorizontalAlignment="Center"/>
                    <Button  x:Uid="/FeedbackApp.Resources/UIF_Dialog_OkButton" HorizontalAlignment="Center" VerticalAlignment="Center" 
                             Command="{Binding OfflineCommand}"
        					 Margin="0" Content="Button" MinWidth="100" Width="Auto" Style="{StaticResource UIFButton}" MinHeight="40"/>
                </Grid>
            </Border>
        </StackPanel>

        <!-- Asking for Privacy Change -->
        <StackPanel Width="480" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding DialogToShow, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Microsoft.Windows.Internal.Feedback.DialogType.Privacy}">
            <Border BorderThickness="1, 1, 1, 0" BorderBrush="#C4C4C4">
                <StackPanel Background="{ThemeResource MainBG}" MinHeight="350">
                    <StackPanel Margin="40, 20">
                        <TextBlock Style="{StaticResource DialogTitle}" x:Uid="/FeedbackApp.Resources/UIF_PrivacyDialog_Title" Text="Allow feedback" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_PrivacyDialog_AdjustPrivacySettings"  Text="Sentence 1" Margin="0, 20, 0, 0" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_PrivacyDialog_ChangePrivacySettings"  Text="Sentence 2" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_PrivacyDialog_LevelFour"  Text="Permission level 4" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"
                                   Visibility="{Binding IsInsider, Converter={StaticResource BooleanToVisibilityConverter}}"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_PrivacyDialog_LevelThree"  Text="Permission level 3" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"
                                   Visibility="{Binding IsInsider, Converter={StaticResource ReverseBooleanToVisibilityConverter}}"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_PrivacyDialog_SecondSentence"  Text="Sentence 2" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"/>
                    </StackPanel>

                </StackPanel>
            </Border>
            <Border BorderThickness="1, 0, 1, 1" BorderBrush="#C4C4C4">
                <Grid Background="{ThemeResource SubmitBoxBG}" Height="80">
                    <Polygon Points="0,0 15,15, 30,0" Stroke="{ThemeResource ArrowStroke}" Fill="{ThemeResource ArrowStroke}" HorizontalAlignment="Center"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
                        <Button  x:Uid="/FeedbackApp.Resources/UIF_Dialog_SettingsButton"
                                 Command="{Binding LaunchSettingsCommand}"
        					 Margin="0, 0, 0, 0" Content="Button" MinWidth="100" Width="Auto" Style="{StaticResource UIFButton}" MinHeight="40"/>
                        <Button  x:Uid="/FeedbackApp.Resources/UIF_Dialog_NoThanksButton" 
                                 Command="{Binding ExitCommand}"
        					 Margin="10, 0, 0, 0" Content="Button" MinWidth="100" Width="Auto" Style="{StaticResource UIFButton}" MinHeight="40"/>
                    </StackPanel>
                    
                </Grid>
            </Border>
        </StackPanel>

        <!-- Privacy change fail -->
        <StackPanel Width="480" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed">
            <Border BorderThickness="1, 1, 1, 0" BorderBrush="#C4C4C4">
                <StackPanel Background="{ThemeResource MainBG}" MinHeight="350">
                    <StackPanel Margin="40, 20">
                        <TextBlock Style="{StaticResource DialogTitle}" x:Uid="/FeedbackApp.Resources/UIF_FeedbackNotAllowedDialog_Title" Text="Title" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_FeedbackNotAllowedDialog_Sentence"  Text="Sentence 1" Margin="0, 20, 0, 0" TextWrapping="WrapWholeWords"/>
                    </StackPanel>

                </StackPanel>
            </Border>
            <Border BorderThickness="1, 0, 1, 1" BorderBrush="#C4C4C4">
                <Grid Background="{ThemeResource SubmitBoxBG}" Height="80">
                    <Polygon Points="0,0 15,15, 30,0" Stroke="{ThemeResource ArrowStroke}" Fill="{ThemeResource ArrowStroke}" HorizontalAlignment="Center"/>
                    <Button  x:Uid="/FeedbackApp.Resources/UIF_Dialog_OkButton" HorizontalAlignment="Center" VerticalAlignment="Center" 
        					 Margin="0" Content="Button" MinWidth="100" Width="Auto" Style="{StaticResource UIFButton}" MinHeight="40"/>
                </Grid>
            </Border>
        </StackPanel>

        <!-- Welcome -->
        <StackPanel Width="480" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding DialogToShow, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Microsoft.Windows.Internal.Feedback.DialogType.Welcome}">
            <Border BorderThickness="1, 1, 1, 0" BorderBrush="#C4C4C4">
                <StackPanel Background="{ThemeResource MainBG}" MinHeight="350">
                    <StackPanel Margin="40, 20">
                        <TextBlock Style="{StaticResource DialogTitle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_Welcome" Text="Welcome" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_IntroSentence"  Text="Sentence 1" Margin="0, 20, 0, 0" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_FirstInfoPoint"  Text="Bullet 1" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"/>
                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_SecondInfoPoint"  Text="Bullet 2" TextWrapping="WrapWholeWords"/>
                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_ThirdInfoPoint"  Text="Bullet 2" TextWrapping="WrapWholeWords"/>

                        <TextBlock Style="{StaticResource SentenceStyle}" x:Uid="/FeedbackApp.Resources/UIF_WelcomeDialog_PrivacyStatement"  Text="Privacy sentence" Margin="0, 16, 0, 0" TextWrapping="WrapWholeWords"/>
                    </StackPanel>

                </StackPanel>
            </Border>
            <Border BorderThickness="1, 0, 1, 1" BorderBrush="#C4C4C4">
                <Grid Background="{ThemeResource SubmitBoxBG}" Height="80">
                    <Polygon Points="0,0 15,15, 30,0" Stroke="{ThemeResource ArrowStroke}" Fill="{ThemeResource ArrowStroke}" HorizontalAlignment="Center"/>
                    <Button  x:Uid="/FeedbackApp.Resources/UIF_Dialog_OkButton" HorizontalAlignment="Center" VerticalAlignment="Center" 
                             Command="{Binding NavigateToSearchPageCommand}"
        					 Margin="0" Content="Button" MinWidth="100" Width="Auto" Style="{StaticResource UIFButton}" MinHeight="40"/>
                </Grid>
            </Border>
        </StackPanel>

    </Grid>
</common:PageBase>

