<UserControl x:Class="GitHub.VisualStudio.UI.OptionsControl"
             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:local="clr-namespace:GitHub.VisualStudio.UI"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DesignHeight="200"
             mc:Ignorable="d">
  <UserControl.Resources>
    <BorderGapMaskConverter x:Key="BorderGapMaskConverter" />
    <Style x:Key="GroupBoxFlat" TargetType="{x:Type GroupBox}">
      <Setter Property="BorderBrush" Value="#D5DFE5" />
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type GroupBox}">
            <Grid SnapsToDevicePixels="true">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="6" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="6" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="6" />
              </Grid.RowDefinitions>
              <Border x:Name="Header"
                      Grid.Row="0"
                      Grid.RowSpan="2"
                      Grid.Column="1"
                      Padding="3,1,3,0">
                <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
              </Border>
              <Border Grid.Row="1"
                      Grid.RowSpan="3"
                      Grid.ColumnSpan="4"
                      BorderBrush="Transparent"
                      BorderThickness="{TemplateBinding BorderThickness}"
                      CornerRadius="4">
                <Border.OpacityMask>
                  <MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
                    <Binding ElementName="Header" Path="ActualWidth" />
                    <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
                    <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
                  </MultiBinding>
                </Border.OpacityMask>
                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
              </Border>
              <ContentPresenter Grid.Row="2"
                                Grid.Column="1"
                                Grid.ColumnSpan="2"
                                Margin="{TemplateBinding Padding}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </UserControl.Resources>
  <StackPanel>
    <GroupBox
            Margin="8,0,8,0"
            VerticalAlignment="Top"
            BorderBrush="LightGray"
            BorderThickness="1"
            Padding="6 8 6 8"
            Style="{DynamicResource GroupBoxFlat}">
      <GroupBox.Header>
        <Run Text="{x:Static ghfvs:Resources.Options_PrivacyTitle}" />
      </GroupBox.Header>
      <DockPanel>
        <WrapPanel DockPanel.Dock="Top">
          <CheckBox x:Name="chkMetrics" VerticalAlignment="Center" Content="{x:Static ghfvs:Resources.Options_MetricsLabel}" />
        </WrapPanel>
        <TextBlock>
        <Hyperlink ToolTip="https://visualstudio.github.com/samples.html" NavigateUri="https://visualstudio.github.com/samples.html" RequestNavigate="Hyperlink_RequestNavigate"><TextBlock Text="{x:Static ghfvs:Resources.learnMoreLink}"/></Hyperlink>
      </TextBlock>
      </DockPanel>
    </GroupBox>
    <GroupBox
            Margin="8,0,8,0"
            VerticalAlignment="Top"
            BorderBrush="LightGray"
            BorderThickness="1"
            Padding="6 8 6 8"
            Style="{DynamicResource GroupBoxFlat}">
      <GroupBox.Header>
            <Run Text="{x:Static ghfvs:Resources.Options_DebuggingTitle}" />
      </GroupBox.Header>
      <DockPanel>
        <CheckBox x:Name="chkEnableTraceLogging" VerticalAlignment="Center" Content="{x:Static ghfvs:Resources.Options_EnableTraceLoggingText}" />
      </DockPanel>
    </GroupBox>
  </StackPanel>
</UserControl>
