<UserControl x:Class="Artemis.UI.Screens.Scripting.Dialogs.ScriptConfigurationCreateView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:Artemis.UI.Screens.Scripting.Dialogs"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:s="https://github.com/canton7/Stylet"
             xmlns:scriptingProviders="clr-namespace:Artemis.Core.ScriptingProviders;assembly=Artemis.Core"
             xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance local:ScriptConfigurationCreateViewModel}">
    <UserControl.Resources>
        <shared:BindingProxy x:Key="DataContextProxy" Data="{Binding}" />
    </UserControl.Resources>
    <StackPanel Margin="16">
        <TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}">
            Add new script
        </TextBlock>

        <TextBox materialDesign:HintAssist.Hint="Script name"
                 Margin="0 8 0 16"
                 Width="300"
                 Style="{StaticResource MaterialDesignFilledTextBox}"
                 Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" />

        <ComboBox materialDesign:HintAssist.Hint="Scripting provider"
                  Margin="0 8 0 16"
                  Width="300"
                  Style="{StaticResource MaterialDesignFilledComboBox}"
                  SelectedItem="{Binding SelectedScriptingProvider}">
            <ComboBox.ItemsSource>
                <CompositeCollection>
                    <ComboBoxItem IsEnabled="False"
                                  Visibility="{Binding HasScriptingProviders, Converter={x:Static s:BoolToVisibilityConverter.InverseInstance}, Mode=OneWay}">
                        No scripting providers found
                    </ComboBoxItem>
                    <CollectionContainer Collection="{Binding Data.ScriptingProviders, Source={StaticResource DataContextProxy}}" />
                </CompositeCollection>
            </ComboBox.ItemsSource>
            <ComboBox.ItemTemplate>
                <DataTemplate DataType="{x:Type scriptingProviders:ScriptingProvider}">
                    <StackPanel Orientation="Horizontal">
                        <shared:ArtemisIcon Icon="{Binding Info.ResolvedIcon}" Width="18 " Height="18" Margin="0 0 5 0" VerticalAlignment="Center" />
                        <TextBlock Text="{Binding LanguageName}" VerticalAlignment="Center" />
                    </StackPanel>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>

        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 8 0 0">
            <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 0 8 0" Command="{s:Action Cancel}">
                CANCEL
            </Button>
            <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 0 0 0" Command="{s:Action Accept}">
                ACCEPT
            </Button>
        </StackPanel>
    </StackPanel>
</UserControl>