<UserControl x:Class="NSwagStudio.Views.CodeGenerators.Views.CSharpSettingsView"
             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:converters="clr-namespace:MyToolkit.Converters;assembly=MyToolkit.Extended"
             xmlns:localConverters="clr-namespace:NSwagStudio.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>
        <converters:VisibilityConverter x:Key="VisibilityConverter" />
        <converters:NotConverter x:Key="NotConverter" />
        <localConverters:StringArrayConverter x:Key="StringArrayConverter" />
    </UserControl.Resources>

    <GroupBox Header="DTO Classes" Margin="0,0,0,12">
        <StackPanel Margin="4,8,4,-8">
            <CheckBox IsChecked="{Binding Command.GenerateDtoTypes, Mode=TwoWay}" Margin="0,0,0,12">
                <TextBlock Text="Generate DTO Types (e.g. request and response classes)" ToolTip="GenerateDtoTypes" TextWrapping="Wrap" />
            </CheckBox>

            <StackPanel Visibility="{Binding Command.GenerateDtoTypes, Converter={StaticResource VisibilityConverter}}">
                <CheckBox IsChecked="{Binding Command.GenerateOptionalPropertiesAsNullable, Mode=TwoWay}" 
                          ToolTip="GenerateOptionalPropertiesAsNullable" Margin="0,0,0,12">
                    <TextBlock Text="Generate optional schema properties (not required) as nullable properties" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.GenerateNullableReferenceTypes, Mode=TwoWay}" 
                          ToolTip="GenerateNullableReferenceTypes" Margin="0,0,0,12">
                    <TextBlock Text="Generate Nullable Reference Type (NRT) annotations (C# 8)" TextWrapping="Wrap" />
                </CheckBox>

                <TextBlock Text="Excluded Type Names (comma separated, must be defined in another namespace)." FontWeight="Bold" Margin="0,0,0,6" />
                <TextBox Text="{Binding Command.ExcludedTypeNames, Mode=TwoWay, Converter={StaticResource StringArrayConverter}, ConverterParameter=','}" 
                         ToolTip="ExcludedTypeNames" Margin="0,0,0,12" />

                <TextBlock Text="DTO class/enum access modifier" FontWeight="Bold" Margin="0,0,0,6" />
                <TextBox Text="{Binding Command.TypeAccessModifier, Mode=TwoWay}" 
                         ToolTip="TypeAccessModifier" Margin="0,0,0,12" />

                <TextBlock Text="DTO property setter access modifier" FontWeight="Bold" Margin="0,0,0,6" />
                <TextBox Text="{Binding Command.PropertySetterAccessModifier, Mode=TwoWay}"
                         ToolTip="PropertySetterAccessModifier" Margin="0,0,0,12" />

                <CheckBox IsChecked="{Binding Command.GenerateDefaultValues, Mode=TwoWay}"
                          ToolTip="GenerateDefaultValues" Margin="0,0,0,12">
                    <TextBlock Text="Generate default values for properties (if default value is specified)" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.GenerateImmutableArrayProperties, Mode=TwoWay}" 
                          ToolTip="GenerateImmutableArrayProperties" Margin="0,0,0,12">
                    <TextBlock Text="Remove the setter for non-nullable array properties" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.GenerateImmutableDictionaryProperties, Mode=TwoWay}" 
                          ToolTip="GenerateImmutableDictionaryProperties" Margin="0,0,0,12">
                    <TextBlock Text="Remove the setter for non-nullable dictionary properties" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.GenerateDataAnnotations, Mode=TwoWay}" 
                          ToolTip="GenerateDataAnnotations" Margin="0,0,0,12">
                    <TextBlock Text="Generate data annotation attributes" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.GenerateJsonMethods, Mode=TwoWay}" 
                          ToolTip="GenerateJsonMethods" Margin="0,0,0,12">
                    <TextBlock Text="Generate ToJson() and FromJson() methods" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.EnforceFlagEnums, Mode=TwoWay}" 
                          ToolTip="EnforceFlagEnums" Margin="0,0,0,12">
                    <TextBlock Text="Always generate enums as bit flags (with [Flags] attribute)" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.InlineNamedArrays, Mode=TwoWay}" 
                          ToolTip="InlineNamedArrays" Margin="0,0,0,12">
                    <TextBlock Text="Inline named arrays" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.InlineNamedDictionaries, Mode=TwoWay}" 
                          ToolTip="InlineNamedDictionaries" Margin="0,0,0,12">
                    <TextBlock Text="Inline named dictionaries" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.InlineNamedTuples, Mode=TwoWay}" 
                          ToolTip="InlineNamedTuples" Margin="0,0,0,12">
                    <TextBlock Text="Inline named tuples" TextWrapping="Wrap" />
                </CheckBox>

                <CheckBox IsChecked="{Binding Command.InlineNamedAny, Mode=TwoWay}" 
                          ToolTip="InlineNamedAny" Margin="0,0,0,12">
                    <TextBlock Text="Inline named any schemas" TextWrapping="Wrap" />
                </CheckBox>

                <TextBlock Text="Class Style" FontWeight="Bold" Margin="0,0,0,6" />
                <ComboBox SelectedItem="{Binding Command.ClassStyle, Mode=TwoWay}" 
                          ToolTip="ClassStyle"
                          ItemsSource="{Binding ClassStyles}" Margin="0,0,0,12" />

                <GroupBox Header="Serialization" Margin="0,0,0,12">
                    <StackPanel Margin="4,8,4,-8">
                        <TextBlock Text="JSON Library ('System.Text.Json' is experimental/incomplete!)" FontWeight="Bold" Margin="0,0,0,6" />
                        <ComboBox SelectedItem="{Binding Command.JsonLibrary, Mode=TwoWay}" 
                                  ToolTip="JsonLibrary"
                                  ItemsSource="{Binding JsonLibraries}" Margin="0,0,0,12" />

                        <TextBlock Text="JSON Polymorphic Serialization Style ('System.Text.Json' is experimental/incomplete!)" FontWeight="Bold" Margin="0,0,0,6" />
                        <ComboBox SelectedItem="{Binding Command.JsonPolymorphicSerializationStyles, Mode=TwoWay}" 
                                  ToolTip="JsonLibrary"
                                  ItemsSource="{Binding JsonPolymorphicSerializationStyles}" Margin="0,0,0,12" />

                        <CheckBox IsChecked="{Binding Command.RequiredPropertiesMustBeDefined, Mode=TwoWay}" ToolTip="RequiredPropertiesMustBeDefined" Margin="0,0,0,12">
                            <TextBlock Text="Required properties must be defined in JSON (sets Required.Always when the property is required)" TextWrapping="Wrap" />
                        </CheckBox>

                        <CheckBox IsChecked="{Binding Command.HandleReferences, Mode=TwoWay}" 
                                  Content="Use preserve references handling (All) in the JSON serializer"
                                  ToolTip="HandleReferences" Margin="0,0,0,12" />

                        <TextBlock Text="Custom Json.NET converter types (optional, multiple on separate lines)" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.JsonConverters, Mode=TwoWay, Converter={StaticResource StringArrayConverter}}" 
                                 ToolTip="JsonConverters" Height="52" AcceptsReturn="True" 
                                 VerticalScrollBarVisibility="Visible" Margin="0,0,0,12" />

                        <TextBlock Text="JsonSerializerSettings transformation method name (we recommend GenerateUpdateJsonSerializerSettingsMethod instead)" FontWeight="Bold"
                                   Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.JsonSerializerSettingsTransformationMethod, Mode=TwoWay}" 
                                 ToolTip="JsonSerializerSettingsTransformationMethod"
                                 Margin="0,0,0,12" />
                    </StackPanel>
                </GroupBox>

                <GroupBox Header="Primitive Types" Margin="0,0,0,12">
                    <StackPanel Margin="4,8,4,-8">
                        <TextBlock Text="Any Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.AnyType, Mode=TwoWay}" ToolTip="AnyType" Margin="0,0,0,12" />

                        <TextBlock Text="Date Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.DateType, Mode=TwoWay}" ToolTip="DateType" Margin="0,0,0,12" />

                        <TextBlock Text="Date Time Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.DateTimeType, Mode=TwoWay}" ToolTip="DateTimeType" Margin="0,0,0,12" />

                        <TextBlock Text="Time Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.TimeType, Mode=TwoWay}" ToolTip="TimeType" Margin="0,0,0,12" />

                        <TextBlock Text="Time Span Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.TimeSpanType, Mode=TwoWay}" ToolTip="TimeSpanType" Margin="0,0,0,12" />

                        <TextBlock Text="Generic Array Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.ArrayType, Mode=TwoWay}" ToolTip="ArrayType" Margin="0,0,0,12" />

                        <TextBlock Text="Generic Array Instance Type (empty = ArrayType)" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.ArrayInstanceType, Mode=TwoWay}" ToolTip="ArrayInstanceType" Margin="0,0,0,12" />

                        <TextBlock Text="Generic Dictionary Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.DictionaryType, Mode=TwoWay}" ToolTip="DictionaryType" Margin="0,0,0,12" />

                        <TextBlock Text="Generic Dictionary Instance Type (empty = DictionaryType)" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.DictionaryInstanceType, Mode=TwoWay}" ToolTip="DictionaryInstanceType" Margin="0,0,0,12" />

                        <TextBlock Text="Generic Array Base Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.ArrayBaseType, Mode=TwoWay}" ToolTip="ArrayBaseType" Margin="0,0,0,12" />

                        <TextBlock Text="Generic Dictionary Base Type" FontWeight="Bold" Margin="0,0,0,6" />
                        <TextBox Text="{Binding Command.DictionaryBaseType, Mode=TwoWay}" ToolTip="DictionaryBaseType" Margin="0,0,0,12" />
                    </StackPanel>
                </GroupBox>
            </StackPanel>
        </StackPanel>
    </GroupBox>
</UserControl>
