142 lines
7.7 KiB
XML
142 lines
7.7 KiB
XML
<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="{Binding DialogTitle, RelativeSource={RelativeSource Self}, FallbackValue='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.ColumnHeaderStyle>
|
||
<Style TargetType="DataGridColumnHeader">
|
||
<Setter Property="Background" Value="#2D2D30" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
<Setter Property="Padding" Value="6 4" />
|
||
<Setter Property="BorderBrush" Value="#555" />
|
||
<Setter Property="BorderThickness" Value="0 0 1 1" />
|
||
</Style>
|
||
</DataGrid.ColumnHeaderStyle>
|
||
<DataGrid.Columns>
|
||
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="*">
|
||
<DataGridTextColumn.ElementStyle>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="Foreground" Value="White" />
|
||
</Style>
|
||
</DataGridTextColumn.ElementStyle>
|
||
<DataGridTextColumn.EditingElementStyle>
|
||
<Style TargetType="TextBox">
|
||
<Setter Property="Foreground" Value="Black" />
|
||
<Setter Property="Background" Value="White" />
|
||
</Style>
|
||
</DataGridTextColumn.EditingElementStyle>
|
||
</DataGridTextColumn>
|
||
<DataGridTemplateColumn Header="Type" Width="180">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<TextBlock Text="{Binding Type}" Foreground="White" Padding="4 2" />
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellTemplate>
|
||
<DataGridTemplateColumn.CellEditingTemplate>
|
||
<DataTemplate>
|
||
<ComboBox ItemsSource="{Binding AvailableTypes, RelativeSource={RelativeSource AncestorType=Window}}"
|
||
SelectedItem="{Binding Type, UpdateSourceTrigger=PropertyChanged}"
|
||
IsEditable="True"
|
||
Text="{Binding Type, UpdateSourceTrigger=LostFocus}"
|
||
Foreground="Black" Background="White" />
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellEditingTemplate>
|
||
</DataGridTemplateColumn>
|
||
</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.ColumnHeaderStyle>
|
||
<Style TargetType="DataGridColumnHeader">
|
||
<Setter Property="Background" Value="#2D2D30" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
<Setter Property="Padding" Value="6 4" />
|
||
<Setter Property="BorderBrush" Value="#555" />
|
||
<Setter Property="BorderThickness" Value="0 0 1 1" />
|
||
</Style>
|
||
</DataGrid.ColumnHeaderStyle>
|
||
<DataGrid.Columns>
|
||
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="*">
|
||
<DataGridTextColumn.ElementStyle>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="Foreground" Value="White" />
|
||
</Style>
|
||
</DataGridTextColumn.ElementStyle>
|
||
<DataGridTextColumn.EditingElementStyle>
|
||
<Style TargetType="TextBox">
|
||
<Setter Property="Foreground" Value="Black" />
|
||
<Setter Property="Background" Value="White" />
|
||
</Style>
|
||
</DataGridTextColumn.EditingElementStyle>
|
||
</DataGridTextColumn>
|
||
<DataGridTemplateColumn Header="Type" Width="180">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<TextBlock Text="{Binding Type}" Foreground="White" Padding="4 2" />
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellTemplate>
|
||
<DataGridTemplateColumn.CellEditingTemplate>
|
||
<DataTemplate>
|
||
<ComboBox ItemsSource="{Binding AvailableTypes, RelativeSource={RelativeSource AncestorType=Window}}"
|
||
SelectedItem="{Binding Type, UpdateSourceTrigger=PropertyChanged}"
|
||
IsEditable="True"
|
||
Text="{Binding Type, UpdateSourceTrigger=LostFocus}"
|
||
Foreground="Black" Background="White" />
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellEditingTemplate>
|
||
</DataGridTemplateColumn>
|
||
</DataGrid.Columns>
|
||
</DataGrid>
|
||
|
||
<!-- Buttons -->
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="6">
|
||
<Button x:Name="CreateButton" 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>
|