<UserControl xmlns="https://github.com/avaloniaui"
             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:conditionTypes="clr-namespace:Artemis.UI.Screens.ProfileEditor.DisplayCondition.ConditionTypes"
             xmlns:dataModelPicker="clr-namespace:Artemis.UI.Shared.DataModelPicker;assembly=Artemis.UI.Shared"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Artemis.UI.Screens.ProfileEditor.DisplayCondition.ConditionTypes.EventConditionView"
             x:DataType="conditionTypes:EventConditionViewModel">
    <DockPanel HorizontalAlignment="Stretch">
        <DockPanel.Styles>
            <Style Selector="DockPanel > TextBlock">
                <Setter Property="Margin" Value="0 5" />
            </Style>
        </DockPanel.Styles>
        <TextBlock DockPanel.Dock="Top">Triggered by event</TextBlock>
        <dataModelPicker:DataModelPickerButton Placeholder="Select an event"
                                               DockPanel.Dock="Top"
                                               HorizontalAlignment="Stretch"
                                               DataModelPath="{CompiledBinding EventPath}"
                                               ShowFullPath="{CompiledBinding ShowFullPaths.Value}"
                                               IsEventPicker="True" />

        <TextBlock DockPanel.Dock="Top">When the event fires..</TextBlock>
        <ComboBox PlaceholderText="Select a play mode" HorizontalAlignment="Stretch" DockPanel.Dock="Top" SelectedIndex="{CompiledBinding SelectedTriggerMode}">
            <ComboBoxItem>
                Play the timeline once
            </ComboBoxItem>
            <ComboBoxItem>
                Toggle the element on or off
            </ComboBoxItem>
        </ComboBox>

        <TextBlock DockPanel.Dock="Top" IsVisible="{CompiledBinding ShowOverlapOptions}">And if already playing..</TextBlock>
        <ComboBox PlaceholderText="Select a play mode"
                  HorizontalAlignment="Stretch"
                  DockPanel.Dock="Top"
                  SelectedIndex="{CompiledBinding SelectedOverlapMode}"
                  IsVisible="{CompiledBinding ShowOverlapOptions}">
            <ComboBoxItem>
                Restart the timeline
            </ComboBoxItem>
            <ComboBoxItem IsEnabled="{CompiledBinding IsConditionForLayer}">
                Play a second copy
            </ComboBoxItem>
            <ComboBoxItem>
                Do nothing
            </ComboBoxItem>
        </ComboBox>

        <TextBlock DockPanel.Dock="Top" IsVisible="{CompiledBinding ShowToggleOffOptions}">When toggling off..</TextBlock>
        <ComboBox PlaceholderText="Select a play mode"
                  HorizontalAlignment="Stretch"
                  DockPanel.Dock="Top"
                  SelectedIndex="{CompiledBinding SelectedToggleOffMode}"
                  IsVisible="{CompiledBinding ShowToggleOffOptions}">
            <ComboBoxItem>Finish the main segment</ComboBoxItem>
            <ComboBoxItem>Skip forward to the end segment</ComboBoxItem>
        </ComboBox>

        <Button DockPanel.Dock="Bottom"
                ToolTip.Tip="Open editor"
                Margin="0 15 0 5"
                Command="{CompiledBinding OpenEditor}"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Bottom">
            Edit condition script
        </Button>
    </DockPanel>
</UserControl>