<Grid
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:reader="using:Windows.Reader.Controls"
    xmlns:mreader="using:Reader.Controls"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="Auto" MaxHeight="670" Width="323" Name="FindResultsPane" x:Uid="Layout">
	<Grid.Resources>
		<ResourceDictionary>
			<ResourceDictionary.ThemeDictionaries>
				<ResourceDictionary x:Key="Default">
					<!-- Default theme resources -->
					<SolidColorBrush x:Key="FocusVisualWhiteStrokeBrush" Color="White"/>
					<SolidColorBrush x:Key="FocusVisualBlackStrokeBrush" Color="Black"/>
					<SolidColorBrush x:Key="ReaderListBoxItemPointerOverBrush" Color="#FFDEDEDE"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentBrush" Color="#FFD24726"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentPointerOverBrush" Color="#FFDEDEDE"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentSelectedBrush" Color="#F8E4DF"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentTextBrush" Color="Black"/>
					<SolidColorBrush x:Key="ReaderListBoxItemPressedBrush" Color="#FF212121"/>
					<SolidColorBrush x:Key="ReaderFlyoutBorderStrokeBrush" Color="#FF2A2A2A"/>
					<SolidColorBrush x:Key="ReaderFlyoutBorderFillBrush" Color="White"/>
					<SolidColorBrush x:Key="ReaderLabelBoxStrokeBrush" Color="#3D2A2A2A"/>
					<SolidColorBrush x:Key="ReaderLabelBoxFillBrush" Color="Transparent"/>
					<SolidColorBrush x:Key="ReaderLabelBoxTextBrush" Color="#FF2A2A2A"/>
				</ResourceDictionary>
				<ResourceDictionary x:Key="HighContrast">
					<!-- High Contrast theme resources -->
					<SolidColorBrush x:Key="FocusVisualWhiteStrokeBrush" Color="White"/>
					<SolidColorBrush x:Key="FocusVisualBlackStrokeBrush" Color="Black"/>
					<SolidColorBrush x:Key="ReaderListBoxItemPointerOverBrush" Color="{StaticResource SystemColorHighlightColor}"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentBrush" Color="#FFD24726"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentPointerOverBrush" Color="{StaticResource SystemColorHighlightColor}"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentSelectedBrush" Color="{StaticResource SystemColorHighlightColor}"/>
					<SolidColorBrush x:Key="ReaderListBoxItemAccentTextBrush" Color="{StaticResource SystemColorHighlightTextColor}"/>
					<SolidColorBrush x:Key="ReaderListBoxItemPressedBrush" Color="{StaticResource SystemColorHighlightColor}"/>
					<SolidColorBrush x:Key="ReaderFlyoutBorderStrokeBrush" Color="{StaticResource SystemColorHighlightColor}"/>
					<SolidColorBrush x:Key="ReaderFlyoutBorderFillBrush" Color="{StaticResource SystemColorWindowColor}"/>
					<SolidColorBrush x:Key="ReaderLabelBoxStrokeBrush" Color="{StaticResource SystemColorWindowTextColor}"/>
					<SolidColorBrush x:Key="ReaderLabelBoxFillBrush" Color="{StaticResource SystemColorWindowColor}"/>
					<SolidColorBrush x:Key="ReaderLabelBoxTextBrush" Color="{StaticResource SystemColorWindowTextColor}"/>
				</ResourceDictionary>
			</ResourceDictionary.ThemeDictionaries>
		</ResourceDictionary>

		<!-- Find results pane style -->
		<Style x:Key="FlyoutPaneStyle" TargetType="ListBox">
			<Setter Property="Padding" Value="0,5,0,5"/>
			<Setter Property="BorderThickness" Value="0"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
			<Setter Property="ItemContainerTransitions">
				<Setter.Value>
					<TransitionCollection>
						<ContentThemeTransition />
					</TransitionCollection>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Find results item style -->
		<Style x:Key="FlyoutListBoxItem" TargetType="ListBoxItem">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="BorderThickness" Value="0"/>
			<Setter Property="HorizontalContentAlignment" Value="Left"/>
			<Setter Property="VerticalContentAlignment" Value="Top"/>
			<Setter Property="TabNavigation" Value="Local"/>
			<Setter Property="Padding" Value="5,0,11,0"/>
			<Setter Property="MinHeight" Value="40"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ListBoxItem">
						<Grid Background="{TemplateBinding Background}" x:Name="ContentGrid">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="PointerOver">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderListBoxItemAccentTextBrush}" />
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<PointerDownThemeAnimation TargetName="ContentGrid" />
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="SelectionStates">
									<VisualState x:Name="Unselected"/>
									<VisualState x:Name="Selected">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedVisual"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderListBoxItemAccentTextBrush}" />
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="SelectedUnfocused">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedVisual"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderListBoxItemAccentTextBrush}" />
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="SelectedPointerOver">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedVisual"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedVisual" Storyboard.TargetProperty="Fill">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderListBoxItemAccentPointerOverBrush}" />
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="SelectedPressed"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite" />
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unfocused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Rectangle x:Name="MouseOverVisual" Fill="{StaticResource ReaderListBoxItemPointerOverBrush}" IsHitTestVisible="False" Opacity="0" StrokeThickness="0"/>
							<Rectangle x:Name="SelectedVisual" Fill="{StaticResource ReaderListBoxItemAccentSelectedBrush}" IsHitTestVisible="False" Opacity="0" StrokeThickness="0"/>
							<Rectangle x:Name="PressedVisual" Fill="{StaticResource ReaderListBoxItemPressedBrush}" IsHitTestVisible="False" Opacity="0" StrokeThickness="0"/>
							<ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" VerticalAlignment="Center"/>
							<Rectangle x:Name="FocusVisualWhite" Stroke="{StaticResource FocusVisualWhiteStrokeBrush}" Margin="0" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset=".5"/>
							<Rectangle x:Name="FocusVisualBlack" Stroke="{StaticResource FocusVisualBlackStrokeBrush}" Margin="0" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="1.5"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Page number label box, used in Find results pane -->
		<Style x:Key="PageNoBox" TargetType="ToggleButton">
			<Setter Property="MinWidth" Value="35"/>
			<Setter Property="MinHeight" Value="35"/>
			<Setter Property="Foreground" Value="{StaticResource ReaderLabelBoxTextBrush}"/>
			<Setter Property="Padding" Value="5,3,5,3"/>
			<Setter Property="HorizontalAlignment" Value="Left"/>
			<Setter Property="VerticalAlignment" Value="Stretch"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ToggleButton">
						<Grid Background="{StaticResource ReaderLabelBoxFillBrush}">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="CheckedDisabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="CheckedBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Thickness>0,35,0,0</Thickness>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<DoubleAnimation Duration="0" To="65" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="CheckedBorder"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="CheckedBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Thickness>0,0,0,0</Thickness>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="CheckedBorder" Height="80" BorderBrush="{StaticResource ReaderLabelBoxStrokeBrush}" BorderThickness="0,0,1,0" Background="Transparent">
								<ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" FontSize="14.667" FontFamily="{StaticResource ContentControlThemeFontFamily}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-3,5,0" />
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Grid.Resources>

	<Border BorderThickness="2" Background="{StaticResource ReaderFlyoutBorderFillBrush}" BorderBrush="{StaticResource ReaderFlyoutBorderStrokeBrush}">
		<mreader:ReaderAccList x:Name="FindResultsPane" IsTabStop="True" AutomationProperties.Name="FindResults" Style="{StaticResource ResourceKey=FlyoutPaneStyle}" ItemContainerStyle="{StaticResource FlyoutListBoxItem}" ItemsSource="{Binding}">
			<mreader:ReaderAccList.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal" Margin="0">
						<ToggleButton x:Name="PageNoToggle" Content="{Binding PageNo}" Style="{StaticResource PageNoBox}" IsEnabled="False" IsTabStop="False" IsChecked="{Binding IsFirstResultInPage}"/>
						<TextBlock MaxHeight="60"  MaxWidth="245" FontFamily="{StaticResource ContentControlThemeFontFamily}" FontWeight="SemiLight" FontSize="14.667" TextWrapping="Wrap" CharacterSpacing="20" TextTrimming="WordEllipsis" Margin="10,13,0,7" LineStackingStrategy="BlockLineHeight" LineHeight="20" VerticalAlignment="Bottom">
							<Run Text="{Binding ContextTillQuery}" /><Run Text="{Binding Query}" Foreground="{StaticResource ReaderListBoxItemAccentBrush}" /><Run Text="{Binding ContextPostQuery}"/>
						</TextBlock>
					</StackPanel>
				</DataTemplate>
			</mreader:ReaderAccList.ItemTemplate>
		</mreader:ReaderAccList>
	</Border>
</Grid>