Merge branch 'feature/NewPage' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewPage

This commit is contained in:
Demetrio Cassarino
2023-11-20 11:26:01 +01:00
2 changed files with 64 additions and 6 deletions
@@ -3,6 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
<UserControl.Resources>
<EgtBEAMWALL:DataGridCellBorderThicknessConverter x:Key="DataGridCellBorderThicknessConverter"/>
</UserControl.Resources>
<EgtBEAMWALLCORE:EgtDataGrid x:Name="BTLPart_DataGrid"
ItemsSource="{Binding Tag.BTLPartVMList,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
@@ -27,6 +30,32 @@
<KeyBinding Key="Delete" Command="{Binding Tag.DeletePart_Command,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}" />
</DataGrid.InputBindings>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" />
</Style.Resources>
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness">
<Setter.Value>
<MultiBinding Converter="{StaticResource DataGridCellBorderThicknessConverter}"
ConverterParameter="3">
<Binding Path="Column.DisplayIndex" RelativeSource="{RelativeSource Self}"/>
</MultiBinding>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="Cyan" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="Blue" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Resources>
<!--PDN - Nome-->
<DataGridTextColumn x:Key="colPDN"
@@ -34,24 +63,25 @@
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<!--<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
<Setter Property="BorderThickness" Value="3,3,0,3"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="Cyan" />
<Setter Property="Foreground" Value="Blue" />
</Trigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn.CellStyle>-->
</DataGridTextColumn>
<!--Validità pezzo-->
<DataGridTemplateColumn x:Key="colCALC" CanUserResize="False"
SortMemberPath="nGlobalState">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid Margin="2,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="25"/>
@@ -225,7 +255,7 @@
</DataGridTextColumn>-->
</DataGrid.Resources>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="{Binding Background}"/>
<Setter Property="Foreground" Value="{Binding Foreground}"/>
<Setter Property="FontWeight" Value="{Binding FontWeight}"/>
@@ -1,10 +1,11 @@
Imports System.Collections.ObjectModel
Imports System.Globalization
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLPartListVM
Inherits vmbase
Inherits VMBase
Private m_colPart_Do As EgtDataGridColumn
Public ReadOnly Property colPart_Do As EgtDataGridColumn
@@ -148,3 +149,30 @@ Public Class BTLPartListVM
End Sub
End Class
Class DataGridCellBorderThicknessConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
Dim ColumnList As ObservableCollection(Of EgtDataGridColumn) = Map.refPartListVM.PartColumns
Dim ColumnIndex As Integer = CInt(values(0))
Dim bLeft As Boolean = False
Dim bRight As Boolean = False
Dim dThickness As Double = CDbl(parameter)
If Not IsNothing(ColumnList) AndAlso Not IsNothing(ColumnIndex) Then
If ColumnIndex = 0 Then
bLeft = True
ElseIf ColumnIndex = ColumnList.Count - 1 Then
bRight = True
End If
Else
Return New Thickness(0, dThickness, 0, dThickness)
End If
Return New Thickness(If(bLeft, dThickness, 0), dThickness, If(bRight, dThickness, 0), dThickness)
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