Added model in the create function dialog and fix issues in the header color

This commit is contained in:
Ankitkumar Satapara
2026-04-21 21:36:16 +05:30
parent e698f18ad9
commit 07c27e0c48
3 changed files with 129 additions and 60 deletions

View File

@@ -35,6 +35,15 @@
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>
@@ -49,33 +58,22 @@
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<DataGridComboBoxColumn Header="Type" SelectedItemBinding="{Binding Type}" Width="120">
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#3E3E42" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="White" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
<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>
<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>
@@ -90,6 +88,15 @@
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>
@@ -104,33 +111,22 @@
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<DataGridComboBoxColumn Header="Type" SelectedItemBinding="{Binding Type}" Width="120">
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#3E3E42" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="White" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
<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>
<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>