<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:system="clr-namespace:System;assembly=mscorlib">


    <!-- MESSAGE ERROR TEMPLATE -->
    <!--////////////////////////////////////////////////////////////////////-->
    <ControlTemplate x:Key="Template.Message.Error" TargetType="ContentControl">
        <Grid x:Name="Root">
            <Border Background="{DynamicResource Color.BackgroundMessage}">
                <Border.Effect>
                    <BlurEffect Radius="12"/>
                </Border.Effect>
            </Border>

            <Border Padding="24,0,24,0">
                <!-- The ContentPresenter displays the content of the message -->
                <!-- The content is a text string which can be defined in the Content property in the control that loads this template -->
                <ContentPresenter
                    x:Name="Message.Error.Content"
                    TextBlock.FontFamily="{DynamicResource Font.CoreSans}"
                    TextBlock.FontSize="{DynamicResource Font.Size.Body}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"/>
            </Border>
        </Grid>
    </ControlTemplate>

    <!-- CRAFTING MESSAGE ERRORS -->
    <!-- Error messages used in crafting -->
    <Style x:Key="Style.Message.Error.Crafting" TargetType="ContentControl">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Foreground" Value="{DynamicResource Color.TextError}"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Visibility" Value="Hidden" />
        <Setter Property="Template" Value="{DynamicResource Template.Message.Error}" />

        <!-- These triggers control when we display an error message and the content of the message based -->
        <!-- on whether the player has the necessary materials and/or has enough free space in their inventory -->
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding RecipePanel.Details.Recipe.HasMaterials}" Value="False"/>
                    <Condition Binding="{Binding RecipePanel.Details.Recipe.HasSpace}" Value="True"/>
                </MultiDataTrigger.Conditions>

                <Setter Property="Visibility" Value="Visible"/>
                <Setter Property="Content" Value="You don't have the necessary materials"/>
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding RecipePanel.Details.Recipe.HasMaterials}" Value="True"/>
                    <Condition Binding="{Binding RecipePanel.Details.Recipe.HasSpace}" Value="False"/>
                </MultiDataTrigger.Conditions>

                <Setter Property="Visibility" Value="Visible"/>
                <Setter Property="Content" Value="Your inventory is full"/>
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding RecipePanel.Details.Recipe.HasMaterials}" Value="False"/>
                    <Condition Binding="{Binding RecipePanel.Details.Recipe.HasSpace}" Value="False"/>
                </MultiDataTrigger.Conditions>

                <Setter Property="Visibility" Value="Visible"/>
                <Setter Property="Content" Value="You don't have the necessary materials"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>

