<UserControl x:Class="TaskIt.Modules.Tasks.Core.DataTemplateProvider"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:core="clr-namespace:TaskIt.Modules.Tasks.Core" xmlns:System="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <System:Double x:Key="DropShadowOpacity">0.5</System:Double>
        <System:Double x:Key="DropShadowDepth">3</System:Double>
        <telerikControls:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <telerikControls:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
        <core:TreeViewNodeDataTemplateSelector x:Key="DataTemplateSelector" />
        <core:DefaultValueConverter x:Key="DefaultValueConverter" />

        <Color x:Key="DropPossibleBackgroundColor1">#FFFFC979</Color>
        <Color x:Key="DropPossibleBackgroundColor2">#FFFF9600</Color>
        <LinearGradientBrush x:Key="DropPossibleBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="{StaticResource DropPossibleBackgroundColor1}" Offset="0"/>
            <GradientStop Color="{StaticResource DropPossibleBackgroundColor2}" Offset="1"/>
        </LinearGradientBrush>

        <DataTemplate x:Key="DragDropApprovalIconsTemplate">
            <Grid>
                <Image Source="../Assets/Images/Icons/DropApproved.png" Width="16" Height="16" Visibility="{Binding Converter={StaticResource BooleanToVisibilityConverter}}" />
                <Image Source="..Assets/Images/Icons/DropNotApproved.png" Width="16" Height="16" Visibility="{Binding Converter={StaticResource InvertedBooleanToVisibilityConverter}}" />
            </Grid>
        </DataTemplate>

        <!--The DragCue can be anything, in our case it is a an ItemsControl displaying the payload. -->
        <DataTemplate x:Key="DragCueTemplate">
            <Border>
                <Grid Width="300">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Border Background="{StaticResource FrameInnerBackgroundBrush}" BorderBrush="{StaticResource PopupBorderBrush}" BorderThickness="2" CornerRadius="6" Padding="4" Opacity=".6" Grid.Row="2">
                        <Border.Effect>
                            <DropShadowEffect ShadowDepth="{StaticResource DropShadowDepth}" Opacity="{StaticResource DropShadowOpacity}"/>
                        </Border.Effect>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Foreground="{StaticResource ControlForegroundBrush}" Text="{Binding Message}" TextWrapping="Wrap"/>
                        </StackPanel>
                    </Border>
                    <!--<Image Source="{Binding IconPath, Converter={StaticResource DefaultValueConverter}, ConverterParameter=../Assets/Images/Icons/DragInfoIcon.png}"
                      Width="48" Height="48" HorizontalAlignment="Center" Margin="0 0 0 -15" />-->
                </Grid>
            </Border>
        </DataTemplate>

        <telerikControls:HierarchicalDataTemplate x:Key="ParentNodeTemplate" ItemsSource="{Binding Children}">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconCategories, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="{Binding Image}"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </telerikControls:HierarchicalDataTemplate>
        <DataTemplate x:Key="TaskCategoryAllTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconInbox, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/AllCategories.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TaskCategoryInboxTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconInbox, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Inbox.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TaskCategoryActionsTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconActions, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Actions.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TaskCategoryWaitingTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconWaiting, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Waiting.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TaskCategorySomedayTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconSomeday, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Someday.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TaskCategoryTicklersTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconTicklers, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Ticklers.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="TaskCategoryReferenceTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconReference, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Reference.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="ProjectTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconProject, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Project.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="ContextTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconContext, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Context.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="ContactTemplate">
            <StackPanel Orientation="Horizontal">
                <!--<Image Source="{Binding ViewModel.IconContact, Source={StaticResource DataContextProxy}}"/>-->
                <Image Source="../Assets/Images/Icons/Person.png"/>
                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>
</UserControl>
