Imports System.Collections.ObjectModel
Imports EgtUILib

Public Class CompoCsvData

   ' Riferimento alla MainWindow
   Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)

   Sub New(Owner As Window)
      Me.Owner = Owner
      InitializeComponent()
   End Sub

   Private Sub CompoTrfData_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
      Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
      Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
      OrderTxBl.Text = EgtMsg( 90467)     'Ordine
      ListTxBl.Text = EgtMsg( 90468)      'Distinta
      NameTxBl.Text = EgtMsg( 90469)      'Nome
   End Sub

   Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
      DialogResult = True
      Close()
   End Sub

   Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
      DialogResult = False
      Close()
   End Sub

   Friend Sub SetData(sOrder As String, sList As String)
      OrderTxBx.Text = sOrder
      ListTxBx.Text = sList
      NameTxBl.Visibility = Visibility.Hidden
      NameTxBx.Visibility = Visibility.Hidden
   End Sub

   Friend Sub GetData(ByRef sOrder As String, ByRef sList As String)
      sOrder = OrderTxBx.Text
      sList = ListTxBx.Text
   End Sub

   Friend Sub SetData(sOrder As String, sList As String, sName As String)
      OrderTxBx.Text = sOrder
      ListTxBx.Text = sList
      NameTxBx.Text = sName
   End Sub

   Friend Sub GetData(ByRef sOrder As String, ByRef sList As String, ByRef sName As String)
      sOrder = OrderTxBx.Text
      sList = ListTxBx.Text
      sName = NameTxBx.Text
   End Sub

End Class