From 5255fad7fc5be8d9b677bb83cb2c7312bc271c1d Mon Sep 17 00:00:00 2001 From: NicolaP Date: Mon, 5 Sep 2022 16:30:04 +0200 Subject: [PATCH] Gestione ricerca file DXF --- DrawImport/ImportPageUC.xaml | 19 ++++++++++++++++--- DrawImport/ImportPageUC.xaml.vb | 30 ++++++++++++++++++++++++++++++ Project/OpenPageUC.xaml | 17 +++++++++-------- Project/OpenPageUC.xaml.vb | 1 + 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/DrawImport/ImportPageUC.xaml b/DrawImport/ImportPageUC.xaml index 3779149..f9d19e9 100644 --- a/DrawImport/ImportPageUC.xaml +++ b/DrawImport/ImportPageUC.xaml @@ -49,15 +49,28 @@ - + + + ItemsSource="{Binding ItemList}"/> - + + + + + + + + + + diff --git a/DrawImport/ImportPageUC.xaml.vb b/DrawImport/ImportPageUC.xaml.vb index ab823b0..3e44ebb 100644 --- a/DrawImport/ImportPageUC.xaml.vb +++ b/DrawImport/ImportPageUC.xaml.vb @@ -297,6 +297,36 @@ Public Class ImportPageUC End Select End Sub + Private Sub FindTxBx_EgtClosed(sender As Object, e As EventArgs) Handles FindTxBx.EgtClosed + ' Elimino spazi iniziali e finali + FindTxBx.Text = FindTxBx.Text.Trim() + ' ricarico la lista dei file + LoadCurrDir() + Dim UpdateListFile As New List(Of IconListBoxItem) + ' Se esiste un nome + If Not String.IsNullOrWhiteSpace(FindTxBx.Text) Then + For Each Item As IconListBoxItem In FileListBox.ItemsSource + If Item.Name.ToLower.Contains(FindTxBx.Text.ToLower) Then + UpdateListFile.Add(Item) + End If + Next + End If + If UpdateListFile.Count > 0 Then + FileListBox.ItemsSource = UpdateListFile + Else + FileListBox.ItemsSource = m_MainWindow.m_ImportItemList + End If + End Sub + + Private Sub ClearFindBtn_Click() Handles ClearFindBtn.Click + ' svuoto la text + FindTxBx.Text = "" + ' ricarico la lista dei file + LoadCurrDir() + ' e aggiorno la lista dei file + FileListBox.ItemsSource = m_MainWindow.m_ImportItemList + End Sub + Private Function ClearView() As Boolean ' Pulisco il DB geometrico locale EgtNewFile() diff --git a/Project/OpenPageUC.xaml b/Project/OpenPageUC.xaml index e4d0c68..397e1d9 100644 --- a/Project/OpenPageUC.xaml +++ b/Project/OpenPageUC.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib" mc:Ignorable="d" d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded"> @@ -17,22 +18,22 @@ - - + + - + - + - + - + ItemsSource="{Binding ItemList}"/> + diff --git a/Project/OpenPageUC.xaml.vb b/Project/OpenPageUC.xaml.vb index c438080..c507886 100644 --- a/Project/OpenPageUC.xaml.vb +++ b/Project/OpenPageUC.xaml.vb @@ -38,6 +38,7 @@ Public Class OpenPageUC OpenSceneHost.SetValue(Grid.ColumnProperty, 1) OpenSceneHost.SetValue(Grid.RowProperty, 2) ' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1) + OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2) Me.OpenPageGrid.Children.Add(OpenSceneHost) ' Definizione del collegamento tra ItemList e ListBox1