-introdotto griglia dinamica per gestire spostamento colonne
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class DrawOptionPanelVM
|
||||
Public Class DrawOptionPanelVM
|
||||
Inherits ViewModelBase
|
||||
|
||||
' GRAPHICAL ELEMENTS
|
||||
@@ -37,6 +35,28 @@ Public Class DrawOptionPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ManageLayerRowIsExpanded As Boolean = True
|
||||
Public ReadOnly Property ManageLayerRowIsExpanded As Boolean
|
||||
Get
|
||||
Return m_ManageLayerRowIsExpanded
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetManageLayerRowIsExpanded(value As Boolean)
|
||||
m_ManageLayerRowIsExpanded = value
|
||||
OnPropertyChanged("ManageLayerRowIsExpanded")
|
||||
End Sub
|
||||
|
||||
Private m_InfoRowIsExpanded As Boolean = True
|
||||
Public ReadOnly Property InfoRowIsExpanded As Boolean
|
||||
Get
|
||||
Return m_InfoRowIsExpanded
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetInfoRowIsExpanded(value As Boolean)
|
||||
m_InfoRowIsExpanded = value
|
||||
OnPropertyChanged("InfoRowIsExpanded")
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
@@ -60,4 +80,64 @@ Public Class DrawOptionPanelVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "DEPENCY PROPERTY"
|
||||
|
||||
Public Shared ReadOnly RowIdProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"RowId",
|
||||
GetType(String),
|
||||
GetType(DrawOptionPanelVM),
|
||||
New PropertyMetadata(Nothing)
|
||||
)
|
||||
|
||||
Public Shared Sub SetRowId(element As DependencyObject, value As String)
|
||||
element.SetValue(RowIdProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRowId(element As DependencyObject) As String
|
||||
Return CType(element.GetValue(RowIdProperty), String)
|
||||
End Function
|
||||
|
||||
Public Shared ReadOnly IsExpandedProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"IsExpanded",
|
||||
GetType(Boolean),
|
||||
GetType(DrawOptionPanelVM),
|
||||
New PropertyMetadata(True, AddressOf OnIsExpandedChanged)
|
||||
)
|
||||
|
||||
Public Shared Sub SetIsExpanded(element As DependencyObject, value As Boolean)
|
||||
element.SetValue(IsExpandedProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetIsExpanded(element As DependencyObject) As Boolean
|
||||
Return CType(element.GetValue(IsExpandedProperty), Boolean)
|
||||
End Function
|
||||
|
||||
Private Shared Sub OnIsExpandedChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
|
||||
Dim row As RowDefinition = TryCast(d, RowDefinition)
|
||||
If IsNothing(row) Then Return
|
||||
|
||||
Dim isExpanded As Boolean = CBool(e.NewValue)
|
||||
|
||||
Dim rowId As String = GetRowId(row)
|
||||
Dim rowHeight As Double = 0
|
||||
|
||||
If rowId = "ManageLayer" Then
|
||||
rowHeight = 400
|
||||
ElseIf rowId = "Info" Then
|
||||
rowHeight = 150
|
||||
End If
|
||||
|
||||
If Not isExpanded Then
|
||||
row.ClearValue(RowDefinition.HeightProperty)
|
||||
|
||||
row.Height = New GridLength(1, GridUnitType.Auto)
|
||||
Else
|
||||
row.Height = New GridLength(rowHeight)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Depency Property
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user