<?xml version="1.0" encoding="utf-8"?>
<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="http://schemas.componentone.com/winfx/2006/xaml"
                    xmlns:res="clr-namespace:C1.WPF.GanttView.Resources" 
                    xmlns:c1GanttView="clr-namespace:C1.WPF.GanttView" 
                    xmlns:system="clr-namespace:System;assembly=mscorlib">

    <c1:VisibilityConverter x:Key="VisibilityConverter"/>
    <res:Resources x:Key="Resources" />
    <c1GanttView:CalendarTodayCommand x:Key="TodayCommand"/>

    <Style x:Key="MenuIcon" TargetType="Image">
        <Setter Property="Margin" Value="3" />
        <Setter Property="Stretch" Value="None" />
    </Style>

    <Style x:Key="DropDownMenuItem" TargetType="{x:Type c1:C1MenuItem}">
        <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource TemplatedParent}}" />
    </Style>

    <Style x:Key="CheckableDropDownMenuItem" TargetType="{x:Type c1:C1MenuItem}" BasedOn="{StaticResource DropDownMenuItem}">
        <Setter Property="IsCheckable" Value="True"/>
    </Style>

    <Style x:Key="ToolBarSeparator" TargetType="{x:Type c1:C1Separator}">
        <Setter Property="Orientation" Value="Vertical"/>
    </Style>

    <Style x:Key="ContextMenuSeparator" TargetType="{x:Type Separator}">
        <Setter Property="Height" Value="2"/>
        <Setter Property="Visibility" Value="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}"/>
    </Style>

    <!--C1GanttView-->
    <Style TargetType="c1GanttView:C1GanttView">
        <Setter Property="HighlightBackColor" Value="#A0BADDE9"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1GanttView:C1GanttView">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <!-- toolstrip across the top, content below: grid, splitter, chart -->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="300" />
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <!-- tool strip across the top -->
                            <ToolBar Grid.ColumnSpan="3" x:Name="MainToolBar" ToolBarTray.IsLocked="True" BorderBrush="{x:Null}" Height="{TemplateBinding ToolbarHeight}" Visibility="{TemplateBinding ShowToolbar, Converter={StaticResource VisibilityConverter}}" Background="{TemplateBinding ToolbarBackColor}">
                                <ToolBar.DataContext>
                                    <c1GanttView:ToolBarViewModel />
                                </ToolBar.DataContext>
                                <!--save/load-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding LoadCommand}" ToolTipService.ToolTip="{Binding ToolTip_Load,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/open.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding SaveCommand}" ToolTipService.ToolTip="{Binding ToolTip_Save,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/save.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--undo/redo-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding UndoCommand}" ToolTipService.ToolTip="{Binding ToolTip_Undo,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/undo.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding RedoCommand}" ToolTipService.ToolTip="{Binding ToolTip_Redo,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/redo.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--grid columns-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowGridColumnsDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_GridColumns,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/gridcolumns.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--move task-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding MoveTaskUpCommand}" ToolTipService.ToolTip="{Binding ToolTip_TaskUp,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/movetaskup.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding MoveTaskDownCommand}" ToolTipService.ToolTip="{Binding ToolTip_TaskDown,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/movetaskdown.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--task info-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowTaskInfoDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_TaskInfo,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/taskinfo.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--fieldstyles-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowFieldStylesDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_FieldStyles,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/fieldstyles.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--task manipulate-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding AddTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_AddTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/addtask.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding AddSummaryTask}" ToolTipService.ToolTip="{Binding ToolTip_AddSummaryTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/addsummarytask.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding InactiveTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_Inactive,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Viewbox Width="16" Stretch="Uniform">
                                            <Path Data="M0.5,20.5 C0.5,9.4543 9.4543,0.5 20.5,0.5 L143.5,0.5 C154.546,0.5 163.5,9.4543 163.5,20.5 L163.5,71.5 C163.5,82.5457 154.546,91.5 143.5,91.5 L20.5,91.5 C9.4543,91.5 0.5,82.5457 0.5,71.5 z M10.5,20.5 C10.5,14.9771 14.9771,10.5 20.5,10.5 L143.5,10.5 C149.023,10.5 153.5,14.9771 153.5,20.5 L153.5,71.5 C153.5,77.0229 149.023,81.5 143.5,81.5 L20.5,81.5 C14.9771,81.5 10.5,77.0229 10.5,71.5 z" Fill="{TemplateBinding Foreground}" />
                                        </Viewbox>
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding SplitTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_SplitTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/splittask.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding AddBlankRowCommand}" ToolTipService.ToolTip="{Binding ToolTip_AddBlankRow,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/addblankrow.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding DeleteTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_DeleteTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/deletetask.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding OutdentTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_OutdentTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/outdent.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding IndentTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_IndentTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/indent.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowProjectSummary}" ToolTipService.ToolTip="{Binding ToolTip_ShowProjectSummary,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/showprojectsummary.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <!--group-->
                                <c1:C1ToolbarDropDown x:Name="MenuGroup" ToolTipService.ToolTip="{Binding ToolTip_GroupBy,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarDropDown.Header>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/groupby.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarDropDown.Header>
                                    <c1:C1MenuList>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuTaskMode" Command="{Binding GroupByTaskModeCommand}" Header="{Binding MenuItem_GroupBy_TaskMode,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuTaskComplete" Command="{Binding GroupByTaskCompeletedCommand}" Header="{Binding MenuItem_GroupBy_TaskCompleteVsTaskIncomplete,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuDuration" Command="{Binding GroupByDurationCommand}" Header="{Binding MenuItem_GroupBy_Duration,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuMilestones" Command="{Binding GroupByMilestoneCommand}" Header="{Binding MenuItem_GroupBy_Milestones,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuResource" Command="{Binding GroupByResourceCommand}" Header="{Binding MenuItem_GroupBy_Resource,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuStatus" Command="{Binding GroupByStatusDateCommand}" Header="{Binding MenuItem_GroupBy_Status,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="GroupItems" x:Name="MenuConstraintType" Command="{Binding GroupByConstraintTypeCommand}" Header="{Binding MenuItem_GroupBy_ConstraintType,Source={StaticResource Resources}}"/>
                                        <c1:C1Separator />
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" x:Name="MenuClearGroup" Command="{Binding ClearGroupCommand}" Header="{Binding MenuItem_GroupBy_ClearGroup,Source={StaticResource Resources}}" />
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" x:Name="MenuNewGroupBy" Command="{Binding ShowGroupByCommand}" Header="{Binding MenuItem_GroupBy_NewGroupBy,Source={StaticResource Resources}}" />
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" x:Name="MenuMaintainHierarchy" Command="{Binding MaintainHierarchyCommand}" Header="{Binding MenuItem_GroupBy_MaintainHierarchy,Source={StaticResource Resources}}"/>
                                    </c1:C1MenuList>
                                </c1:C1ToolbarDropDown>
                                <!--sort/filter-->
                                <c1:C1ToolbarDropDown ToolTipService.ToolTip="{Binding ToolTip_Filter,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarDropDown.Header>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/filter.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarDropDown.Header>
                                    <c1:C1MenuList>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuNoFilter" Command="{Binding NoFilterCommand}" Header="{Binding MenuItem_NoFilter,Source={StaticResource Resources}}" IsChecked="True"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuCompletedTasks" Command="{Binding FilterByCompletedTasksCommand}" Header="{Binding MenuItem_CompletedTasks,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuDateRange" Command="{Binding FilterByDateRangeCommand}" Header="{Binding MenuItem_DateRange,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuIncompleteTasks" Command="{Binding FilterByIncompleteTasksCommand}" Header="{Binding MenuItem_IncompleteTasks,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuLateTasks" Command="{Binding FilterByLateTasksCommand}" Header="{Binding MenuItem_LateTasks,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuMilestoneTasks" Command="{Binding FilterByMilestoneTasksCommand}" Header="{Binding MenuItem_Milestones,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuSummaryTasks" Command="{Binding FilterBySummaryTasksCommand}" Header="{Binding MenuItem_SummaryTasks,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuDurationOnlyTasks" Command="{Binding FilterByDurationOnlyTasksCommand}" Header="{Binding MenuItem_TaskWithDurationOnly,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuUsingResource" Command="{Binding FilterByUsingResourceCommand}" Header="{Binding MenuItem_UsingResource,Source={StaticResource Resources}}"/>
                                        <c1:C1Separator />
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="FilterItems" x:Name="MenuAdvancedFilter" Command="{Binding ShowAdvancedFilterCommand}" Header="{Binding MenuItem_AdvancedFilter,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" GroupName="FilterItems" Command="{Binding ShowMoreFiltersCommand}" Header="{Binding MenuItem_MoreFilters,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" x:Name="MenuShowRelatedSummary" Command="{Binding ShowRelatedSummaryRowsCommand}" Header="{Binding MenuItem_ShowRelatedSummaryRows,Source={StaticResource Resources}}"/>
                                    </c1:C1MenuList>
                                </c1:C1ToolbarDropDown>
                                <c1:C1ToolbarDropDown ToolTipService.ToolTip="{Binding ToolTip_Sort,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarDropDown.Header>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/sort.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarDropDown.Header>
                                    <c1:C1MenuList>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="SortItems" x:Name="MenuByName" Command="{Binding SortByNameCommand}" Header="{Binding MenuItem_ByName,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="SortItems" x:Name="MenuByStart" Command="{Binding SortByStartCommand}" Header="{Binding MenuItem_ByStartDate,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="SortItems" x:Name="MenuByFinish" Command="{Binding SortByFinishCommand}" Header="{Binding MenuItem_ByFinishDate,Source={StaticResource Resources}}"/>
                                        <c1:C1MenuItem Style="{StaticResource CheckableDropDownMenuItem}" GroupName="SortItems" x:Name="MenuByDuration" Command="{Binding SortByDurationCommand}" Header="{Binding MenuItem_ByDuration,Source={StaticResource Resources}}"/>
                                        <c1:C1Separator />
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" Command="{Binding NoSortCommand}" Header="{Binding MenuItem_RemoveSort,Source={StaticResource Resources}}" />
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" Command="{Binding ShowSortDialogCommand}" Header="{Binding MenuItem_SortBy,Source={StaticResource Resources}}">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/sort.png" Style="{StaticResource MenuIcon}" />
                                            </c1:C1MenuItem.Icon>
                                        </c1:C1MenuItem>
                                    </c1:C1MenuList>
                                </c1:C1ToolbarDropDown>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--project-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowProjectInfoDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_ProjectInfo,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/projectinfo.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowWorkingTimeDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_WorkingTime,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/workingtime.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowProgressLineDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_ProgressLine,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/progresslines.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowResourceDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_Resources,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/resource.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--timescale-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowTimescaleDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_TimeScale,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/timescale.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <!--barstyle-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowBarStylesDialogCommand}" ToolTipService.ToolTip="{Binding ToolTip_BarStyle,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/barstyles.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ScrollToTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_ScrollToTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/scrolltotask.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <c1:C1ToolbarDropDown x:Name="MenuZoom" ToolTipService.ToolTip="{Binding ToolTip_Zoom,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarDropDown.Header>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/zoom.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarDropDown.Header>
                                    <c1:C1MenuList>
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" Command="{Binding ZoomInCommand}" Header="{Binding MenuItem_ZoomIn,Source={StaticResource Resources}}">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/zoomin.png" Style="{StaticResource MenuIcon}" />
                                            </c1:C1MenuItem.Icon>
                                        </c1:C1MenuItem>
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" Command="{Binding ZoomOutCommand}" Header="{Binding MenuItem_ZoomOut,Source={StaticResource Resources}}">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/zoomout.png" Style="{StaticResource MenuIcon}" />
                                            </c1:C1MenuItem.Icon>
                                        </c1:C1MenuItem>
                                        <c1:C1Separator Orientation="Vertical" />
                                        <c1:C1MenuItem Style="{StaticResource DropDownMenuItem}" Command="{Binding ShowZoomDialogCommand}" Header="{Binding MenuItem_ZoomDialog,Source={StaticResource Resources}}">
                                            <c1:C1MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/zoom.png" Style="{StaticResource MenuIcon}" />
                                            </c1:C1MenuItem.Icon>
                                        </c1:C1MenuItem>
                                    </c1:C1MenuList>
                                </c1:C1ToolbarDropDown>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ZoomEntireProjectCommand}" ToolTipService.ToolTip="{Binding ToolTip_ZoomEntireProject,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/zoomentireproject.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ZoomSelectedTaskCommand}" ToolTipService.ToolTip="{Binding ToolTip_ZoomSelectedTask,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/zoomselectedtask.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                                <c1:C1Separator Style="{StaticResource ToolBarSeparator}"/>
                                <!--print-->
                                <c1:C1ToolbarButton CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding PrintCommand}" ToolTipService.ToolTip="{Binding ToolTip_Print,Source={StaticResource Resources}}">
                                    <c1:C1ToolbarButton.Content>
                                        <Image Source="/C1.WPF.GanttView.4;component/Resources/print.png" Style="{StaticResource MenuIcon}" />
                                    </c1:C1ToolbarButton.Content>
                                </c1:C1ToolbarButton>
                            </ToolBar>
                            <!-- grid view on the left -->
                            <c1GanttView:GridView x:Name="GridView" Foreground="{TemplateBinding Foreground}" Grid.Row="1" RowHeaderForeground="{TemplateBinding ViewHeaderForeground}" ColumnHeaderForeground="{TemplateBinding ViewHeaderForeground}" RowBackground="Transparent" IsReadOnly="{TemplateBinding ReadOnly}" AllowResizing="Both" GridLinesVisibility="All" EditorBackground="Transparent" VerticalScrollBarVisibility="Hidden" SelectionBackground="{TemplateBinding HighlightBackColor}" SelectionForeground="{TemplateBinding HighlightForeColor}" Background="{TemplateBinding Background}">
                                <c1GanttView:GridView.Resources>
                                    <Style TargetType="c1:C1DatePicker">
                                        <Setter Property="CalendarStyle">
                                            <Setter.Value>
                                                <Style TargetType="{x:Type Calendar}">
                                                    <Setter Property="Template">
                                                        <Setter.Value>
                                                            <ControlTemplate TargetType="{x:Type Calendar}">
                                                                <Grid Height="180">
                                                                    <CalendarItem Background="{TemplateBinding Control.Background}" BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="{TemplateBinding Control.BorderThickness}" Name="PART_CalendarItem" Style="{TemplateBinding Calendar.CalendarItemStyle}" />
                                                                    <Button Grid.Row="1" Content="{c1GanttView:GanttViewLocalize Assembly=C1.WPF.GanttView.4,Key=Common:Text_Today,DefaultValue=Today}" Command="{StaticResource TodayCommand}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Bottom" Margin="45,5" FontSize="10" />
                                                                </Grid>
                                                            </ControlTemplate>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Style>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </c1GanttView:GridView.Resources>
                                <c1GanttView:GridView.ContextMenu>
                                    <ContextMenu>
                                        <ContextMenu.DataContext>
                                            <c1GanttView:GridViewContextMenuViewModel />
                                        </ContextMenu.DataContext>
                                        <MenuItem Visibility="{Binding ShowColumnHeaderMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowGridColumnsDialogCommand}" Header="{Binding ToolTip_GridColumns,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/gridcolumns.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowTaskInfoDialogCommand}" Header="{Binding ToolTip_TaskInfo,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/taskinfo.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowFieldStylesDialogCommand}" Header="{Binding ToolTip_FieldStyles,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/fieldstyles.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <Separator Style="{StaticResource ContextMenuSeparator}"/>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding AddTaskCommand}" Header="{Binding ToolTip_AddTask,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/addtask.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding AddSummaryTask}" Header="{Binding ToolTip_AddSummaryTask,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/addsummarytask.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding AddBlankRowCommand}" Header="{Binding ToolTip_AddBlankRow,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/addblankrow.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding DeleteTaskCommand}" Header="{Binding ToolTip_DeleteTask,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/deletetask.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <Separator Style="{StaticResource ContextMenuSeparator}"/>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ScrollToTaskCommand}" Header="{Binding ToolTip_ScrollToTask,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/scrolltotask.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding MoveTaskUpCommand}" Header="{Binding ToolTip_TaskUp,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/movetaskup.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding MoveTaskDownCommand}" Header="{Binding ToolTip_TaskDown,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/movetaskdown.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                    </ContextMenu>
                                </c1GanttView:GridView.ContextMenu>
                            </c1GanttView:GridView>
                            <!-- splitter in the middle -->
                            <c:GridSplitter x:Name="Splitter" Grid.Column="1" Grid.Row="1" Width="5" Background="{TemplateBinding SplitterColor}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Focusable="False"/>
                            <!-- chart view on the right -->
                            <c1GanttView:ChartView x:Name="ChartView" Foreground="{TemplateBinding Foreground}" ColumnHeaderForeground="{TemplateBinding ViewHeaderForeground}"  Grid.Row="1" Grid.Column="2" RowBackground="Transparent" IsReadOnly="{TemplateBinding ReadOnly}" AutoGenerateColumns="False" HeadersVisibility="Column" AllowDragging="None" AllowResizing="Rows" AllowMerging="All"  GridLinesVisibility="None" CursorBackground="Transparent" SelectionMode="Cell" Background="{TemplateBinding Background}">
                                <c1GanttView:ChartView.ContextMenu>
                                    <ContextMenu>
                                        <ContextMenu.DataContext>
                                            <c1GanttView:ChartViewContextMenuViewModel />
                                        </ContextMenu.DataContext>
                                        <MenuItem Visibility="{Binding ShowColumnHeaderMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowTimescaleDialogCommand}" Header="{Binding ToolTip_TimeScale,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/timescale.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowColumnHeaderMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowZoomDialogCommand}" Header="{Binding MenuItem_ZoomDialog,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/zoom.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowTaskInfoDialogCommand}" Header="{Binding ToolTip_TaskInfo,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/taskinfo.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowWorkingTimeDialogCommand}" Header="{Binding ToolTip_WorkingTime,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/workingtime.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowBarStylesDialogCommand}" Header="{Binding ToolTip_BarStyle,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/barstyles.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowLayoutDialogCommand}" Header="{Binding Title_Layout,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/layout.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <Separator Style="{StaticResource ContextMenuSeparator}"/>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding ShowProgressLineDialogCommand}" Header="{Binding ToolTip_ProgressLine,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/progresslines.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding DeleteTaskCommand}" Header="{Binding ToolTip_DeleteTask,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/deletetask.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Visibility="{Binding ShowCellMenu,Converter={StaticResource VisibilityConverter}}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding SplitTaskCommand}" Header="{Binding ToolTip_SplitTask,Source={StaticResource Resources}}">
                                            <MenuItem.Icon>
                                                <Image Source="/C1.WPF.GanttView.4;component/Resources/splittask.png" />
                                            </MenuItem.Icon>
                                        </MenuItem>
                                    </ContextMenu>
                                </c1GanttView:ChartView.ContextMenu>
                            </c1GanttView:ChartView>
                            <Grid x:Name="NotificationGrid" Grid.RowSpan="2" Grid.Column="3"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>