Imports System.Collections.ObjectModel
Imports System.Windows
Imports System.Windows.Controls
Imports EgtWPFLib5

Public Class GridDimension
   Inherits VMBase

   Private Shared m_SoftwareModActive As Boolean = False

   Private Property m_GridName As String
   Public Property GridName As String
      Get
         Return m_GridName
      End Get
      Set(value As String)
         m_GridName = value
      End Set
   End Property

   Private Property m_Index As Integer
   Public Property Index As Integer
      Get
         Return m_Index
      End Get
      Set(value As Integer)
         m_Index = value
      End Set
   End Property

   Private Property m_DimType As DimensionType
   Public Property DimType As DimensionType
      Get
         Return m_DimType
      End Get
      Set(value As DimensionType)
         m_DimType = value
      End Set
   End Property

   Private Property m_GridLen As GridLength
   Public Property GridLen As GridLength
      Get
         Return m_GridLen
      End Get
      Set(value As GridLength)
         m_GridLen = value
         If Not m_SoftwareModActive Then DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
      End Set
   End Property

   Private Property m_GridDimensions As ObservableCollection(Of GridDimension)
   Public Property GridDimensions As ObservableCollection(Of GridDimension)
      Get
         Return m_GridDimensions
      End Get
      Set(value As ObservableCollection(Of GridDimension))
         m_GridDimensions = value
      End Set
   End Property

   Sub New(GridName As String, Index As Integer, DimType As DimensionType, GridLen As GridLength)
      m_GridName = GridName
      m_Index = Index
      m_DimType = DimType
      m_GridLen = GridLen
   End Sub

   Public Shared Sub SetSoftwareMod(bActive As Boolean)
      m_SoftwareModActive = bActive
   End Sub

End Class
