Imports System.ComponentModel Imports System.IO Imports EgtUILib Public Class SaveFileDialogWithListV 'Implements INotifyPropertyChanged Private m_SaveFileDialogWithListVM As SaveFileDialogWithListVM #Region "CONSTRUCTOR" Sub New(Owner As Window, SaveFileDialogWithListVM As SaveFileDialogWithListVM) ' Funzione che interpreta l'xaml InitializeComponent() Me.Owner = Owner Me.DataContext = SaveFileDialogWithListVM ' Assegno al riferimento locale al VM il VM preso dal DataContext m_SaveFileDialogWithListVM = SaveFileDialogWithListVM End Sub #End Region ' CONSTRUCTOR Private Sub SaveBtn_Click(sender As Object, e As RoutedEventArgs) Handles SaveBtn.Click If m_SaveFileDialogWithListVM.Save() Then DialogResult = True End If End Sub Public Overloads Function ShowDialog() As Boolean? ' inizializzo dialogo m_SaveFileDialogWithListVM.Initialize() ' pongo focus su testo FilePath.Focus() ' mostro la finestra di dialogo Return MyBase.ShowDialog() End Function 'Private Sub FilePath_TextChanged(sender As Object, e As TextChangedEventArgs) Handles FilePath.TextChanged ' FileNameList.UnselectAll() 'End Sub End Class '''' '''' Class that represent a Converter that convert the complete file path in the file name and vice versa. '''' 'Public Class FileNameConverter ' Implements IValueConverter ' Dim TempPath As String ' Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert ' TempPath = CStr(value) ' Return Path.GetFileNameWithoutExtension(TempPath) ' End Function ' Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack ' Return Path.GetDirectoryName(TempPath) & "\" & CStr(value) & Path.GetExtension(TempPath) ' End Function 'End Class