<?xml version="1.0" encoding="utf-8"?>
<Application x:Class="OlapTemplate.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:res="clr-namespace:C1.Silverlight.Olap.Resources;assembly=C1.Silverlight.Olap.5" xmlns:c="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
    <Application.Resources>
        <res:Resources x:Key="Resources" />
        <Style x:Key="OlapPageStyle" TargetType="c1:C1OlapPage">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="c1: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 x:Key="menuItem" TargetType="c1:C1MenuItem">
                                        <Setter Property="Padding" Value="3" />
                                    </Style>
                                    <Style x:Key="menuIcon" TargetType="Image">
                                        <Setter Property="Stretch" Value="None" />
                                        <Setter Property="Margin" Value="4 0" />
                                    </Style>
                                </Grid.Resources>
                                <!-- menu across the top, content below: panel, splitter, tab -->
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <!-- menu across the top -->
                                <c1:C1Menu x:Name="MainMenu" Grid.ColumnSpan="3" Height="30">
                                    <!-- open/save -->
                                    <c1:C1MenuItem x:Name="MenuOpen" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=LoadViewFromFile, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/open.png" Stretch="None" Margin="3" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <c1:C1MenuItem x:Name="MenuSave" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=SaveViewToFile, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/save.png" Stretch="None" Margin="3" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <c1:C1MenuItem x:Name="MenuExport" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Export, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/export.png" Stretch="None" Margin="3" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <!-- spacer -->
                                    <c1:C1MenuItem Width="4" />
                                    <!-- undo/redo -->
                                    <c1:C1MenuItem x:Name="MenuUndo" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Undo, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/undo.png" Stretch="None" Margin="3" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <c1:C1MenuItem x:Name="MenuRedo" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=Redo, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/redo.png" Stretch="None" Margin="3" />
                                        </c1:C1MenuItem.Icon>
                                    </c1:C1MenuItem>
                                    <!-- spacer -->
                                    <c1:C1MenuItem Width="4" />
                                    <!-- customize grid -->
                                    <c1:C1MenuItem x:Name="_mnuView" Header="{Binding Path=Grid, Source={StaticResource Resources}}" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=CustomizeGridView, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/grid.png" Style="{StaticResource menuIcon}" />
                                        </c1:C1MenuItem.Icon>
                                        <c1:C1MenuItem x:Name="_mnuTotalRows" Header="{Binding Path=TotalRows, Source={StaticResource Resources}}" Style="{StaticResource menuItem}">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.Silverlight.Olap.5;component/Resources/totalRows.png" Style="{StaticResource menuIcon}" />
                                            </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}}" Style="{StaticResource menuItem}">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.Silverlight.Olap.5;component/Resources/totalColumns.png" Style="{StaticResource menuIcon}" />
                                            </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" Style="{StaticResource menuItem}" />
                                    </c1:C1MenuItem>
                                    <!-- customize chart -->
                                    <c1:C1MenuItem x:Name="_mnuChart" Header="{Binding Path=Chart, Source={StaticResource Resources}}" VerticalAlignment="Center" ToolTipService.ToolTip="Customize Chart view">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/chart.png" Style="{StaticResource menuIcon}" />
                                        </c1:C1MenuItem.Icon>
                                        <c1:C1MenuItem x:Name="MenuChartType" Header="{Binding Path=ChartType, Source={StaticResource Resources}}" Style="{StaticResource menuItem}" />
                                        <c1:C1MenuItem x:Name="MenuPalette" Header="{Binding Path=Palette, Source={StaticResource Resources}}" Style="{StaticResource menuItem}" />
                                        <c1:C1Separator />
                                        <c1:C1MenuItem x:Name="MenuTitle" Header="{Binding Path=ShowTitle, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" Style="{StaticResource menuItem}" />
                                        <c1:C1MenuItem x:Name="MenuGridlines" Header="{Binding Path=ShowGridLines, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" Style="{StaticResource menuItem}" />
                                        <c1:C1MenuItem x:Name="MenuStacked" Header="{Binding Path=Stacked, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="True" Style="{StaticResource menuItem}" />
                                        <c1:C1MenuItem x:Name="MenuTotalsOnly" Header="{Binding Path=TotalsOnly, Source={StaticResource Resources}}" IsCheckable="True" IsChecked="False" Style="{StaticResource menuItem}" />
                                    </c1:C1MenuItem>
                                    <!-- print -->
                                    <c1:C1MenuItem x:Name="_mnuPrint" Header="{Binding Path=Report, Source={StaticResource Resources}}" VerticalAlignment="Center" ToolTipService.ToolTip="{Binding Path=GenerateReports, Source={StaticResource Resources}}">
                                        <c1:C1MenuItem.Icon>
                                            <Image Source="/C1.Silverlight.Olap.5;component/Resources/report.png" Style="{StaticResource menuIcon}" />
                                        </c1:C1MenuItem.Icon>
                                        <c1:C1MenuItem x:Name="MenuPrint" Header="{Binding Path=Print, Source={StaticResource Resources}}" VerticalAlignment="Center">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.Silverlight.Olap.5;component/Resources/print.png" Style="{StaticResource menuIcon}" />
                                            </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.Silverlight.Olap.5;component/Resources/options.png" Style="{StaticResource menuIcon}" />
                                            </c1:C1MenuItem.Icon>
                                        </c1:C1MenuItem>
                                    </c1:C1MenuItem>
                                </c1:C1Menu>
                                <!-- tab control on the left -->
                                <Grid Grid.Row="1">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <c:TabControl x:Name="Tab" Background="WhiteSmoke" Margin="4">
                                        <c:TabItem x:Name="TabGrid" Header="{Binding Path=OlapGrid, Source={StaticResource Resources}}">
                                            <c1:C1OlapGrid x:Name="OlapGrid" Background="WhiteSmoke" RowBackground="White" AlternatingRowBackground="#fffcfcff" />
                                        </c:TabItem>
                                        <c:TabItem x:Name="TabRawData" Header="{Binding Path=RawData, Source={StaticResource Resources}}">
                                            <c1:C1FlexGrid x:Name="RawDataGrid" Background="WhiteSmoke" RowBackground="White" AlternatingRowBackground="#fffcfcff" />
                                        </c:TabItem>
                                    </c:TabControl>
                                    <c1:C1OlapChart x:Name="OlapChart" Grid.Row="1" />
                                </Grid>
                                <!-- splitter in the middle -->
                                <c:GridSplitter Grid.Column="1" Grid.Row="1" Width="5" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Stretch" />
                                <!-- olap panel on the right -->
                                <c1:C1OlapPanel x:Name="OlapPanel" Grid.Row="1" Grid.Column="2" Margin="4 12 4 4" />
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>