<!--// Copyright © GrapeCity, Inc..
// This file is part of ComponentOne Studio WPF Edition
// Please visit https://www.grapecity.com/en/componentone for details
// All other rights reserved.
-->

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:media="clr-namespace:System.Windows.Media;assembly=System.Windows" xmlns:c1RTB="clr-namespace:C1.WPF.RichTextBox" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ScrollBar.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- Brushes Color -->
    <Color x:Key="MainColor">#FF3C688D</Color>
    <SolidColorBrush x:Key="MainBrushColor" Color="{StaticResource MainColor}" />
    <LinearGradientBrush x:Key="BorderBrush2" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#7FFFFFFF" Offset="0.05" />
        <GradientStop Color="#B2FFFFFF" Offset="0.07" />
        <GradientStop Color="#0C000000" Offset="1" />
    </LinearGradientBrush>
    <Style x:Key="BorderStyle" TargetType="Border">
        <Setter Property="CornerRadius" Value="2" />
    </Style>
    <!-- Default Settings -->
    <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF" />
    <SolidColorBrush x:Key="WatermarkBrush" Color="#FFAAAAAA" />
    <SolidColorBrush x:Key="BorderBrush" Color="#FF7F98A9" />
    <SolidColorBrush x:Key="Background" Color="White" />
    <LinearGradientBrush x:Key="FocusBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFA9B9C5" />
        <GradientStop Color="#FF668499" Offset="0.32499998807907104" />
        <GradientStop Color="#FF244E6D" Offset="0.32499998807907104" />
        <GradientStop Color="#FF4F7189" Offset="1" />
    </LinearGradientBrush>
    <Style x:Key="FocusStyle" TargetType="Border">
        <Setter Property="CornerRadius" Value="2" />
        <Setter Property="Opacity" Value="0" />
        <Setter Property="BorderBrush" Value="{StaticResource FocusBorderBrush}" />
    </Style>
    <Style x:Key="DisabledStyle" TargetType="Border">
        <Setter Property="Background" Value="{StaticResource DisabledBrush}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Opacity" Value="0" />
        <Setter Property="IsHitTestVisible" Value="False" />
        <Setter Property="CornerRadius" Value="2" />
    </Style>

    <!-- Default style for C1.Silverlight.C1RichTextBox -->
    <Style TargetType="c1RTB:C1RichTextBox">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="{StaticResource Background}" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Cursor" Value="IBeam" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="SelectionBackground" Value="#DC000000" />
        <Setter Property="SelectionForeground" Value="White" />
        <Setter Property="ScrollBarStyle" Value="{StaticResource ScrollBarClearStyle}" />
        <Setter Property="PrintPageLayout">
            <Setter.Value>
                <c1RTB:C1PageLayout Height="1056" Width="816" Padding="96" Background="White" Margin="4" />
            </Setter.Value>
        </Setter>
        <Setter Property="PrintPanelTemplate">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1RTB:C1PagesPanel />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="PrintTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid Margin="{Binding ViewManager.PresenterInfo.Margin}">
                        <Grid.Resources>
                            <c1:ZoomToScaleTransformConverter x:Key="zoomConverter" />
                        </Grid.Resources>
                        <Border Background="#19000000" Margin="4,4,-4,-4" CornerRadius="2" />
                        <Border Background="#19000000" Margin="3,3,-3,-3" CornerRadius="2" />
                        <Border Background="#19000000" Margin="2,2,-2,-2" CornerRadius="2" />
                        <Border Background="#19000000" Margin="1,1,-1,-1" CornerRadius="2" />
                        <Border BorderThickness="1" BorderBrush="#FF858585" Background="{Binding ViewManager.PresenterInfo.Background}" />
                        <c1:C1LayoutTransformer LayoutTransform="{Binding ViewManager.PresenterInfo.Zoom, Converter={StaticResource zoomConverter}}">
                            <Grid Height="{Binding ViewManager.PresenterInfo.Height}" Width="{Binding ViewManager.PresenterInfo.Width}">
                                <c1RTB:C1RichTextPresenter Source="{Binding}" Margin="{Binding ViewManager.PresenterInfo.Padding}" />
                            </Grid>
                        </c1:C1LayoutTransformer>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="UIContainerResizeTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid SnapsToDevicePixels="True">
                        <Grid.Resources>
                            <Style TargetType="Border" x:Key="thumb">
                                <Setter Property="Width" Value="8" />
                                <Setter Property="Height" Value="8" />
                                <Setter Property="Background" Value="White" />
                                <Setter Property="BorderBrush" Value="Black" />
                                <Setter Property="BorderThickness" Value="1" />
                                <Setter Property="Margin" Value="-4" />
                            </Style>
                        </Grid.Resources>
                        <Border BorderBrush="Black" BorderThickness="1" IsHitTestVisible="False" />

                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Left" VerticalAlignment="Center" Cursor="SizeWE" c1RTB:C1ResizePainter.Direction="-1,0" />
                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Right" VerticalAlignment="Center" Cursor="SizeWE" c1RTB:C1ResizePainter.Direction="1,0" />
                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Center" VerticalAlignment="Top" Cursor="SizeNS" c1RTB:C1ResizePainter.Direction="0,-1" />
                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Center" VerticalAlignment="Bottom" Cursor="SizeNS" c1RTB:C1ResizePainter.Direction="0,1" />

                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Left" VerticalAlignment="Top" Cursor="SizeNWSE" c1RTB:C1ResizePainter.Direction="-1,-1" />
                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Cursor="SizeNESW" c1RTB:C1ResizePainter.Direction="-1,1" />
                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="SizeNESW" c1RTB:C1ResizePainter.Direction="1,-1" />
                        <Border Style="{StaticResource thumb}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Cursor="SizeNWSE" c1RTB:C1ResizePainter.Direction="1,1" />
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1RTB:C1RichTextBox">
                    <Grid MinHeight="23" x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WritableStates">
                                <VisualState x:Name="Writable" />
                                <VisualState x:Name="ReadOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidUnfocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidFocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Style="{StaticResource BorderStyle}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <ContentControl x:Name="Watermark" Grid.Column="0" Grid.Row="0" IsTabStop="False" IsHitTestVisible="False" Content="{TemplateBinding Watermark}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Opacity="0.65" Visibility="Collapsed" />
                                <Grid x:Name="Container" Cursor="{TemplateBinding Cursor}" Grid.Column="0" Grid.Row="0" Background="Transparent">
                                    <Grid x:Name="Content" Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" Grid.Column="0" Grid.Row="0" Background="Transparent" />
                                </Grid>
                                <ScrollBar x:Name="VerticalScrollBar" Cursor="Arrow" Width="18" Grid.Column="1" Grid.Row="0" Orientation="Vertical" SmallChange="16" Style="{TemplateBinding ScrollBarStyle}" />
                                <ScrollBar x:Name="HorizontalScrollBar" Cursor="Arrow" Height="18" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" SmallChange="16" Style="{TemplateBinding ScrollBarStyle}" />
                                <Rectangle Grid.Column="1" Grid.Row="1" Fill="#FFE9E9E9" />
                            </Grid>
                        </Border>
                        <Border x:Name="FocusVisual" Style="{StaticResource FocusStyle}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="{TemplateBinding FocusCuesVisibility}" />
                        <Border x:Name="DisabledVisual" Style="{StaticResource DisabledStyle}" Visibility="{TemplateBinding DisabledCuesVisibility}" />
                        <c1:C1ValidationDecorator x:Name="ValidationDecorator" Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{TemplateBinding ValidationDecoratorStyle}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1RTB:C1RichTextPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1RTB:C1RichTextPresenter">
                    <Canvas x:Name="Content" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
