<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="StockPortfolio.SearchSymbol" FontSize="12" mc:Ignorable="d" d:DesignWidth="110" d:DesignHeight="67" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
	<UserControl.Resources>
		<LinearGradientBrush x:Key="BorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF707070" Offset="0.05" />
			<GradientStop Color="#FF898989" Offset="0.07" />
			<GradientStop Color="#FF8B8C93" Offset="1" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="FocusBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FFA9B9C5" Offset="0" />
			<GradientStop Color="#FF668499" Offset="0.325" />
			<GradientStop Color="#FF244E6D" Offset="0.325" />
			<GradientStop Color="#FF4F7189" Offset="1" />
		</LinearGradientBrush>
		<Style x:Key="FocusStyle" TargetType="Rectangle">
			<Setter Property="RadiusX" Value="1" />
			<Setter Property="RadiusY" Value="1" />
			<Setter Property="Opacity" Value="0" />
			<Setter Property="StrokeThickness" Value="2" />
			<Setter Property="Stroke" Value="{StaticResource FocusBorderBrush}" />
		</Style>
		<SolidColorBrush x:Key="Background" Color="White" />
		<LinearGradientBrush x:Key="FocusBorderBrush2" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#72FFFFFF" Offset="0" />
			<GradientStop Color="#14000000" Offset="0.325" />
			<GradientStop Color="#3F000000" Offset="0.325" />
			<GradientStop Color="#19000000" Offset="1" />
		</LinearGradientBrush>
		<ControlTemplate x:Key="C1Button" TargetType="ButtonBase">
			<Grid>
				<vsm:VisualStateManager.VisualStateGroups>
					<vsm:VisualStateGroup x:Name="CommonStates">
						<vsm:VisualStateGroup.Transitions>
							<vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
							<vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
						</vsm:VisualStateGroup.Transitions>
						<vsm:VisualState x:Name="Normal" />
						<vsm:VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
									<SplineDoubleKeyFrame KeyTime="0" Value="1" />
								</DoubleAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF" />
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF" />
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF" />
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</vsm:VisualState>
						<vsm:VisualState x:Name="Pressed">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
									<SplineDoubleKeyFrame KeyTime="0" Value="1" />
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
									<SplineDoubleKeyFrame KeyTime="0" Value="1" />
								</DoubleAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF" />
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF" />
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF" />
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF" />
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</vsm:VisualState>
						<vsm:VisualState x:Name="Disabled">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="0" Value="1" />
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</vsm:VisualState>
					</vsm:VisualStateGroup>
					<vsm:VisualStateGroup x:Name="FocusStates">
						<vsm:VisualState x:Name="Focused">
							<Storyboard>
								<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
									<DiscreteObjectKeyFrame KeyTime="0">
										<DiscreteObjectKeyFrame.Value>
											<Visibility>Visible</Visibility>
										</DiscreteObjectKeyFrame.Value>
									</DiscreteObjectKeyFrame>
								</ObjectAnimationUsingKeyFrames>
							</Storyboard>
						</vsm:VisualState>
						<vsm:VisualState x:Name="Unfocused" />
					</vsm:VisualStateGroup>
				</vsm:VisualStateManager.VisualStateGroups>
				<Border x:Name="Background" Background="{StaticResource MainBrushColor}" CornerRadius="3.5" />
				<Border x:Name="BackgroundBorder" BorderBrush="{StaticResource BorderBrush2}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
				<Border x:Name="BackgroundAnimation" Opacity="0" Background="{StaticResource MainBrushColor}" BorderBrush="{StaticResource BorderBrush2}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
				<Border Margin="1,1,1,1" x:Name="BackgroundGradient_Copy" BorderBrush="#FFFFFFFF" BorderThickness="1.2,1.2,1.2,1.2" CornerRadius="1.75" />
				<Border Margin="{TemplateBinding BorderThickness}" x:Name="BackgroundGradient" BorderThickness="1" CornerRadius="1.75">
					<Border.Background>
						<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
							<GradientStop Color="#FFFFFFFF" Offset="0" />
							<GradientStop Color="#F9FFFFFF" Offset="0.375" />
							<GradientStop Color="#E5FFFFFF" Offset="0.625" />
							<GradientStop Color="#C6FFFFFF" Offset="1" />
						</LinearGradientBrush>
					</Border.Background>
				</Border>
				<Border Margin="{TemplateBinding BorderThickness}" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" BorderBrush="{StaticResource MainBrushColor}" BorderThickness="1" CornerRadius="1.75" />
				<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
				<Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3" />
				<Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="{StaticResource MainBrushColor}" BorderThickness="1" CornerRadius="3" />
			</Grid>
		</ControlTemplate>
		<Style x:Key="C1DropDownStyle1" TargetType="c1:C1DropDown">
			<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
			<Setter Property="BorderThickness" Value="1" />
			<!--<Setter Property="FocusStyle" Value="{StaticResource FocusStyle}"/>-->
			<Setter Property="Background" Value="{StaticResource Background}" />
			<Setter Property="HeaderForeground" Value="#FF000000" />
			<Setter Property="HeaderFontSize" Value="11" />
			<Setter Property="HeaderFontFamily" Value="Trebuchet MS" />
            <Setter Property="HeaderPadding" Value="0" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="c1:C1DropDown">
						<Grid>
							<vsm:VisualStateManager.VisualStateGroups>
								<vsm:VisualStateGroup x:Name="DropDownOpenStates">
									<vsm:VisualState x:Name="Closed" />
									<vsm:VisualState x:Name="Opened" />
								</vsm:VisualStateGroup>
								<vsm:VisualStateGroup x:Name="CommonStates">
									<vsm:VisualState x:Name="Normal" />
									<vsm:VisualState x:Name="Disabled">
										<Storyboard />
									</vsm:VisualState>
									<vsm:VisualState x:Name="MouseOver" />
								</vsm:VisualStateGroup>
								<vsm:VisualStateGroup x:Name="FocusStates">
									<vsm:VisualStateGroup.Transitions>
										<vsm:VisualTransition GeneratedDuration="0:0:0.1" To="Focused" />
									</vsm:VisualStateGroup.Transitions>
									<vsm:VisualState x:Name="Unfocused" />
									<vsm:VisualState x:Name="Focused">
										<Storyboard />
									</vsm:VisualState>
								</vsm:VisualStateGroup>
							</vsm:VisualStateManager.VisualStateGroups>
							<Grid>
                                <ContentControl Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding HeaderFontFamily}" FontSize="{TemplateBinding HeaderFontSize}" FontStretch="{TemplateBinding HeaderFontStretch}" FontStyle="{TemplateBinding HeaderFontStyle}" FontWeight="{TemplateBinding HeaderFontWeight}" Foreground="{TemplateBinding HeaderForeground}" HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}" Padding="{TemplateBinding HeaderPadding}" VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}" />
								<ToggleButton HorizontalAlignment="Right" Content="ToggleButton" x:Name="ArrowToggle" Visibility="Collapsed" />
								<Popup x:Name="DropDownPopup" VerticalAlignment="Bottom">
									<ContentPresenter />
								</Popup>
							</Grid>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot">

        <c1:C1DropDown x:Name="searchSymbols" BorderThickness="0" ShowButton="False" DropDownDirection="ForceAbove" DropDownWidth="270" Background="#00FFFFFF" BorderBrush="#007F98A9" Style="{StaticResource C1DropDownStyle1}" HorizontalHeaderAlignment="Stretch" VerticalHeaderAlignment="Stretch">
			<c1:C1DropDown.Header>
				<c1:C1TextBoxBase x:Name="txtSymbol" TextWrapping="Wrap" TextChanged="txtSymbol_TextChanged" KeyDown="txtSymbol_KeyDown" LostFocus="txtSymbol_LostFocus" Watermark="symbol" Style="{StaticResource C1TextBoxBaseStyle1}" />
			</c1:C1DropDown.Header>	
			<Border BorderThickness="1" BorderBrush="#FF207A9C" Background="#FFEFF5FF">
				<!-- We do not use a Listbox because it swallows the clicks -->
				<ItemsControl x:Name="listBox" Margin="2 2 2 2" />
			</Border>
		</c1:C1DropDown>
		
	</Grid>
</UserControl>