72 lines
2.3 KiB
VB.net
72 lines
2.3 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Imports EgtBEAMWALL.Core.ConstBeam
|
|
Imports EgtUILib
|
|
|
|
Public Class OpenProjectFileDialogV
|
|
|
|
Private WithEvents m_OpenProjFileDialogVM As OpenProjectFileDialogVM
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New(Owner As Window, OpenProjFileDialogVM As OpenProjectFileDialogVM)
|
|
' Funzione che interpreta l'xaml
|
|
InitializeComponent()
|
|
Me.Owner = Owner
|
|
Me.DataContext = OpenProjFileDialogVM
|
|
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
|
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Function EgtShowDialog(ProjectType As ProjectType) As Boolean?
|
|
m_OpenProjFileDialogVM.Init(ProjectType)
|
|
' mostro la finestra di dialogo
|
|
Return Me.ShowDialog()
|
|
End Function
|
|
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjectFileVM)) As Boolean?
|
|
m_OpenProjFileDialogVM.Init(ProjectType, ProjectList)
|
|
' mostro la finestra di dialogo
|
|
Return Me.ShowDialog()
|
|
End Function
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "EVENTS"
|
|
|
|
|
|
'Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
|
' m_MainWindowVM.ContentRendered()
|
|
'End Sub
|
|
|
|
#End Region ' EVENTS
|
|
|
|
|
|
'Private Sub m_FileNameTxBl_MouseDown(sender As Object, e As Windows.Input.MouseButtonEventArgs) Handles FileNameList.MouseDoubleClick
|
|
' Dim src As DependencyObject = VisualTreeHelper.GetParent(DirectCast(e.OriginalSource, DependencyObject))
|
|
' ' verifico che venga clickato un item, non lo spazio vuoto o la scrollbar
|
|
' If Not TypeOf src Is ListBoxItem Then
|
|
' src = Utility.FindAncestor(Of ListBoxItem)(src)
|
|
' End If
|
|
' If IsNothing(src) OrElse src.[GetType]() <> GetType(ListBoxItem) Then
|
|
' e.Handled = True
|
|
' Else
|
|
' If Not IsNothing(m_SelectedFile) Then
|
|
' m_FileName = SelectedFile
|
|
' DialogResult = True
|
|
' End If
|
|
' End If
|
|
'End Sub
|
|
|
|
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
|
|
DialogResult = m_OpenProjFileDialogVM.VerifySelected()
|
|
End Sub
|
|
|
|
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_OpenProjFileDialogVM.m_CloseWindow
|
|
Me.DialogResult = bDialogResult
|
|
End Sub
|
|
|
|
End Class |