<Window x:Class="Nodify.Calculator.CreateFunctionDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Create New Function"
        Width="500"
        Height="520"
        WindowStartupLocation="CenterOwner"
        ResizeMode="NoResize"
        Background="#2D2D30"
        Foreground="White">
    <Grid Margin="15">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!-- Function Name -->
        <TextBlock Text="Function Name:" Grid.Row="0" Margin="0 0 0 4" />
        <TextBox x:Name="FunctionNameBox" Grid.Row="1" Margin="0 0 0 10"
                 Background="#3E3E42" Foreground="White" Padding="4" />

        <!-- Input Parameters -->
        <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0 0 0 4">
            <TextBlock Text="Input Parameters:" FontWeight="Bold" />
            <Button Content="➕ Add" Margin="10 0 0 0" Padding="8 2" Click="AddInput_Click"
                    Background="#3E3E42" Foreground="White" Cursor="Hand" />
        </StackPanel>
        <DataGrid x:Name="InputParamsGrid" Grid.Row="3" Margin="0 0 0 10"
                  AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="True"
                  Background="#3E3E42" Foreground="White" RowBackground="#3E3E42"
                  AlternatingRowBackground="#333337" GridLinesVisibility="None"
                  HeadersVisibility="Column" BorderBrush="#555">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="*" />
                <DataGridComboBoxColumn Header="Type" SelectedItemBinding="{Binding Type}" Width="120">
                    <DataGridComboBoxColumn.ItemsSource>
                        <x:Array Type="sys:String" xmlns:sys="clr-namespace:System;assembly=System.Runtime">
                            <sys:String>string</sys:String>
                            <sys:String>int</sys:String>
                            <sys:String>double</sys:String>
                            <sys:String>bool</sys:String>
                            <sys:String>float</sys:String>
                            <sys:String>decimal</sys:String>
                            <sys:String>long</sys:String>
                            <sys:String>DateTime</sys:String>
                            <sys:String>object</sys:String>
                        </x:Array>
                    </DataGridComboBoxColumn.ItemsSource>
                </DataGridComboBoxColumn>
            </DataGrid.Columns>
        </DataGrid>

        <!-- Output Parameters -->
        <StackPanel Orientation="Horizontal" Grid.Row="4" Margin="0 0 0 4">
            <TextBlock Text="Output Parameters:" FontWeight="Bold" />
            <Button Content="➕ Add" Margin="10 0 0 0" Padding="8 2" Click="AddOutput_Click"
                    Background="#3E3E42" Foreground="White" Cursor="Hand" />
        </StackPanel>
        <DataGrid x:Name="OutputParamsGrid" Grid.Row="5" Margin="0 0 0 10"
                  AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="True"
                  Background="#3E3E42" Foreground="White" RowBackground="#3E3E42"
                  AlternatingRowBackground="#333337" GridLinesVisibility="None"
                  HeadersVisibility="Column" BorderBrush="#555">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="*" />
                <DataGridComboBoxColumn Header="Type" SelectedItemBinding="{Binding Type}" Width="120">
                    <DataGridComboBoxColumn.ItemsSource>
                        <x:Array Type="sys:String" xmlns:sys="clr-namespace:System;assembly=System.Runtime">
                            <sys:String>string</sys:String>
                            <sys:String>int</sys:String>
                            <sys:String>double</sys:String>
                            <sys:String>bool</sys:String>
                            <sys:String>float</sys:String>
                            <sys:String>decimal</sys:String>
                            <sys:String>long</sys:String>
                            <sys:String>DateTime</sys:String>
                            <sys:String>object</sys:String>
                        </x:Array>
                    </DataGridComboBoxColumn.ItemsSource>
                </DataGridComboBoxColumn>
            </DataGrid.Columns>
        </DataGrid>

        <!-- Buttons -->
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="6">
            <Button Content="Create" Width="80" Margin="0 0 10 0" Padding="4"
                    Click="OnCreateClick" IsDefault="True" />
            <Button Content="Cancel" Width="80" Padding="4"
                    Click="OnCancelClick" IsCancel="True" />
        </StackPanel>
    </Grid>
</Window>
