<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary mc:Ignorable="d" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ControlExplorer" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

    <Style TargetType="local:SearchControl">
        <Setter Property="Height" Value="25" />
        <Setter Property="ScrollViewerStyle" Value="{StaticResource GralScrollViewer}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SearchControl">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Width="{TemplateBinding Width}">
                        <c1:C1DropDown x:Name="DropDown" Height="{TemplateBinding Height}" CornerRadius="0" BorderThickness="0" VerticalAlignment="Top" ShowButton="False" IsDropDownOpen="{Binding ShowSearchList, Mode=TwoWay}" AutoClose="True" HeaderFontFamily="Segoe WP SemiLight" HeaderFontSize="12" HeaderForeground="#FFABABAB" Background="White" HeaderBackground="White" Padding="0">
                            <c1:C1DropDown.Header>
                                <c1:C1TextBoxBase Padding="5 0 25 3" VerticalContentAlignment="Bottom" CornerRadius="0" BorderThickness="0" Watermark="Search control" C1Text="{Binding SearchCriteria, Mode=TwoWay}" />
                            </c1:C1DropDown.Header>
                            <Border Background="#FFF1F5F6" BorderBrush="#FFBBBBBB" BorderThickness="1" Width="{TemplateBinding Width}">
                            <c1:C1TreeView x:Name="TreeView" ItemsSource="{Binding SearchList}" MaxHeight="402" Padding="0" Background="#FFF1F5F6" BorderBrush="#FFAACDDA" BorderThickness="0">
                            	<c1:C1TreeView.MouseOverBrush>
                            		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            			<GradientStop Color="#4C9EBCC4" />
                            		</LinearGradientBrush>
                            	</c1:C1TreeView.MouseOverBrush>
                                    <c1:C1TreeView.Template>
                                        <ControlTemplate TargetType="c1:C1TreeView">
                                            <Grid x:Name="Root">
                                                 <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding Background}" />
                                                   <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                                                    <Grid>
                                                        <ScrollViewer x:Name="Scroll" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" IsTabStop="False" BorderThickness="0" Padding="{TemplateBinding Padding}" Style="{StaticResource GralScrollViewer}" c1:ClearStyleExtensions.ScrollBarStyle="{Binding Path=ScrollBarStyle,RelativeSource={RelativeSource TemplatedParent}}">
                                                            <ItemsPresenter />
                                                        </ScrollViewer>
                                                    </Grid>
                                                </Border>
                                            </Grid>
                                        </ControlTemplate>
                                    </c1:C1TreeView.Template>
                                <c1:C1TreeView.ItemContainerStyleSelector>
                                    <local:HierarchicalStyleSelector>
                                        <local:HierarchicalStyleSelector.FirstLevelStyle>
                                            <Style TargetType="c1:C1TreeViewItem">
                                                <Setter Property="IsExpanded" Value="True" />
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="c1:C1TreeViewItem">
                                                            <Grid x:Name="HeaderPanelContainer">
                                                                <VisualStateManager.VisualStateGroups>
                                                                    <VisualStateGroup x:Name="CommonStates">
                                                                        <VisualState x:Name="Normal" />
                                                                        <VisualState x:Name="Disabled">
                                                                        </VisualState>
                                                                        <VisualState x:Name="MouseOver">
                                                                        </VisualState>
                                                                    </VisualStateGroup>
                                                                    <VisualStateGroup x:Name="SelectedStates">
                                                                        <VisualState x:Name="Selected">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Visible</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                        <VisualState x:Name="Unselected" />
                                                                    </VisualStateGroup>
                                                                    <VisualStateGroup x:Name="ExpandedStates">
                                                                        <VisualState x:Name="Expanded">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ChildrenPanel" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Visible</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                        <VisualState x:Name="Collapsed">
                                                                            <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ChildrenPanel" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Collapsed</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                    </VisualStateGroup>
                                                                </VisualStateManager.VisualStateGroups>
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition Width="Auto" />
                                                                    <ColumnDefinition />
                                                                </Grid.ColumnDefinitions>
                                                                <Grid.RowDefinitions>
                                                                    <RowDefinition Height="Auto" />
                                                                    <RowDefinition />
                                                                    <RowDefinition Height="Auto" />
                                                                </Grid.RowDefinitions>
                                                                <Grid Visibility="Collapsed">
                                                                    <ToggleButton x:Name="ExpandButton" IsThreeState="False" Margin="0" Visibility="Collapsed" />
                                                                </Grid>
                                                                <HyperlinkButton ContentTemplate="{Binding Control.IconSearch}" Padding="0" NavigateUri="{Binding Control.Link}" Width="27" Height="27" Margin="5" VerticalAlignment="Top" Grid.RowSpan="2" />
                                                                <Grid x:Name="HeaderPanel" Grid.Column="1">
                                                                    <Grid Visibility="Collapsed">
                                                                        <ContentControl x:Name="Header" />
                                                                        <ContentControl x:Name="HeaderEditor" />
                                                                    </Grid>
                                                                    <Border x:Name="SelectedElement" Background="{TemplateBinding SelectedBackground}" BorderThickness="0" Visibility="Collapsed" />
                                                                    <HyperlinkButton Style="{StaticResource SearchControlText}" Content="{Binding Control.Name}" NavigateUri="{Binding Control.Link}" Grid.Column="1" Margin="0 4" />
                                                                </Grid>
                                                                <ItemsPresenter x:Name="ChildrenPanel" Grid.Row="1" Grid.Column="1" />
                                                                <Line Grid.Row="2" Grid.ColumnSpan="2" Margin="0 5 0 0" X1="0" Y1="1" X2="240" Y2="1" Stroke="#FFAFAFAF" StrokeDashArray="1 2" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                                            </Grid>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </local:HierarchicalStyleSelector.FirstLevelStyle>
                                    </local:HierarchicalStyleSelector>
                                </c1:C1TreeView.ItemContainerStyleSelector>
                                <c1:C1TreeView.ItemTemplateSelector>
                                    <local:HierarchicalTemplateSelector>
                                        <local:HierarchicalTemplateSelector.FirstLevelTemplate>
                                            <c1:C1HierarchicalDataTemplate ItemsSource="{Binding Features}">
                                                <HyperlinkButton Style="{StaticResource SearchControlText}" Content="{Binding Control.Name}" NavigateUri="{Binding Control.Link}" />
                                            </c1:C1HierarchicalDataTemplate>
                                        </local:HierarchicalTemplateSelector.FirstLevelTemplate>
                                        <local:HierarchicalTemplateSelector.SecondLevelTemplate>
                                            <DataTemplate>
                                                <HyperlinkButton Style="{StaticResource SearchSampleText}" NavigateUri="{Binding Link}" Content="{Binding Name}" />
                                            </DataTemplate>
                                        </local:HierarchicalTemplateSelector.SecondLevelTemplate>
                                    </local:HierarchicalTemplateSelector>
                                </c1:C1TreeView.ItemTemplateSelector>
                            </c1:C1TreeView>
							</Border>
                        </c1:C1DropDown>
                        <!--Search Icon-->
                        <Button x:Name="Button" Style="{StaticResource EmptyButton}" HorizontalAlignment="Right">
                            <Path Data="M7.999999,2.9999998 C5.2385755,3 2.9999995,5.2385759 2.9999995,7.9999995 C2.9999995,10.761423 5.2385755,12.999999 7.999999,12.999999 C10.761423,12.999999 12.999999,10.761423 12.999999,7.9999995 C12.999999,5.2385759 10.761423,3 7.999999,2.9999998 z M8,0 C12.418278,-5.7194569E-08 16,3.581722 16,8 C16,9.2426405 15.716681,10.419108 15.211113,11.46833 L15.193604,11.503564 L15.257729,11.564526 L18.793262,15.10006 C19.574312,15.881108 19.574312,17.147438 18.793262,17.928488 L18.086157,18.635593 C17.305107,19.416643 16.038778,19.416643 15.257729,18.635593 L11.722195,15.10006 L11.711077,15.088365 L11.642013,15.124804 C10.549623,15.684326 9.311676,16 8,16 C3.581722,16 0,12.418278 0,8 C0,3.581722 3.581722,-5.7194569E-08 8,0 z" Fill="#FFABABAB" HorizontalAlignment="Right" Margin="0,3,3,3" Stretch="Fill" UseLayoutRounding="False" Width="19" Height="19" />
                        </Button>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="local:PageFrame">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PageFrame">
                    <Grid>
                        <Grid.Resources>
                            <Storyboard x:Name="LoadStoryboard">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="Header">
                             <!--       <EasingDoubleKeyFrame KeyTime="0" Value="0.041"/>-->
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="Header">
                    <!--                <EasingDoubleKeyFrame KeyTime="0" Value="-23.5"/>-->
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hyperlinkButton">
                                    <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ControlsPage">
                                    <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0" />
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Search">
                                    <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0" />
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Header">
                                	<EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                	<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="10" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Grid.Resources>
                         <Border Grid.Column="1" Grid.Row="1" Margin="-5" BorderBrush="#02000000" BorderThickness="1" CornerRadius="4">
                            <Border BorderBrush="#0A000000" BorderThickness="1" CornerRadius="3">
                                <Border BorderBrush="#14000000" BorderThickness="1" CornerRadius="2">
                                    <Border BorderBrush="#1E000000" BorderThickness="1" CornerRadius="1">
                                        <Border BorderBrush="#26000000" BorderThickness="1">
                                            <Border>
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                        <GradientStop Color="#B2FFFFFF" Offset="0" />
                                                        <GradientStop Color="#99FFFFFF" Offset="0.07" />
                                                        <GradientStop Color="#99FFFFFF" Offset="0.93" />
                                                        <GradientStop Color="#B2FFFFFF" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                        </Border>
                                    </Border>
                                </Border>
                            </Border>
                        </Border>

                        <Grid x:Name="LayoutRoot">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <!--Header-->
                            <Grid x:Name="Header" RenderTransformOrigin="0.5,0.5">
                            	<Grid.RenderTransform>
                                    <CompositeTransform TranslateY="-23.5" ScaleY="0.001" />
                            	</Grid.RenderTransform>
                                <Grid.Background>
                                    <ImageBrush ImageSource="/ControlExplorer.5;component/Resources/homeHeader.jpg" Stretch="Fill" AlignmentY="Bottom" />
                                </Grid.Background>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <!--Search-->
                                <local:SearchControl x:Name="Search" HorizontalAlignment="Right" Margin="0,12,45,12" Width="250" Grid.Column="1" />

                                <!--Breadcrumb-->
                                <StackPanel Orientation="Horizontal" Margin="34,0,0,0">
                                    <HyperlinkButton x:Name="hyperlinkButton" NavigateUri="/Views/HomePage_SL5.xaml" ToolTipService.ToolTip="Home" Style="{StaticResource BreadcrumbHyperlink}">
                                        <Image Source="/ControlExplorer.5;component/Resources/ico-Home.png" Width="48" Height="48" />
                                    </HyperlinkButton>
                                    <HyperlinkButton x:Name="ControlsPage" NavigateUri="/Views/ControlsPage_SL5.xaml" Style="{StaticResource BreadcrumbHyperlink}" Margin="-2,0,0,0" Padding="0,0,2,0">
                                        <StackPanel Orientation="Horizontal">
                                        	<Grid Background="#FF0E7FB7">
                                        		<Rectangle Height="34" Width="2" Fill="#FFBBBBBB" />
											</Grid>
                                            <Image Source="/ControlExplorer.5;component/Resources/ico-ControlList.png" Width="48" Height="48" ToolTipService.ToolTip="Control List" />
										</StackPanel>
                                    </HyperlinkButton>
                                </StackPanel>
                            </Grid>
                            <!--Content-->
                            <ContentPresenter Grid.Row="1" />
                            <!--Footer-->
                            <Image Height="5" Grid.Row="2" Source="/ControlExplorer.5;component/Resources/homeFooter.png" Stretch="Fill" Width="1125" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TileControl">
        <Setter Property="Background" Value="{StaticResource IconLightBlueBackground}" />
        <Setter Property="Foreground" Value="White" />
		<Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TileControl">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <ContentControl ContentTemplate="{TemplateBinding IconTemplate}" Width="{TemplateBinding IconWidth}" Height="{TemplateBinding IconHeight}" />
                        <TextBlock Text="{TemplateBinding Title}" Grid.Row="1" TextAlignment="Center" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:C1FacebookShareButton">
        <Setter Property="Padding" Value="2,0,2,0" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Margin" Value="0,7,0,0" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Height" Value="20" />
        <Setter Property="BorderBrush" Value="White" />
        <Setter Property="Foreground" Value="#FF1D4088" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1FacebookShareButton">
                    <Grid Cursor="{TemplateBinding Cursor}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="00:00:00" Value="#FF546EA6" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Border Background="#FFE8E8E8" Grid.Column="0" IsHitTestVisible="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Margin="0,0,5,0">
                            <StackPanel Orientation="Horizontal" Margin="1,0">
                                <TextBlock Text="{TemplateBinding Counter}" FontSize="16" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,-3,0,-4" />
                                <TextBlock Text="shares" FontSize="9" HorizontalAlignment="Center" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Bottom" Margin="1,0,1,-1" />
                            </StackPanel>
                        </Border>
                        <Border Grid.Column="1" x:Name="border" Background="#FF3B5998" CornerRadius="1" BorderBrush="#FF4C6BAD" BorderThickness="{TemplateBinding BorderThickness}" Width="20">
                            <Grid d:LayoutOverrides="Width">
                                <Rectangle Fill="#FF6D84B4" Height="3" Margin="1,0,1,1" StrokeThickness="2" VerticalAlignment="Bottom" />
                                <Path Data="M6,0 L9,0 L9,2.9999998 L6.4996462,2.9999998 C6.2409444,3.0000005 6.0281658,3.1967285 6.0025792,3.4488282 L6.0000005,3.4999225 L6.0000005,6 L9,6 L9,9 L6,9 L6,12.000001 L6,15 L6,16 L3.0000002,16 L3.0000002,15 L2.9999998,9 L0,9 L0,6 L2.9999998,6 L2.9999998,3 L3.0039034,2.8456204 C3.0842531,1.2605108 4.3949223,5.5690919E-08 6,0 z" Fill="White" Margin="5,1,4,1" Stretch="Fill" StrokeThickness="2" UseLayoutRounding="False" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>