- spostamento + cambio nome
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<Window x:Class="ProcessManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Height="200"
|
||||
Width="300">
|
||||
<StackPanel>
|
||||
<Grid HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Arguments Queue Count: "/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding ArgumentsQueue}"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="ResultQueue: "/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Text="{Binding ResultQueueCount}"/>
|
||||
</Grid>
|
||||
<!--<DataGrid ItemsSource="{Binding ThreadList}"
|
||||
AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Process Status"
|
||||
Binding="{Binding ProcessStatus}"/>
|
||||
<DataGridTextColumn Header="Curr Request Id"
|
||||
Binding="{Binding CurrRequest.nId}"/>
|
||||
<DataGridTextColumn Header="Curr Request Args"
|
||||
Binding="{Binding CurrRequest.sArgs}"/>
|
||||
<DataGridTextColumn Header="Process Result"
|
||||
Binding="{Binding nProcResult}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>-->
|
||||
<ItemsControl ItemsSource="{Binding ThreadList}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding ProcessStatus}"/>
|
||||
<TextBlock Text="{Binding CurrRequest.nId}"/>
|
||||
<TextBlock Text="{Binding CurrRequest.sArgs}"/>
|
||||
<TextBlock Text="{Binding nProcResult}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</StackPanel>
|
||||
</Window>
|
||||
@@ -0,0 +1,19 @@
|
||||
Public Class ProcessManagerV
|
||||
|
||||
Private WithEvents m_ProcessManagerVM As ProcessManagerVM
|
||||
|
||||
Sub New(Owner As Window, ProcessManagerVM As ProcessManagerVM)
|
||||
'MyBase.New(Owner)
|
||||
Me.Owner = Owner
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ProcessManagerVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ProcessManagerVM = ProcessManagerVM
|
||||
End Sub
|
||||
|
||||
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ProcessManagerVM.m_CloseWindow
|
||||
' Me.DialogResult = bDialogResult
|
||||
'End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,52 @@
|
||||
Imports System.Windows.Threading
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class ProcessManagerVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_UpdateDataTimer As New DispatcherTimer
|
||||
|
||||
Private m_ExecProcessManager As ExecProcessManager
|
||||
Public ReadOnly Property ExecProcessManager As ExecProcessManager
|
||||
Get
|
||||
Return m_ExecProcessManager
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ArgumentsQueue As String
|
||||
Get
|
||||
Return m_ExecProcessManager.ArgumentsQueueCount.ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ResultQueue As String
|
||||
Get
|
||||
Return m_ExecProcessManager.ArgumentsResultQueueCount.ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ThreadList As ObservableCollection(Of ThreadData)
|
||||
Get
|
||||
If Not IsNothing(m_ExecProcessManager.ThreadDataList) Then
|
||||
Return New ObservableCollection(Of ThreadData)(m_ExecProcessManager.ThreadDataList.ToList())
|
||||
Else
|
||||
Return New ObservableCollection(Of ThreadData)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ExecProcessManager As ExecProcessManager)
|
||||
m_ExecProcessManager = ExecProcessManager
|
||||
m_UpdateDataTimer.Interval = New TimeSpan(0, 0, 1)
|
||||
AddHandler m_UpdateDataTimer.Tick, AddressOf UpdateDataTimer_Tick
|
||||
m_UpdateDataTimer.Start()
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateDataTimer_Tick(sender As Object, e As EventArgs)
|
||||
NotifyPropertyChanged(NameOf(ArgumentsQueue))
|
||||
NotifyPropertyChanged(NameOf(ResultQueue))
|
||||
NotifyPropertyChanged(NameOf(ThreadList))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user