<UserControl x:Class="NuGet.PackageManagement.UI.FilterLabel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:nuget="clr-namespace:NuGet.PackageManagement.UI"
             x:Name="_self"
             mc:Ignorable="d"
             d:DesignHeight="25" d:DesignWidth="100">
  <UserControl.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <nuget:SharedResources/>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </UserControl.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="auto" />
      <RowDefinition Height="auto" />
    </Grid.RowDefinitions>
    <Button
      Grid.Row="0"
      Click="ButtonClicked">
      <Button.Template>
        <ControlTemplate TargetType="{x:Type Button}">
          <ContentPresenter />
        </ControlTemplate>
      </Button.Template>
      <StackPanel Orientation="Horizontal">
        <TextBlock
          x:Name="_labelText"
          Padding="0"
          Margin="0"
          MouseEnter="_labelText_MouseEnter"
          MouseLeave="_labelText_MouseLeave"
          FontSize="{Binding FontSize,ElementName=_self,Converter={StaticResource Font122PercentSizeConverter}}"
          Foreground="{DynamicResource {x:Static nuget:Brushes.UIText}}"
          Text="Sample"/>

        <!-- the texblock that displays the count -->
        <Border
          x:Name="_textBlockCountContainer"
          CornerRadius="2"
          Margin="3,0"
          Padding="3,0"
          Visibility="{Binding Source={x:Static nuget:Domain.CollapsedWhenNotInDesignMode}}"
          HorizontalAlignment="Center"
          VerticalAlignment="Center"
          Background="{DynamicResource {x:Static nuget:Brushes.ContentSelectedBrushKey}}">
          <TextBlock
            x:Name="_textBlockCount"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            Foreground="{DynamicResource {x:Static nuget:Brushes.ContentSelectedTextBrushKey}}"/>
        </Border>
      </StackPanel>
    </Button>

    <!-- the line under the text to indicate that this label is selected -->
    <Rectangle
      x:Name="_underline"
      Grid.Row="1"
      Margin="0"
      Height="3"
      Visibility="{Binding Source={x:Static nuget:Domain.HiddenWhenNotInDesignMode}}"
      Fill="{DynamicResource {x:Static nuget:Brushes.ContentSelectedBrushKey}}"/>
  </Grid>
</UserControl>