	  
	   
    
		


<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c="clr-namespace:System.Windows.Controls;assembly=PresentationFramework" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:c1c="clr-namespace:C1.WPF.C1Chart;assembly=C1.WPF.C1Chart.4" xmlns:c1e="clr-namespace:C1.WPF.Extended;assembly=C1.WPF.Extended.4" xmlns:c1fg="http://schemas.componentone.com/winfx/2006/xaml" xmlns:local="clr-namespace:C1.WPF.Olap" xmlns:res="clr-namespace:C1.WPF.Olap.Resources" xmlns:system="clr-namespace:System;assembly=mscorlib">

    <!-- Resources -->
    
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <res:Resources x:Key="Resources" />
    <local:SubtotalConverter x:Key="SubtotalConverter" />
    <local:VisibilityConverter x:Key="visibilityConverter" />

    <!-- C1OlapGrid Subtotal Background Brush -->
    <SolidColorBrush x:Key="SubtotalBackground" Color="#ffdce6fa" />

    <!-- C1OlapChart -->
    <Style TargetType="local:C1OlapChart">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapChart">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <!-- template used for C1OlapChart tooltips -->
                            <Grid.Resources>
                                <local:ToolTipConverter x:Key="ttcChart" />
                                <DataTemplate x:Key="_chartTooltip">
                                    <TextBlock Text="{Binding Converter={StaticResource ttcChart}}" />
                                </DataTemplate>
                                <local:PieChartToolTipConverter x:Key="pttcChart" />
                                <DataTemplate x:Key="_pieChartTooltip">
                                    <TextBlock Text="{Binding Converter={StaticResource pttcChart}}" />
                                </DataTemplate>
                            </Grid.Resources>
                            <!-- grid layout: title across the top, chart/legend below -->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <!-- chart title spans both columns over grid  -->
                            <TextBlock x:Name="Title" Grid.ColumnSpan="2" FontSize="18" HorizontalAlignment="Center" />
                            <!-- chart on the left -->
                            <c1c:C1Chart x:Name="Chart" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
                            <!-- legend on the right -->
                            <c1c:C1ChartLegend x:Name="Legend" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
	<Style TargetType="c1:C1TreeView" x:Key="defaultTreeView">
	    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
	    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
	    <Setter Property="BorderThickness" Value="1" />
	    <Setter Property="BorderBrush" Value="#FFA4AFBA"></Setter>
	    <Setter Property="Template">
	        <Setter.Value>
	            <ControlTemplate TargetType="c1:C1TreeView">
	                <Grid x:Name="Root">
	                    <VisualStateManager.VisualStateGroups>
	                        <VisualStateGroup x:Name="CommonStates">
	                            <VisualState x:Name="Normal" />
	                            <VisualState x:Name="Disabled">
	                                <Storyboard>
	                                    <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
	                                </Storyboard>
	                            </VisualState>
	                            <VisualState x:Name="MouseOver" />
	                        </VisualStateGroup>
	                        <VisualStateGroup x:Name="FocusStates">
	                            <VisualState x:Name="Unfocused" />
	                            <VisualState x:Name="Focused">
	                            </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>
	                    <Grid x:Name="DropLine">
	                        <Path Data="M5,4 L26,4" Stretch="Fill" Height="1" Width="50" Stroke="{TemplateBinding SelectedBackground}" StrokeThickness="1" VerticalAlignment="Center" />
	                        <Path Data="M0,0 L0,14 L14,7 z" Stretch="Fill" Height="9" Width="4" HorizontalAlignment="Left" Margin="0,0,2,0" Fill="{TemplateBinding SelectedBackground}" />
	                    </Grid>
	                    <Grid x:Name="DropArrow">
	                        <Path Data="M0,0 L0,14 L14,7 z" Stretch="Fill" Height="9" Width="4" HorizontalAlignment="Right" Margin="0,0,2,0" Fill="{TemplateBinding SelectedBackground}" />
	                    </Grid>
	                <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding Background}" />
	                <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
	                        <Grid>
	                        <ScrollViewer x:Name="Scroll" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" IsTabStop="False" BorderThickness="0" Padding="{TemplateBinding Padding}" c1:ClearStyleExtensions.ScrollBarStyle="{Binding Path=ScrollBarStyle,RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.ButtonForeground="{TemplateBinding Foreground}" Foreground="Blue">
	                            <ItemsPresenter />
	                                <c1:ScrollViewerTouchBehavior.TouchBehavior>
	                                    <c1:ScrollViewerTouchBehavior />
	                                </c1:ScrollViewerTouchBehavior.TouchBehavior>
	                            </ScrollViewer>
	                        </Grid>
	                    </Border>
	                    <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Visibility="{TemplateBinding DisabledCuesVisibility}" />
	                    <c1:C1ValidationDecorator x:Name="ValidationDecorator" Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{TemplateBinding ValidationDecoratorStyle}" />
	                </Grid>
	            </ControlTemplate>
	        </Setter.Value>
	    </Setter>
	</Style>

    <!-- C1OlapPanel -->
    <Style TargetType="local:C1OlapPanel">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapPanel">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <Grid.Resources>
                                <!-- field template for main field listbox (items with check boxes) -->
                                <DataTemplate x:Key="field">
                                    <local:DraggableItem Background="Transparent" HorizontalAlignment="Stretch">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="auto" />
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Orientation="Horizontal">
                                                
                                                
                                                <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}" VerticalAlignment="Center" />
                                                <TextBlock Text="{Binding Caption}" Padding="2,0,0,0" />
                                            </StackPanel>
                                            <Image Grid.Column="1" HorizontalAlignment="Right" Visibility="{Binding Filter.IsActive,Converter={StaticResource visibilityConverter}}" Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" />
                                        </Grid>
                                    </local:DraggableItem>
                                </DataTemplate>
                                <!-- field template for fields in drag/drop lists (no check boxes) -->
                                <DataTemplate x:Key="fieldActive">
                                    <local:DraggableItem Background="Transparent" HorizontalAlignment="Stretch">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="auto" />
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Caption}" HorizontalAlignment="Stretch" />
                                            </StackPanel>
                                            <Image Grid.Column="1" HorizontalAlignment="Right" Visibility="{Binding Filter.IsActive,Converter={StaticResource visibilityConverter}}" Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" />
                                        </Grid>
                                    </local:DraggableItem>
                                </DataTemplate>
                                
								<c1:C1HierarchicalDataTemplate x:Key="cubeField" ItemsSource="{Binding SubFields}">
									<local:DraggableItem Background="Transparent" HorizontalAlignment="Stretch">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="auto" />
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Orientation="Horizontal">
                                                <CheckBox Margin="2" IsChecked="{Binding IsActive, Mode=TwoWay}" Visibility="{Binding CanDrag, Mode=TwoWay,Converter={StaticResource visibilityConverter}}" VerticalAlignment="Center" />
                                                <Image Source="{Binding Path=ImagePath}" Stretch="None" />
                                                <TextBlock Text="{Binding Caption}" Padding="2,0,0,0" />
                                            </StackPanel>
                                            <Image Grid.Column="1" HorizontalAlignment="Right" Visibility="{Binding Filter.IsActive,Converter={StaticResource visibilityConverter}}" Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" />
                                        </Grid>
									</local:DraggableItem>
								</c1:C1HierarchicalDataTemplate>
                                <!-- field template for fields in drag/drop lists (no check boxes) -->
                                <DataTemplate x:Key="subtotalFieldActive">
                                    <local:DraggableItem Background="Transparent" HorizontalAlignment="Stretch">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="auto" />
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Caption}" HorizontalAlignment="Stretch" />
                                                <TextBlock Text="{Binding Subtotal, Converter={StaticResource SubtotalConverter}}" HorizontalAlignment="Stretch" />
                                            </StackPanel>
                                            <Image Grid.Column="1" HorizontalAlignment="Right" Visibility="{Binding Filter.IsActive,Converter={StaticResource visibilityConverter}}" Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" />
                                        </Grid>
                                    </local:DraggableItem>
                                </DataTemplate>
                                
                                <DataTemplate x:Key="cubeSubtotalFieldActive">
                                    <local:DraggableItem Background="Transparent" HorizontalAlignment="Stretch">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="auto" />
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Caption}" HorizontalAlignment="Stretch" />
                                            </StackPanel>
                                            <Image Grid.Column="1" HorizontalAlignment="Right" Visibility="{Binding Filter.IsActive,Converter={StaticResource visibilityConverter}}" Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" />
                                        </Grid> 
                                    </local:DraggableItem>
                                </DataTemplate>
                                
                            </Grid.Resources>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <!-- main field list on top -->
                            <Grid Margin="5 5 0 0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <TextBlock Text="{Binding Path=ChooseFields, Source={StaticResource Resources}}" Padding="0 5" />
                                <ListBox x:Name="Fields" Grid.Row="1" ItemTemplate="{StaticResource field}">
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="ListBoxItem">
                                            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                                
                                <c1:C1TreeView x:Name="CubeFields" Grid.Row="1" ItemTemplate="{StaticResource cubeField}" IsVirtualizing="True" Visibility="Collapsed" Style="{StaticResource defaultTreeView}">
                                </c1:C1TreeView>
                            </Grid>
                            <!-- splitter in the middle -->
                            <c:GridSplitter Grid.Row="1" Height="5" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                            <!-- drag-drop area below -->
                            <Grid Grid.Row="2" Margin="5 0 0 5">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <!-- title -->
                                <TextBlock Text="{Binding Path=DragFields, Source={StaticResource Resources}}" Grid.ColumnSpan="3" Padding="0 5" />
                                <!-- filter fields -->
                                <StackPanel Orientation="Horizontal" Grid.Row="1">
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" />
                                    <TextBlock Text="{Binding Path=Filter, Source={StaticResource Resources}}" Padding="0 5" />
                                </StackPanel>
                                <ListBox x:Name="Filter" Grid.Row="2" ItemTemplate="{StaticResource fieldActive}">
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="ListBoxItem">
                                            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                                <!-- column fields -->
                                <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="5 0 0 0">
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/columns.png" Stretch="None" />
                                    <TextBlock Text="{Binding Path=ColumnFields, Source={StaticResource Resources}}" Padding="0 5" />
                                </StackPanel>
                                <ListBox x:Name="Columns" Margin="5 0 0 0" Grid.Row="2" Grid.Column="1" ItemTemplate="{StaticResource fieldActive}">
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="ListBoxItem">
                                            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                                <!-- row fields -->
                                <StackPanel Orientation="Horizontal" Grid.Row="3">
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/rows.png" Stretch="None" />
                                    <TextBlock Text="{Binding Path=RowFields, Source={StaticResource Resources}}" Padding="0 5" />
                                </StackPanel>
                                <ListBox x:Name="Rows" Grid.Row="4" ItemTemplate="{StaticResource fieldActive}">
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="ListBoxItem">
                                            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                                <!-- value fields -->
                                <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1" Margin="5 0 0 0">
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/values.png" Stretch="None" />
                                    <TextBlock Text="{Binding Path=Values, Source={StaticResource Resources}}" Padding="0 5" />
                                </StackPanel>
                                <ListBox x:Name="Values" Margin="5 0 0 0" Grid.Row="4" Grid.Column="1" ItemTemplate="{StaticResource subtotalFieldActive}">
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="ListBoxItem">
                                            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                            </Grid>
                            <!-- 'defer updates' checkbox -->
                            
                            
              <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" Margin="5 0 5 5" Grid.Row="3" Name="_chkDeferUpdates" Content="{Binding Path=DeferUpdates, Source={StaticResource Resources}}" />
                            <!-- context menu for fields -->
                            
                            
                            <Grid.ContextMenu>
							    <ContextMenu x:Name="CtxMenu">
                                    <MenuItem x:Name="CmdMoveUp" Header="{Binding Path=MoveUp, Source={StaticResource Resources}}" />
                                    <MenuItem x:Name="CmdMoveDown" Header="{Binding Path=MoveDown, Source={StaticResource Resources}}" />
                                    <MenuItem x:Name="CmdMoveToBeg" Header="{Binding Path=MoveToBeginning, Source={StaticResource Resources}}" />
                                    <MenuItem x:Name="CmdMoveToEnd" Header="{Binding Path=MoveToEnd, Source={StaticResource Resources}}" />
								    <Separator x:Name="CmdTopSeparator" />
                                    <MenuItem x:Name="CmdMoveToFilter" Header="{Binding Path=MoveToFilterFields, Source={StaticResource Resources}}">
                                        <MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/filter.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="CmdMoveToCols" Header="{Binding Path=MoveToColumnFields, Source={StaticResource Resources}}">
                                        <MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/columns.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="CmdMoveToRows" Header="{Binding Path=MoveToRowFields, Source={StaticResource Resources}}">
                                        <MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/rows.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="CmdMoveToVals" Header="{Binding Path=MoveToValueFields, Source={StaticResource Resources}}">
                                        <MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/values.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
								    <Separator />
                                    <MenuItem x:Name="CmdRemoveField" Header="{Binding Path=RemoveField, Source={StaticResource Resources}}">
                                        <MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/delete.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="CmdFieldSettings" Header="{Binding Path=FieldSettings, Source={StaticResource Resources}}">
                                        <MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/properties.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                </ContextMenu>
                            </Grid.ContextMenu>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapPage -->
    <Style TargetType="local:C1OlapPage">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapPage">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <!-- styles used for menu items and images -->
                            <Grid.Resources>
                                <Style TargetType="Image">
                                    <Setter Property="Stretch" Value="None" />
                                    <Setter Property="Margin" Value="3" />
                                </Style>
                                <Style x:Key="menuIcon" TargetType="Image">
                                    <Setter Property="Stretch" Value="None" />
                                    <Setter Property="Margin" Value="0 3" />
                                </Style>
                            </Grid.Resources>
                            <!-- menu across the top, content below: panel, splitter, tab -->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <!-- menu across the top -->
                            <c1:C1Menu x:Name="MainMenu" Grid.ColumnSpan="3" Height="30" AutoClose="True">
                                <!-- open/save -->
                                <c1:C1MenuItem x:Name="MenuOpen" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=LoadViewFromFile, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Header>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/open.png" Style="{StaticResource menuIcon}" />
                                    </c1:C1MenuItem.Header>
                                </c1:C1MenuItem>
                                <c1:C1MenuItem x:Name="MenuSave" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=SaveViewToFile, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Header>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/save.png" Style="{StaticResource menuIcon}" />
                                    </c1:C1MenuItem.Header>
                                </c1:C1MenuItem>
                                <c1:C1MenuItem x:Name="MenuExport" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Export, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Header>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/export.png" Style="{StaticResource menuIcon}" />
                                    </c1:C1MenuItem.Header>
                                </c1:C1MenuItem>
                                <!-- spacer -->
                                <c1:C1Separator Width="4" />
                                <!-- undo/redo -->
                                <c1:C1MenuItem x:Name="MenuUndo" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Undo, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Header>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/undo.png" Style="{StaticResource menuIcon}" />
                                    </c1:C1MenuItem.Header>
                                </c1:C1MenuItem>
                                <c1:C1MenuItem x:Name="MenuRedo" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Redo, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Header>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/redo.png" Style="{StaticResource menuIcon}" />
                                    </c1:C1MenuItem.Header>
                                </c1:C1MenuItem>
                                <!-- spacer -->
                                <c1:C1Separator Width="4" />
                                <!-- customize grid -->
                                <c1:C1MenuItem x:Name="_mnuView" Padding="0 3 3 3" Header="{Binding Path=Grid, Source={StaticResource Resources}}" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=CustomizeGridView, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Icon>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/grid.png" />
                                    </c1:C1MenuItem.Icon>
                                    <c1:C1MenuItem x:Name="_mnuTotalRows" Header="{Binding Path=TotalRows, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/totalRows.png" />
                                        </c1:C1MenuItem.Icon>
                                        <c1:C1MenuItem x:Name="MenuTRGrand" Header="{Binding Path=GrandTotals, Source={StaticResource Resources}}" GroupName="TR" IsCheckable="True" IsChecked="True" />
                                        <c1:C1MenuItem x:Name="MenuTRSub" Header="{Binding Path=Subtotals, Source={StaticResource Resources}}" GroupName="TR" IsCheckable="True" />
                                        <c1:C1MenuItem x:Name="MenuTRNone" Header="{Binding Path=None, Source={StaticResource Resources}}" GroupName="TR" IsCheckable="True" />
                                    </c1:C1MenuItem>
                                    <c1:C1MenuItem x:Name="_mnuTotalColumns" Header="{Binding Path=TotalColumns, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/totalColumns.png" />
                                        </c1:C1MenuItem.Icon>
                                        <c1:C1MenuItem x:Name="MenuTCGrand" Header="{Binding Path=GrandTotals, Source={StaticResource Resources}}" GroupName="TC" IsCheckable="True" IsChecked="True" />
                                        <c1:C1MenuItem x:Name="MenuTCSub" Header="{Binding Path=Subtotals, Source={StaticResource Resources}}" GroupName="TC" IsCheckable="True" />
                                        <c1:C1MenuItem x:Name="MenuTCNone" Header="{Binding Path=None, Source={StaticResource Resources}}" GroupName="TC" IsCheckable="True" />
                                    </c1:C1MenuItem>
                                    <c1:C1Separator />
                                    <c1:C1MenuItem x:Name="MenuZeros" Header="{Binding Path=ShowZeros, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" />
                                </c1:C1MenuItem>
                                <!-- customize chart -->
                                <c1:C1MenuItem x:Name="_mnuChart" Padding="0 3 3 3" Header="{Binding Path=Chart, Source={StaticResource Resources}}" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=CustomizeChartView, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Icon>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/chart.png" />
                                    </c1:C1MenuItem.Icon>
                                    <c1:C1MenuItem x:Name="MenuChartType" Header="{Binding Path=ChartType, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MenuPalette" Header="{Binding Path=Palette, Source={StaticResource Resources}}" />
                                    <c1:C1Separator />
                                    <c1:C1MenuItem x:Name="MenuTitle" Header="{Binding Path=ShowTitle, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" />
                                    <c1:C1MenuItem x:Name="MenuGridlines" Header="{Binding Path=ShowGridLines, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" />
                                    <c1:C1MenuItem x:Name="MenuStacked" Header="{Binding Path=Stacked, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" />
                                    <c1:C1MenuItem x:Name="MenuTotalsOnly" Header="{Binding Path=TotalsOnly, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="False" />
                                    <c1:C1MenuItem x:Name="MenuGroupAnno" Header="{Binding Path=GroupAnnotations, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="False" />
                                </c1:C1MenuItem>
                                <!-- print -->
                                <c1:C1MenuItem x:Name="_mnuPrint" Padding="0 3 3 3" Header="{Binding Path=Report, Source={StaticResource Resources}}" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=GenerateReports, Source={StaticResource Resources}}">
                                    <c1:C1MenuItem.Icon>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/report.png" />
                                    </c1:C1MenuItem.Icon>
                                    <c1:C1MenuItem x:Name="MenuPrint" Header="{Binding Path=Print, Source={StaticResource Resources}}" VerticalAlignment="Center">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/print.png" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <c1:C1Separator />
                                    <c1:C1MenuItem x:Name="MenuPrintOptions" Header="{Binding Path=Options, Source={StaticResource Resources}}" VerticalAlignment="Center">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/options.png" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                </c1:C1MenuItem>
                            </c1:C1Menu>
                            <!-- olap panel on the left -->
                            <local:C1OlapPanel x:Name="OlapPanel" Grid.Row="1" />
                            <!-- splitter in the middle -->
                            
                            
        					<c:GridSplitter Grid.Column="1" Grid.Row="1" Width="5" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Stretch" />
                            <!-- tab control on the right -->
                            <c:TabControl x:Name="Tab" Grid.Row="1" Grid.Column="2" Margin="0 5 5 5">
                                <c:TabItem x:Name="TabGrid" Header="{Binding Path=OlapGrid, Source={StaticResource Resources}}">
                                    <local:C1OlapGrid x:Name="OlapGrid" />
                                </c:TabItem>
                                <c:TabItem x:Name="TabChart" Header="{Binding Path=OlapChart, Source={StaticResource Resources}}">
                                    <local:C1OlapChart x:Name="OlapChart" Margin="0" />
                                </c:TabItem>
                                <c:TabItem x:Name="TabRawData" Header="{Binding Path=RawData, Source={StaticResource Resources}}">
                                    <c1fg:C1FlexGrid x:Name="RawDataGrid" />
                                </c:TabItem>
                            </c:TabControl>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1FormatEditor -->
    <Style TargetType="local:C1FormatEditor">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1FormatEditor">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="150" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <!-- predefined formats -->
                            <ListBox Name="ListFormats" Margin="4" />
                            <!-- customization area -->
                            <StackPanel Grid.Column="1" Margin="4">
                                <StackPanel Orientation="Horizontal" x:Name="_pSample">
                                    <TextBlock Text="{Binding Path=Sample, Source={StaticResource Resources}}" VerticalAlignment="Center" Margin="4" />
                                    <TextBlock Name="LblSample" Text="12.000" FontWeight="Bold" Margin="4" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" x:Name="PCustom">
                                    <TextBlock Text="{Binding Path=CustomFormat, Source={StaticResource Resources}}" VerticalAlignment="Center" Margin="4" />
                                    <TextBox Name="TxtCustom" Width="80" Margin="4" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" x:Name="PDecimals">
                                    <TextBlock Text="{Binding Path=DecimalPlaces, Source={StaticResource Resources}}" VerticalAlignment="Center" Margin="4" />
                                    <c1:C1NumericBox Name="NumDec" Value="2" Format="0" Width="80" Minimum="0" Maximum="12" Margin="4" />
                                </StackPanel>
                                
                                
                <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="ChkThousand" Content="{Binding Path=UseThousandSeparator, Source={StaticResource Resources}}" Margin="4" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapFilterEditor -->
    <Style TargetType="local:C1OlapFilterEditor">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapFilterEditor">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <Grid.Resources>
                                <!-- field template for filter items listbox (items with check boxes) -->
                                <DataTemplate x:Key="_filterItem">
                                    <CheckBox Content="{Binding Key}" IsChecked="{Binding Value, Mode=TwoWay}" />
                                </DataTemplate>
                            </Grid.Resources>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <!-- main content -->
                            
                            
                <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="ChkSelectAll" Content="{Binding Path=SelectAll, Source={StaticResource Resources}}" Margin="7 4" />
                            <ListBox x:Name="ListValues" Grid.Row="1" Margin="2 0" ItemTemplate="{StaticResource _filterItem}" />
                            <c1:C1Menu x:Name="ToolStrip" HorizontalAlignment="Stretch" Grid.Row="2" AutoClose="True">
                                <c1:C1MenuItem x:Name="MnuFilter" Header="{Binding Path=Filter, Source={StaticResource Resources}}" Padding="2">
                                    <c1:C1MenuItem.Icon>
                                        <Image Source="/C1.WPF.Olap.4;component/Resources/filter.png" Stretch="None" Margin="3" />
                                    </c1:C1MenuItem.Icon>
                                    <c1:C1MenuItem x:Name="MnuClear" Header="{Binding Path=ClearFilter, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.WPF.Olap.4;component/Resources/clearfilter.png" Stretch="None" Margin="3" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <c1:C1Separator x:Name="MnuSeparator0" />
                                    <c1:C1MenuItem x:Name="MnuEquals" Header="{Binding Path=MnuEquals, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuDoesNotEqual" Header="{Binding Path=DoesNotEqual, Source={StaticResource Resources}}" />
                                    <c1:C1Separator x:Name="MnuSeparator" />
                                    <c1:C1MenuItem x:Name="MnuBeginsWith" Header="{Binding Path=BeginsWith, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuEndsWith" Header="{Binding Path=EndsWith, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuContains" Header="{Binding Path=Contains, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuDoesNotContain" Header="{Binding Path=DoesNotContain, Source={StaticResource Resources}}" />
                                    <c1:C1Separator x:Name="MnuSeparator2" />
                                    <c1:C1MenuItem x:Name="MnuGreater" Header="{Binding Path=GreaterThan, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuGreaterOrEqual" Header="{Binding Path=GreaterThanOrEqualTo, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuLess" Header="{Binding Path=LessThan, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="MnuLessOrEqual" Header="{Binding Path=LessThanOrEqualTo, Source={StaticResource Resources}}" />
                                    <c1:C1Separator x:Name="MnuSeparator3" />
                                    <c1:C1MenuItem x:Name="MnuBetween" Header="{Binding Path=Between, Source={StaticResource Resources}}" />
                                    <c1:C1MenuItem x:Name="_mnuCustom" Header="{Binding Path=CustomFilter, Source={StaticResource Resources}}" />
                                </c1:C1MenuItem>
                            </c1:C1Menu>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1FieldStyleEditor -->
    <Style TargetType="local:C1FieldStyleEditor">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1FieldStyleEditor">
                    <Grid x:Name="Root">
                        <StackPanel Grid.Row="1" Grid.Column="1" Margin="5">
                            
                            
              <TextBlock Text="{Binding Path=Style, Source={StaticResource Resources}}" Margin="5,0,0,0" />
                            <Border BorderBrush="#FF96B9B9" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="5">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="5" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="5" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="5" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="5" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition Width="5*" />
                                        <ColumnDefinition Width="10*" />
                                        <ColumnDefinition MinWidth="120" />
                                        <ColumnDefinition Width="5" />
                                    </Grid.ColumnDefinitions>
                                    
                                    
                  <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="BoldCheckBox" Grid.Column="3" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Left" />
                  <TextBlock Foreground="{TemplateBinding Foreground}" Text="{Binding Path=Background, Source={StaticResource Resources}}" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" />
                  <c1e:C1ColorPicker x:Name="BackgroundPicker" VerticalAlignment="Center" Grid.Column="3" Grid.Row="1" />
                  <TextBlock Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" Text="{Binding Path=Foreground, Source={StaticResource Resources}}" Grid.Column="1" Grid.Row="3" />
                  <c1e:C1ColorPicker x:Name="ForegroundPicker" VerticalAlignment="Center" Grid.Column="3" Grid.Row="3" />
                  <TextBlock Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" Text="{Binding Path=Bold, Source={StaticResource Resources}}" Grid.Column="1" Grid.Row="5" />
                                    <Button x:Name="ClearButton" VerticalAlignment="Center" Content="{Binding Path=Clear, Source={StaticResource Resources}}" Grid.Column="3" Grid.Row="5" HorizontalAlignment="Right" />
                                </Grid>
                            </Border>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1ConditionalFieldStyleEditor -->
    <Style TargetType="local:C1ConditionalFieldStyleEditor">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1ConditionalFieldStyleEditor">
                    <Grid Name="Root">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Margin="5">
                            
                            
              <TextBlock x:Name="AboveLabel" Foreground="{TemplateBinding Foreground}" Text="{Binding Path=ApplyToValuesAbove, Source={StaticResource Resources}}" Margin="5,0,0,0" />
              <TextBlock x:Name="BelowLabel" Foreground="{TemplateBinding Foreground}" Text="{Binding Path=ApplyToValuesBelow, Source={StaticResource Resources}}" Margin="5,0,0,0" />
                            <Border BorderBrush="#FF96B9B9" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="5">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="5" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="5" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="100" />
                                        <ColumnDefinition Width="5" />
                                    </Grid.ColumnDefinitions>
                                    
                                    
                  <TextBox x:Name="Threshold" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" />
                                    <ComboBox x:Name="ConditionType" Grid.Column="3" Grid.Row="1" />
                                </Grid>
                            </Border>
                        </StackPanel>
                        <local:C1FieldStyleEditor x:Name="StyleEditor" Grid.Row="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapFieldEditor -->
    <Style TargetType="local:C1OlapFieldEditor">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapFieldEditor">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <!-- main content -->
                            <c:TabControl Name="Tab">
                                <c:TabItem Header="{Binding Path=Filter, Source={StaticResource Resources}}" Name="TabFilter">
                                    <Grid>
                                        <local:C1OlapFilterEditor x:Name="FilterEditor" />
                                    </Grid>
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=Subtotals, Source={StaticResource Resources}}" Name="TabSubtotal">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <ListBox x:Name="ListSubtotal" />
                                        <StackPanel Orientation="Horizontal" Grid.Row="1">
                                            
                                            
                      <TextBlock Foreground="{TemplateBinding Foreground}" Text="{Binding Path=WeighBy, Source={StaticResource Resources}}" VerticalAlignment="Center" Margin="4" />
                                            <ComboBox x:Name="CmbWeight" Width="150" Margin="4" />
                                        </StackPanel>
                                    </Grid>
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=Format, Source={StaticResource Resources}}" Name="TabFormat">
                                    <Grid>
                                        <local:C1FormatEditor x:Name="FormatEditor" />
                                    </Grid>
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=Display, Source={StaticResource Resources}}" Name="TabDisplay">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <StackPanel Orientation="Vertical" Margin="5">
                                            
                                            
                      <TextBlock Foreground="{TemplateBinding Foreground}" Text="{Binding Path=Caption, Source={StaticResource Resources}}" Margin="5,0,0,0" />
                      <TextBox x:Name="CaptionBox" Foreground="{TemplateBinding Foreground}" />
                                        </StackPanel>
                                        <local:C1FieldStyleEditor x:Name="DisplayStyleEditor" Grid.Row="1" />
                                    </Grid>
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=HighValues, Source={StaticResource Resources}}" Name="TabStyleHigh">
                                    <local:C1ConditionalFieldStyleEditor x:Name="HighStyleEditor" HighValues="True" Grid.Row="1" Grid.Column="1" />
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=LowValues, Source={StaticResource Resources}}" Name="TabStyleLow">
                                    <local:C1ConditionalFieldStyleEditor x:Name="LowStyleEditor" HighValues="False" Grid.Row="1" Grid.Column="1" />
                                </c:TabItem>
                            </c:TabControl>
                            <!-- OK, Cancel buttons -->
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
                                <Button x:Name="BtnOk" Content="{Binding Path=OK, Source={StaticResource Resources}}" Width="75" Margin="4" />
                                <Button x:Name="BtnCancel" Content="{Binding Path=Cancel, Source={StaticResource Resources}}" Width="75" Margin="4" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- CustomFilterEditor -->
    <Style TargetType="local:CustomFilterEditor">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CustomFilterEditor">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <Grid.Resources>
                                <Style x:Key="fixedWidth" TargetType="Control">
                                    <Setter Property="Margin" Value="10 4" />
                                    <Setter Property="Width" Value="200" />
                                </Style>
                            </Grid.Resources>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="10" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="20" />
                                <RowDefinition Height="auto" />
                            </Grid.RowDefinitions>
                            
                            
              <TextBlock Text="{Binding Path=ShowItems, Source={StaticResource Resources}}" Grid.ColumnSpan="2" Margin="4" />
              <ComboBox Name="CmbOption1" Grid.Row="2" Style="{StaticResource fixedWidth}" />
              <TextBox Name="TxtParam1" Grid.Column="1" Grid.Row="2" Style="{StaticResource fixedWidth}" />
              <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="4 0">
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" Name="BtnAnd" Content="{Binding Path=And, Source={StaticResource Resources}}" Margin="4" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" Name="BtnOr" Content="{Binding Path=Or, Source={StaticResource Resources}}" Margin="4" />
              </StackPanel>
                            <ComboBox Name="CmbOption2" Grid.Row="4" Style="{StaticResource fixedWidth}" />
                            <TextBox Name="TxtParam2" Grid.Column="1" Grid.Row="4" Style="{StaticResource fixedWidth}" />
                            <StackPanel Grid.Row="8" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                                <Button Name="BtnOk" Content="{Binding Path=OK, Source={StaticResource Resources}}" Margin="4" Width="80" />
                                <Button Name="BtnCancel" Content="{Binding Path=Cancel, Source={StaticResource Resources}}" Margin="4" Width="80" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapMarginOptions -->
    <Style TargetType="local:C1OlapMarginOptions">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapMarginOptions">
                    <Grid x:Name="Root">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <TextBlock Text="{Binding Path=Margin, Source={StaticResource Resources}}" Margin="5" />
                            <TextBlock Text="{Binding Path=Top, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" />
                            <TextBlock Text="{Binding Path=Bottom, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" Grid.Row="4" />
                            <TextBlock Text="{Binding Path=Left, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" Grid.Row="2" />
                            <TextBlock Text="{Binding Path=Right, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" Grid.Row="6" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="TopMarginEditor" MinWidth="70" Grid.Column="2" Grid.Row="1" Value="{Binding TopMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="LeftMarginEditor" MinWidth="70" Grid.Column="2" Grid.Row="3" Value="{Binding LeftMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="BottomMarginEditor" MinWidth="70" Grid.Column="2" Grid.Row="5" Value="{Binding BottomMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="RightMarginEditor" MinWidth="70" Grid.Column="2" Grid.Row="7" Value="{Binding RightMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                        </Grid>
                        <Grid Grid.Column="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <TextBlock Text="{Binding Path=Padding, Source={StaticResource Resources}}" Margin="5" />
                            <TextBlock Text="{Binding Path=Top, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" />
                            <TextBlock Text="{Binding Path=Bottom, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" Grid.Row="4" />
                            <TextBlock Text="{Binding Path=Left, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" Grid.Row="2" />
                            <TextBlock Text="{Binding Path=Right, Source={StaticResource Resources}}" Margin="5" Grid.Column="2" Grid.Row="6" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="TopPaddingEditor" MinWidth="70" Grid.Column="2" Grid.Row="1" Value="{Binding TopPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="LeftPaddingEditor" MinWidth="70" Grid.Column="2" Grid.Row="3" Value="{Binding LeftPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="BottomPaddingEditor" MinWidth="70" Grid.Column="2" Grid.Row="5" Value="{Binding BottomPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                            <c1:C1NumericBox HorizontalAlignment="Left" Name="RightPaddingEditor" MinWidth="70" Grid.Column="2" Grid.Row="7" Value="{Binding RightPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapContentOptions -->
    <Style TargetType="local:C1OlapContentOptions">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapContentOptions">
                    <Grid x:Name="Root">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        
                        
            <Border BorderBrush="#FF96B9B9" BorderThickness="1" HorizontalAlignment="Stretch" Name="border1" VerticalAlignment="Stretch" Margin="5,20" CornerRadius="5">
              <StackPanel>
                <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="IncludeGrid" Margin="5,25,0,0" Padding="5,0,0,0" Content="{Binding Path=IncludeInReport, Source={StaticResource Resources}}" IsChecked="{Binding IncludeGrid, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                <TextBlock Text="{Binding Path=Scaling, Source={StaticResource Resources}}" Margin="5,25,0,5" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="GridActual" Margin="5,0,0,0" Padding="5,0,0,0" GroupName="GridScaling" Content="{Binding Path=ActualSize, Source={StaticResource Resources}}" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="GridSingle" Margin="5,10,0,0" Padding="5,0,0,0" GroupName="GridScaling" Content="{Binding Path=FitToOnePage, Source={StaticResource Resources}}" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="GridWidth" Margin="5,10,0,0" Padding="5,0,0,0" GroupName="GridScaling" Content="{Binding Path=FitToPageWidth, Source={StaticResource Resources}}" />
              </StackPanel>
            </Border>
            <Border BorderBrush="#FF96B9B9" BorderThickness="1" HorizontalAlignment="Stretch" Name="border2" VerticalAlignment="Stretch" Grid.Column="1" Margin="5,20" CornerRadius="5">
              <StackPanel>
                <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="IncludeChart" Margin="5,25,0,0" Padding="5,0,0,0" Content="{Binding Path=IncludeInReport, Source={StaticResource Resources}}" IsChecked="{Binding IncludeChart, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                <TextBlock Text="{Binding Path=Scaling, Source={StaticResource Resources}}" Margin="5,25,0,5" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="ChartSingle" Margin="5,0,0,0" Padding="5,0,0,0" GroupName="ChartScaling" Content="{Binding Path=FitToOnePage, Source={StaticResource Resources}}" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="ChartWidth" Margin="5,10,0,0" Padding="5,0,0,0" GroupName="ChartScaling" Content="{Binding Path=FitToPageWidth, Source={StaticResource Resources}}" />
              </StackPanel>
            </Border>
            <Border BorderBrush="#FF96B9B9" BorderThickness="1" HorizontalAlignment="Stretch" Name="border3" VerticalAlignment="Stretch" Grid.Column="2" Margin="5,20" CornerRadius="5">
              <StackPanel>
                <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="IncludeRaw" Margin="5,25,0,0" Padding="5,0,0,0" Content="{Binding Path=IncludeInReport, Source={StaticResource Resources}}" IsChecked="{Binding IncludeRaw, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                <TextBlock Text="{Binding Path=Scaling, Source={StaticResource Resources}}" Margin="5,25,0,5" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="RawActual" Margin="5,0,0,0" Padding="5,0,0,0" GroupName="RawScaling" Content="{Binding Path=ActualSize, Source={StaticResource Resources}}" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="RawSingle" Margin="5,10,0,0" Padding="5,0,0,0" GroupName="RawScaling" Content="{Binding Path=FitToOnePage, Source={StaticResource Resources}}" />
                <RadioButton TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="RawWidth" Margin="5,10,0,0" Padding="5,0,0,0" GroupName="RawScaling" Content="{Binding Path=FitToPageWidth, Source={StaticResource Resources}}" />
              </StackPanel>
            </Border>
                        <TextBlock Height="23" Name="textBlock1" Text="{Binding Path=OlapGrid, Source={StaticResource Resources}}" Margin="5" Grid.ColumnSpan="2" VerticalAlignment="Top" />
                        <TextBlock Grid.ColumnSpan="2" Height="23" Name="textBlock2" Text="{Binding Path=OlapChart, Source={StaticResource Resources}}" Grid.Column="1" Margin="5" VerticalAlignment="Top" />
                        <TextBlock Grid.ColumnSpan="2" Height="23" Margin="5" Name="textBlock3" Text="{Binding Path=RawData, Source={StaticResource Resources}}" VerticalAlignment="Top" Grid.Column="2" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapHeaderOptions -->
    <Style TargetType="local:C1OlapHeaderOptions">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapHeaderOptions">
                    <Grid x:Name="Root" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <TextBlock Name="textBlock1" HorizontalAlignment="Left" Grid.Row="1" Margin="5" Text="{Binding Path=Header, Source={StaticResource Resources}}" VerticalAlignment="Top" />
                        <TextBlock Name="textBlock2" HorizontalAlignment="Left" Grid.Row="3" Margin="5" Text="{Binding Path=Footer, Source={StaticResource Resources}}" VerticalAlignment="Top" />
                        <TextBox Name="HeaderLeft" Text="{Binding HeaderLeft, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="2" Margin="5" TextWrapping="Wrap" />
                        <TextBox Name="HeaderCenter" Text="{Binding HeaderCenter, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="1" Grid.Row="2" Margin="5" TextWrapping="Wrap" />
                        <TextBox Name="HeaderRight" Text="{Binding HeaderRight, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" Grid.Row="2" Margin="5" TextWrapping="Wrap" />
                        <TextBox Name="FooterLeft" Text="{Binding FooterLeft, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="4" Margin="5" TextWrapping="Wrap" />
                        <TextBox Name="FooterCenter" Text="{Binding FooterCenter, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="1" Grid.Row="4" Margin="5" TextWrapping="Wrap" />
                        <TextBox Name="FooterRight" Text="{Binding FooterRight, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" Grid.Row="4" Margin="5" TextWrapping="Wrap" />
                        
                        
            <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="HeaderSeparator" IsChecked="{Binding ShowHeaderSeparator, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Content="{Binding Path=Separator, Source={StaticResource Resources}}" Grid.Row="3" HorizontalAlignment="Left" Margin="5" Grid.Column="3" />
            <CheckBox TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="FooterSeparator" IsChecked="{Binding ShowFooterSeparator, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Content="{Binding Path=Separator, Source={StaticResource Resources}}" Grid.Row="5" HorizontalAlignment="Left" Margin="5" Grid.Column="3" />
                        <c1:C1Menu Name="PresetsMenu" Grid.ColumnSpan="3" Grid.Row="0" HorizontalAlignment="Left" Margin="5">
                            <c1:C1MenuItem x:Name="PageNumber" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=PageNumber, Source={StaticResource Resources}}">
                                <c1:C1MenuItem.Icon>
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/pages.png" Stretch="None" Margin="3" />
                                </c1:C1MenuItem.Icon>
                            </c1:C1MenuItem>
                            <c1:C1MenuItem x:Name="PageCount" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=TotalPageCount, Source={StaticResource Resources}}">
                                <c1:C1MenuItem.Icon>
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/pages.png" Stretch="None" Margin="3" />
                                </c1:C1MenuItem.Icon>
                            </c1:C1MenuItem>
                            <c1:C1Separator />
                            <c1:C1MenuItem x:Name="CurrentDate" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=CurrentDate, Source={StaticResource Resources}}">
                                <c1:C1MenuItem.Icon>
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/date.png" Stretch="None" Margin="3" />
                                </c1:C1MenuItem.Icon>
                            </c1:C1MenuItem>
                            <c1:C1MenuItem x:Name="CurrentTime" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=CurrentTime, Source={StaticResource Resources}}">
                                <c1:C1MenuItem.Icon>
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/time.png" Stretch="None" Margin="3" />
                                </c1:C1MenuItem.Icon>
                            </c1:C1MenuItem>
                            <c1:C1Separator />
                            <c1:C1MenuItem x:Name="Title" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Title, Source={StaticResource Resources}}">
                                <c1:C1MenuItem.Icon>
                                    <Image Source="/C1.WPF.Olap.4;component/Resources/title.png" Stretch="None" Margin="3" />
                                </c1:C1MenuItem.Icon>
                            </c1:C1MenuItem>
                        </c1:C1Menu>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1OlapReportOptions -->
    <Style TargetType="local:C1OlapReportOptions">
         <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="BottomMargin" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1OlapReportOptions">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="Root">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <!-- main content -->
                            <c:TabControl Name="Tab">
                                <c:TabItem Header="{Binding Path=Page, Source={StaticResource Resources}}" Name="TabPage">
                                    <local:C1OlapMarginOptions x:Name="MarginOptions" Foreground="{TemplateBinding Foreground}" LeftMargin="{Binding LeftMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" TopMargin="{Binding TopMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" BottomMargin="{Binding BottomMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" RightMargin="{Binding RightMargin, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" LeftPadding="{Binding LeftPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" TopPadding="{Binding TopPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" BottomPadding="{Binding BottomPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" RightPadding="{Binding RightPadding, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=HeaderFooter, Source={StaticResource Resources}}" Name="TabHeader">
                                    <local:C1OlapHeaderOptions x:Name="HeaderOptions" Foreground="{TemplateBinding Foreground}" HeaderLeft="{Binding HeaderLeft, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" HeaderCenter="{Binding HeaderCenter, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" HeaderRight="{Binding HeaderRight, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" FooterLeft="{Binding FooterLeft, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" FooterCenter="{Binding FooterCenter, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" FooterRight="{Binding FooterRight, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ShowHeaderSeparator="{Binding ShowHeaderSeparator, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ShowFooterSeparator="{Binding ShowFooterSeparator, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                                </c:TabItem>
                                <c:TabItem Header="{Binding Path=ReportContent, Source={StaticResource Resources}}" Name="TabContent">
                                    <local:C1OlapContentOptions x:Name="ContentOptions" Foreground="{TemplateBinding Foreground}" IncludeGrid="{Binding IncludeGrid, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IncludeChart="{Binding IncludeChart, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IncludeRaw="{Binding IncludeRaw, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" GridScale="{Binding GridScale, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ChartScale="{Binding ChartScale, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" RawScale="{Binding RawScale, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                                </c:TabItem>
                            </c:TabControl>
                            <!-- OK, Cancel buttons -->
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
                                <Button x:Name="BtnOk" Content="{Binding Path=OK, Source={StaticResource Resources}}" Width="75" Margin="4" />
                                <Button x:Name="BtnCancel" Content="{Binding Path=Cancel, Source={StaticResource Resources}}" Width="75" Margin="4" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- PrintPageTemplate -->
    <Style TargetType="local:PrintPageTemplate">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PrintPageTemplate">
                    <Grid x:Name="Root">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="96" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="96" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="96" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="96" />
                        </Grid.ColumnDefinitions>
                        <!-- header -->
                        <Border x:Name="HeaderSeparator" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="0 12" BorderBrush="Black" BorderThickness="0 0 0 1" />
                        <Grid Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="0 12">
                            <TextBlock x:Name="HeaderLeft" Text="{TemplateBinding HeaderLeft}" VerticalAlignment="Bottom" HorizontalAlignment="Left" />
                            <TextBlock x:Name="HeaderCenter" Text="{TemplateBinding HeaderCenter}" VerticalAlignment="Bottom" HorizontalAlignment="Center" />
                            <TextBlock x:Name="HeaderRight" Text="{TemplateBinding HeaderRight}" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                        </Grid>
                        <!-- footer -->
                        <Border x:Name="FooterSeparator" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 12" BorderBrush="Black" BorderThickness="0 1 0 0" />
                        <Grid Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 12">
                            <TextBlock x:Name="FooterLeft" Text="{TemplateBinding FooterLeft}" VerticalAlignment="Bottom" HorizontalAlignment="Left" />
                            <TextBlock x:Name="FooterCenter" Text="{TemplateBinding FooterCenter}" VerticalAlignment="Bottom" HorizontalAlignment="Center" />
                            <TextBlock x:Name="FooterRight" Text="{TemplateBinding FooterRight}" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                        </Grid>
                        <Grid x:Name="PaddingGrid" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Left">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="0" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="0" />
                            </Grid.ColumnDefinitions>
                            
                            
        					<Viewbox x:Name="ContentBox" Grid.Row="1" Grid.Column="1" Stretch="{TemplateBinding Stretch}">
								<ContentPresenter></ContentPresenter>
							</Viewbox>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>