Public Class CompoTrfDataWindowV Private m_CompoTrfDataWindowVM As CompoTrfDataWindowVM Sub New(Owner As Window, CompoTrfDataWindowVM As CompoTrfDataWindowVM) MyBase.New(Owner) ' This call is required by the designer. InitializeComponent() Me.DataContext = CompoTrfDataWindowVM ' Assegno al riferimento locale al VM il VM preso dal DataContext m_CompoTrfDataWindowVM = CompoTrfDataWindowVM End Sub Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click DialogResult = True End Sub 'Private Sub Cancel_Click(sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click ' DialogResult = False 'End Sub End Class