- modifiche

This commit is contained in:
Emmanuele Sassi
2025-11-07 11:12:45 +01:00
parent 7fe32007d8
commit 908e407147
3 changed files with 136 additions and 42 deletions
@@ -960,7 +960,7 @@
<Version>2.7.10.1</Version>
</PackageReference>
<PackageReference Include="EgwWPFBaseLib">
<Version>2.7.11-beta.1</Version>
<Version>2.7.11-beta.4</Version>
</PackageReference>
<PackageReference Include="EntityFramework">
<Version>6.4.4</Version>
@@ -10,6 +10,7 @@
<OPTIMIZER:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<OPTIMIZER:FractionHeightConverter x:Key="FractionHeightConverter"/>
<OPTIMIZER:ExpanderWidthConverter x:Key="ExpanderWidthConverter"/>
<OPTIMIZER:DataGridTotalWidthConverter x:Key="DataGridTotalWidthConverter"/>
<sys:Double x:Key="FeatureWrapPanelHeight">0.6</sys:Double>
</UserControl.Resources>
<EgwWPFBaseLib:EgwDataGrid ItemsSource="{Binding Tag.BTLPartVMList,
@@ -23,6 +24,8 @@
IsEnabled="{Binding PartList_IsEnabled}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
VerticalGridLinesBrush="Transparent"
HorizontalGridLinesBrush="Transparent"
AreRowDetailsFrozen="True"
EnableRowVirtualization="True"
EnableColumnVirtualization="True"
@@ -35,6 +38,7 @@
VirtualizingPanel.CacheLengthUnit="Pixel"
RowBackground="{StaticResource BeamWall_BLackSqueeze}"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
HorizontalScrollBarVisibility="Auto"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.InputBindings>
<KeyBinding Key="Delete" Command="{Binding Tag.DeletePart_Command,
@@ -48,10 +52,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True" HorizontalAlignment="Left"
Width="{Binding ActualWidth, Converter={StaticResource ExpanderWidthConverter}, RelativeSource={RelativeSource AncestorType={x:Type EgwWPFBaseLib:EgwDataGrid}}}">
<Expander IsExpanded="True" HorizontalAlignment="Left">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Path=Name}"
Margin="0,0,5,0" FontSize="14"/>
<TextBlock Text="{Binding Path=Name, Converter={StaticResource ProjIdToBtlFileName}}"
@@ -104,14 +108,71 @@
</Style>
</DataGrid.CellStyle>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<!--<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="DetailsVisibility" Value="{Binding bOpenFeatureList, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<EventSetter Event="PreviewMouseDown" Handler="PartList_PreviewMouseDown"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRow">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
--><!--Celle della riga--><!--
<DataGridCellsPresenter Grid.Row="0"/>
--><!--Dettagli della riga--><!--
<DataGridDetailsPresenter Grid.Row="1"
Visibility="{TemplateBinding DetailsVisibility}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsRowEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>-->
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
<Setter Property="ValidationErrorTemplate">
<Setter.Value>
<ControlTemplate>
<TextBlock Foreground="Red" Margin="2,0,0,0" Text="!" VerticalAlignment="Center"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Border x:Name="DGR_Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
<SelectiveScrollingGrid>
<SelectiveScrollingGrid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</SelectiveScrollingGrid.ColumnDefinitions>
<SelectiveScrollingGrid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</SelectiveScrollingGrid.RowDefinitions>
<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" Visibility="{TemplateBinding DetailsVisibility}"/>
<DataGridRowHeader Grid.RowSpan="2" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</SelectiveScrollingGrid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsNewItem" Value="True">
<Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
@@ -390,6 +451,12 @@
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<Grid>
<Grid.MaxWidth>
<MultiBinding Converter="{StaticResource DataGridTotalWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=DataGrid}" Path="ActualWidth" />
<Binding RelativeSource="{RelativeSource AncestorType=DataGrid}"/>
</MultiBinding>
</Grid.MaxWidth>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
@@ -418,7 +485,7 @@
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,50,0">
<Grid Margin="0,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="40"/>
@@ -486,16 +553,22 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,2,0,0"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}">
<TextBlock Text="STATUS:" Foreground="{StaticResource BeamWall_Corduroy}" HorizontalAlignment="Left" Margin="0,0,10,0"/>
<StackPanel Grid.Row="1"
Grid.Column="1"
Orientation="Horizontal"
Margin="0,2,0,0">
<TextBlock Text="STATUS:"
Foreground="{StaticResource BeamWall_Corduroy}"
HorizontalAlignment="Left"
Margin="0,0,10,0"/>
<TextBlock Text="{Binding Tag.SelBTLPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:BTLPartListV}}}"
HorizontalAlignment="Left" Foreground="{StaticResource BeamWall_Corduroy}"
HorizontalAlignment="Left"
Foreground="{StaticResource BeamWall_Corduroy}"
Visibility="{Binding Tag.SelBTLPart.CALC_MSG_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:BTLPartListV}}}"/>
<TextBlock Text="{Binding Tag.SelBTLPart.SelBTLFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:BTLPartListV}}}"
HorizontalAlignment="Left" Foreground="{StaticResource BeamWall_Corduroy}" />
HorizontalAlignment="Left"
Foreground="{StaticResource BeamWall_Corduroy}" />
</StackPanel>
</Grid>
</DataTemplate>
@@ -300,3 +300,24 @@ Class ExpanderWidthConverter
End Function
End Class
Public Class DataGridTotalWidthConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
If TypeOf values(0) Is Double AndAlso TypeOf values(1) Is DataGrid Then
Dim dataGrid As DataGrid = DirectCast(values(1), DataGrid)
Dim total As Double = 0
For Each col In dataGrid.Columns
total += col.ActualWidth
Next
Return total
End If
Return 0
End Function
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class