08237de2d8
- In UpdateLicencePage viene mostrato il nome del Prodotto della Licenza che si sta aggiornando - Ogni pulsante "Close" fa ritornare alla pagina precedente (Correzione simile per i vari pulsanti Update e New, mentre Delete rimane nella stessa pagina) - Correzione pulsanti del Main Menu (non hanno più la scritta "Cerca...") - I DataGrid non tagliano più l'ultima riga visibile ma si aggiustano in base al numero intero di righe visibili (implementato per tutte le pagine Search tranne che per Product per via di errori che non riesco a risolvere
34 lines
1.5 KiB
VB.net
34 lines
1.5 KiB
VB.net
Class SearchVersionPageV
|
|
|
|
Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
|
|
Dim visibleRows As Integer = 0
|
|
Dim i As Integer = 0
|
|
If (VersionDataGrid.Height - VersionDataGrid.ColumnHeaderHeight) Mod VersionDataGrid.RowHeight <> 0 Then
|
|
For Each DataGridItem In VersionDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
|
|
If IsUserVisible(CType(VersionDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), VersionDataGrid) Then
|
|
visibleRows += 1
|
|
Else
|
|
Exit For
|
|
End If
|
|
i = i + 1
|
|
Next
|
|
'If (ClientDataGrid.Height < ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)) Then
|
|
VersionDataGrid.Height = VersionDataGrid.ColumnHeaderHeight + VersionDataGrid.RowHeight * (visibleRows - 1)
|
|
'End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
|
|
If Not IsNothing(element) Then
|
|
If Not element.IsVisible Then
|
|
Return False
|
|
End If
|
|
Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
|
|
Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
|
|
Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
|
|
End If
|
|
Return False
|
|
End Function
|
|
|
|
End Class
|