Imports EgtWPFLib5
Imports EgtUILib

Public Class UpdateOrAppendWndVM
   Inherits VMBase

#Region "FIELDS & PROPERTIES"

   Friend Event m_CloseWindow(bDialogResult As Boolean)

   Private m_UpdateIsChecked As Boolean
   Public Property UpdateIsChecked As Boolean
      Get
         Return m_UpdateIsChecked
      End Get
      Set(value As Boolean)
         If value <> m_UpdateIsChecked Then
            m_UpdateIsChecked = value
         End If
      End Set
   End Property

   Private m_AppendIsChecked As Boolean
   Public Property AppendIsChecked As Boolean
      Get
         Return m_AppendIsChecked
      End Get
      Set(value As Boolean)
         If value <> m_AppendIsChecked Then
            m_AppendIsChecked = value
         End If
      End Set
   End Property

   ' Definizione comandi
   Private m_cmdOk As ICommand

#End Region    ' FIELDS & PROPERTIES

#Region "MESSAGES"

   Public ReadOnly Property Update_Msg As String
      Get
         Return EgtMsg(61958)
      End Get
   End Property

   Public ReadOnly Property Append_Msg As String
      Get
         Return EgtMsg(61959)
      End Get
   End Property

   Public ReadOnly Property Ok_Msg As String
      Get
         Return EgtMsg(61761)
      End Get
   End Property

   Public ReadOnly Property Cancel_Msg As String
      Get
         Return EgtMsg(61763)
      End Get
   End Property

#End Region    ' MESSAGES

#Region "CONSTRUCTOR"

   Sub New()
      ' setto il bottone Update a premuto
      UpdateIsChecked = True
   End Sub

#End Region    ' CONSTRUCTOR

#Region "COMMANDS"

#Region "Ok"

   Public ReadOnly Property Ok_Command As ICommand
      Get
         If m_cmdOk Is Nothing Then
            m_cmdOk = New Command(AddressOf Ok)
         End If
         Return m_cmdOk
      End Get
   End Property

   Public Sub Ok()
      RaiseEvent m_CloseWindow(True)
   End Sub

#End Region ' Ok

#End Region    ' COMMANDS

End Class
