Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5

Public Class PParameterListVM
   Inherits VMBase

#Region "FIELDS & PROPERTIES"

   Private m_colPParam_Value As EgtDataGridColumn
   Public ReadOnly Property colPParam_Value As EgtDataGridColumn
      Get
         Return m_colPParam_Value
      End Get
   End Property

   Private m_PParameterListColumns As New ObservableCollection(Of EgtDataGridColumn)
   Public Property PParameterListColumns As ObservableCollection(Of EgtDataGridColumn)
      Get
         Return m_PParameterListColumns
      End Get
      Set(value As ObservableCollection(Of EgtDataGridColumn))
         m_PParameterListColumns = value
      End Set
   End Property

   Private m_PParameterList_IsEnabled As Boolean = True
   Public Property PParameterList_IsEnabled As Boolean
      Get
         Return m_PParameterList_IsEnabled
      End Get
      Set(value As Boolean)
         m_PParameterList_IsEnabled = value
      End Set
   End Property

#Region "Messages"

   Public ReadOnly Property Custom_Msg As String
      Get
         Return EgtMsg(61801)
      End Get
   End Property

   Public ReadOnly Property NAM_Msg As String
      Get
         Return EgtMsg(61808)
      End Get
   End Property

   Public ReadOnly Property Description_Msg As String
      Get
         Return EgtMsg(61603)
      End Get
   End Property

   Public ReadOnly Property Value_Msg As String
      Get
         Return EgtMsg(61615)
      End Get
   End Property

   Public ReadOnly Property Min_Msg As String
      Get
         Return EgtMsg(61616)
      End Get
   End Property
   Public ReadOnly Property Max_Msg As String
      Get
         Return EgtMsg(61617)
      End Get
   End Property

#End Region    ' Messages

#End Region    ' FIELDS & PROPERTIES

#Region "CONSTRUCTOR"

   Sub New()
      ' Aggiungo riferimento a Map
      Map.SetRefPParameterListVM(Me)
      ' carico le colonne della datagrid
      GetPrivateProfileColumns(S_PARAMETERLIST_P, PParameterListColumns)
      ' recupero riferimento a colonna Value
      m_colPParam_Value = PParameterListColumns.FirstOrDefault(Function(x) x.Name = COL_VALUE)
   End Sub

#End Region    ' CONSTRUCTOR

   Friend Sub SetPParameterListIsEnabled(bIsEnabled As Boolean)
      m_PParameterList_IsEnabled = bIsEnabled
      NotifyPropertyChanged(NameOf(PParameterList_IsEnabled))
   End Sub

End Class
