Public Class AddSectionXMaterialWndV Private WithEvents m_AddSectionXMaterialWndVM As AddSectionXMaterialWndVM Sub New(Owner As Window, AddSectionXMaterialWndVM As AddSectionXMaterialWndVM) MyBase.New(Owner) ' This call is required by the designer. InitializeComponent() Me.DataContext = AddSectionXMaterialWndVM ' Assegno al riferimento locale al VM il VM preso dal DataContext m_AddSectionXMaterialWndVM = AddSectionXMaterialWndVM End Sub Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddSectionXMaterialWndVM.m_CloseWindow Me.DialogResult = bDialogResult End Sub End Class