<UserControl
    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:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="ChartSamples.Functions"
    Foreground="#FFF0F8FE" mc:Ignorable="d">
  <UserControl.Resources>
   <SolidColorBrush x:Key="CE_SampleForeground" Color="#FFF0F8FE"/>
   <SolidColorBrush x:Key="CE_SampleBorder" Color="#FF8FB4CC"/>

<Style x:Key="CE_SampleText" TargetType="TextBlock">
        <Setter Property="VerticalAlignment" Value="Center" />
    	<Setter Property="TextWrapping" Value="Wrap" />
    	<Setter Property="Foreground" Value="#FFF0F8FE" />
    	<Setter Property="FontFamily" Value="Portable User Interface" />
    	<Setter Property="FontSize" Value="12" />
</Style>

<Style x:Key="CE_SampleChart" TargetType="c1:C1Chart">
    	<Setter Property="Foreground" Value="#FFF0F8FE" />
    	<Setter Property="Background" Value="#ff071D2E" />
    	<Setter Property="BorderBrush" Value="#FF8FB4CC" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="Padding" Value="10" />
</Style>

  </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
      <RowDefinition Height="60" />
      <RowDefinition />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition />
    </Grid.ColumnDefinitions>
        <Grid >
          <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
      </Grid.ColumnDefinitions>

      <Grid VerticalAlignment="Center" Margin="4,2" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
          </Grid.ColumnDefinitions>
          <TextBlock Text="f(val)=" VerticalAlignment="Center" Style="{StaticResource CE_SampleText}" />
          <TextBox x:Name="tbCode" Grid.Column="1" AcceptsReturn="True" />
          <Border x:Name="m_error" Background="Transparent" Visibility="Collapsed" Grid.Column="2" Margin="2,0" BorderThickness="2" BorderBrush="Red" CornerRadius="6"
                  Padding="6,0,6,0">
            <TextBlock Text="!" Foreground="Red"  FontWeight="Bold" VerticalAlignment="Center" />
          </Border>
          <Button x:Name="btnApply" Content="Apply" Grid.Column="3" Click="btnApply_Click" />
        </Grid>

      <Grid Grid.Column="1" VerticalAlignment="Center" Margin="4,2">
              <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
              </Grid.RowDefinitions>
        <TextBlock x:Name="tbText" Text="Enter the function code with parameter val using JavaScript notation." TextWrapping="Wrap" />

        <StackPanel Orientation="Horizontal" Margin="4" Grid.Row="1">
            <Button x:Name="btnSample1" Margin="2" Content="Sample 1." Click="btnSample1_Click" 
                             ToolTipService.ToolTip="Click to copy sample"/>
            <Button Grid.Row="1"  x:Name="btnSample2" Margin="2" Content="Sample 2." Click="btnSample2_Click" 
                             VerticalAlignment="Top" ToolTipService.ToolTip="Click to copy sample"/>
          </StackPanel>
        </Grid>
            </Grid>

    <Border Grid.Row="1">
      <c1:C1Chart x:Name="chart" Style="{StaticResource CE_SampleChart}"/>
    </Border>
  </Grid>
</UserControl>
