OmagVIEWPlus 2.3a1:
-> aggiornamento automatico della lista "PartList"; -> verifica funzionamento ultima versione.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="TablePartWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False" IsClosable="True"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
Height="Auto" Width="850">
|
||||
<TabControl Name="MyProject" ItemsSource="{Binding ProjetcList}" SelectedItem="{Binding ProjSelected}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Text="{Binding IdProject}" />
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<DataGrid Name="MyParts" ItemsSource="{Binding CurrListPart}" AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="IdPart" Binding="{Binding IdPart}" Width="*"/>
|
||||
<DataGridTextColumn Header="Dim Y" Binding="{Binding MinRectY}" Width="*"/>
|
||||
<DataGridTextColumn Header="Dim X" Binding="{Binding MinRectX}" Width="*"/>
|
||||
<DataGridTextColumn Header="Palce" Binding="{Binding enPlace}" Width="*"/>
|
||||
<DataGridTextColumn Header="Status" Binding="{Binding enStatus}" Width="*"/>
|
||||
<DataGridTextColumn Header="Unloading" Binding="{Binding enUnloading}" Width="*"/>
|
||||
<DataGridTextColumn Header="IdBox" Binding="{Binding IdBox}" Width="*"/>
|
||||
<DataGridTextColumn Header="Warehouse" Binding="{Binding enWarehouse}" Width="*"/>
|
||||
<DataGridTextColumn Header="Layer" Binding="{Binding nLayer}" Width="*"/>
|
||||
<DataGridTextColumn Header="Position" Binding="{Binding nPositionLayer}" Width="*"/>
|
||||
<DataGridTextColumn Header="Offset Y" Binding="{Binding dOffestPartY}" Width="*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</TabControl>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,11 @@
|
||||
Public Class TablePartWindowV
|
||||
Private m_TablePartWindowVM As TablePartWindowVM
|
||||
Sub New(Owner As Window, objTablePartWindowVM As TablePartWindowVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
Me.DataContext = objTablePartWindowVM
|
||||
m_TablePartWindowVM = objTablePartWindowVM
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,111 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class TablePartWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
Friend refTablePartWindowV As TablePartWindowV
|
||||
|
||||
Private m_ProjetcList As New ObservableCollection(Of ProjectListParts)
|
||||
Public Property ProjetcList As ObservableCollection(Of ProjectListParts)
|
||||
Get
|
||||
Return m_ProjetcList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of ProjectListParts))
|
||||
m_ProjetcList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProjSelected As ProjectListParts
|
||||
Public Property ProjSelected As ProjectListParts
|
||||
Get
|
||||
Return m_ProjSelected
|
||||
End Get
|
||||
Set(value As ProjectListParts)
|
||||
m_ProjSelected = value
|
||||
NotifyPropertyChanged("CurrListPart")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub RefreshProject()
|
||||
Dim m_CurrentPartList As New ObservableCollection(Of Part)
|
||||
Dim bAddNewList As Boolean = True
|
||||
' salvo le liste in funzione del numero di progetto
|
||||
If Not IsNothing(Map.refUnloadingAreaVM) Then
|
||||
For Each ItemPart In Map.refUnloadingAreaVM.ListPart
|
||||
For Each Item In m_ProjetcList
|
||||
If Item.IdProject = ItemPart.IdProject.ToString Then
|
||||
bAddNewList = False
|
||||
Exit For
|
||||
End If
|
||||
bAddNewList = True
|
||||
Next
|
||||
If bAddNewList Then
|
||||
m_CurrentPartList.Add(ItemPart)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If m_CurrentPartList.Count > 0 Then
|
||||
m_ProjetcList.Add(New ProjectListParts(m_CurrentPartList))
|
||||
NotifyPropertyChanged("CurrentPartList")
|
||||
' seleziono come progetto quello in fase di scarico
|
||||
m_ProjSelected = m_ProjetcList.Last
|
||||
NotifyPropertyChanged("ProjetcList")
|
||||
NotifyPropertyChanged("ProjSelected")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub New(IdProj As Integer)
|
||||
refTablePartWindowV = New TablePartWindowV(Application.Current.MainWindow, Me)
|
||||
For Each Itemproj In Map.refMainWindowVM.MainWindowM.ProjIndList
|
||||
Dim m_CurrentPartList As New ObservableCollection(Of Part)
|
||||
' salvo le liste in funzione del numero del numero di progetto
|
||||
If Not IsNothing(Map.refUnloadingAreaVM) Then
|
||||
For Each ItemPart In Map.refUnloadingAreaVM.ListPart
|
||||
If ItemPart.IdProject = Itemproj.nProjInd Then
|
||||
m_CurrentPartList.Add(ItemPart)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If m_CurrentPartList.Count > 0 Then
|
||||
m_ProjetcList.Add(New ProjectListParts(m_CurrentPartList))
|
||||
NotifyPropertyChanged("CurrentPartList")
|
||||
m_ProjSelected = m_ProjetcList.Last
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged("ProjetcList")
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ProjectListParts
|
||||
Inherits VMBase
|
||||
|
||||
Private m_CurrListPart As New ObservableCollection(Of Part)
|
||||
Public Property CurrListPart As ObservableCollection(Of Part)
|
||||
Get
|
||||
Return m_CurrListPart
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Part))
|
||||
m_CurrListPart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IdProject As String
|
||||
Public Property IdProject As String
|
||||
Get
|
||||
Return m_IdProject
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_IdProject = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(obCurrListParts As ObservableCollection(Of Part))
|
||||
m_CurrListPart = obCurrListParts
|
||||
If m_CurrListPart.Count > 0 Then
|
||||
m_IdProject = m_CurrListPart(0).IdProject.ToString
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user