<local:GenericPullRequestReviewAuthoringView x:Class="GitHub.VisualStudio.Views.GitHubPane.PullRequestReviewAuthoringView"
                                             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:ghfvs="https://github.com/github/VisualStudio"
                                             xmlns:cache="clr-namespace:GitHub.UI.Helpers;assembly=GitHub.UI"
                                             xmlns:local="clr-namespace:GitHub.VisualStudio.Views.GitHubPane"
                                             xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf"
                                             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                                             xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
                                             xmlns:c="clr-namespace:GitHub.VisualStudio.UI.Controls;assembly=GitHub.VisualStudio.UI"
                                             xmlns:models="clr-namespace:GitHub.Models;assembly=GitHub.App"
                                             xmlns:sampleData="clr-namespace:GitHub.SampleData;assembly=GitHub.App"
                                             xmlns:theming="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging"
                                             Background="{DynamicResource GitHubVsToolWindowBackground}"
                                             Foreground="{DynamicResource GitHubVsWindowText}"
                                             theming:ImageThemingUtilities.ImageBackgroundColor="{Binding RelativeSource={RelativeSource Self}, Path=Background.Color}"
                                             mc:Ignorable="d" d:DesignWidth="356" d:DesignHeight="800">
    <d:DesignProperties.DataContext>
        <sampleData:PullRequestReviewAuthoringViewModelDesigner/>
    </d:DesignProperties.DataContext>

    <Control.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
                <cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
                <cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
                <cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Styles/Markdown.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Control.Resources>

    <ScrollViewer>
        <StackPanel Margin="8,0">
            <TextBlock FontSize="16" Margin="0 4 0 0">
                <Run Text="{x:Static ghfvs:Resources.SubmitYourReviewFor}"/>
                <Hyperlink Command="{Binding NavigateToPullRequest}">
                    <Run>#</Run><Run Text="{Binding PullRequestModel.Number, Mode=OneWay}"/>
                </Hyperlink>
            </TextBlock>
            <TextBlock Foreground="{DynamicResource GitHubVsGrayText}" Text="{Binding PullRequestModel.Title}" TextWrapping="Wrap"/>
            <TextBlock Margin="0 12 0 4" Text="{x:Static ghfvs:Resources.YourReviewSummary}"/>
            
            <ui:AutoCompleteBox
                    Padding="0 4"
                    Margin="0 4"
                    Advisor="{Binding AutoCompleteAdvisor}">
                <ui:AutoCompleteBox.ItemTemplate>
                    <DataTemplate>
                        <ui:AutoCompleteSuggestionView ViewModel="{Binding}" />
                    </DataTemplate>
                </ui:AutoCompleteBox.ItemTemplate>
                <ui:AutoCompleteBox.InputElement>
                    <ui:TextBoxAutoCompleteTextInput>
                        <TextBox AcceptsReturn="True"
                                 Background="{DynamicResource VsBrush.BrandedUIBackground}"
                                 Foreground="{DynamicResource VsBrush.BrandedUIText}"
                                 BorderBrush="{DynamicResource VsBrush.ActiveBorder}"
                                 MinHeight="120"
                                 TextWrapping="Wrap"
                                 Text="{Binding Body}"
                                 SpellCheck.IsEnabled="True"/>
                    </ui:TextBoxAutoCompleteTextInput>
                </ui:AutoCompleteBox.InputElement>
            </ui:AutoCompleteBox>

            <StackPanel Margin="0 4" Orientation="Horizontal">
                <ui:DropDownButton AutoCloseOnClick="True" Foreground="{DynamicResource GHBlueLinkButtonTextBrush}">
                    <ui:GitHubActionLink>Submit review</ui:GitHubActionLink>
                    <ui:DropDownButton.DropDownContent>
                        <Border Background="{DynamicResource GitHubVsToolWindowBackground}"
                                BorderBrush="{DynamicResource GitHubComboBoxBorderBrush}"
                                BorderThickness="1"
                                Padding="4">
                            <StackPanel Background="{DynamicResource GitHubVsToolWindowBackground}">
                                <ui:GitHubActionLink Command="{Binding Comment}" Margin="4" Content="{x:Static ghfvs:Resources.CommentOnly}"/>
                                <ui:GitHubActionLink Command="{Binding Approve}"
                                                     Visibility="{Binding CanApproveRequestChanges, Converter={ui:BooleanToVisibilityConverter}}"
                                                     Margin="4" Content="{x:Static ghfvs:Resources.Approve}"/>
                                <ui:GitHubActionLink Command="{Binding RequestChanges}"
                                                     Visibility="{Binding CanApproveRequestChanges, Converter={ui:BooleanToVisibilityConverter}}"
                                                     Margin="4" Content="{x:Static ghfvs:Resources.RequestChanges}"/>
                            </StackPanel>
                        </Border>
                    </ui:DropDownButton.DropDownContent>
                </ui:DropDownButton>
                <Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Width="1" Height="16" Margin="4 0"/>
                <ui:GitHubActionLink Command="{Binding Cancel}" VerticalAlignment="Center" Content="{x:Static ghfvs:Resources.CancelLink}"/>
            </StackPanel>

            <TextBox Grid.Column="0"
                     Grid.ColumnSpan="3"
                     Grid.Row="2"
                     Foreground="Red" 
                     Margin="0 2 0 0"
                     Text="{Binding OperationError, Mode=OneWay}"
                     VerticalAlignment="Center"
                     TextWrapping="Wrap"
                     Style="{StaticResource FlatReadOnlyTextBox}"
                     Visibility="{Binding OperationError, Converter={ui:NullToVisibilityConverter}}"/>

            <TabControl Margin="0 16 0 0" Style="{DynamicResource GitHubPRDetailsTabControl}">
                <TabItem Header="{Binding Files.ChangedFilesCount}"
                         HeaderStringFormat="Files changed ({0})"
                         Style="{DynamicResource GitHubPRDetailsTabItem}">
                    <local:PullRequestFilesView DataContext="{Binding Files}"/>
                </TabItem>
                <TabItem Header="{Binding FileComments.Count}"
                         HeaderStringFormat="Your file comments ({0})"
                         Style="{DynamicResource GitHubPRDetailsTabItem}">
                    <local:PullRequestFileCommentsView DataContext="{Binding FileComments}"/>
                </TabItem>
            </TabControl>
        </StackPanel>
    </ScrollViewer>

</local:GenericPullRequestReviewAuthoringView>
