46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using CordonelAssemblyLine.Model;
|
|
using System;
|
|
using System.Threading;
|
|
using System.Windows;
|
|
|
|
namespace CordonelAssemblyLine
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for Picking.xaml
|
|
/// </summary>
|
|
public partial class Picking
|
|
{
|
|
readonly PickingViewModel _model = new PickingViewModel();
|
|
readonly CancellationToken _globalCancellationToken;
|
|
|
|
readonly String _scannerPort;
|
|
readonly Int32 _slotNr;
|
|
public Picking(CancellationToken globalCancellationToken, String scannerPort, Int32 slotNr)
|
|
{
|
|
_scannerPort = scannerPort;
|
|
_slotNr = slotNr;
|
|
_globalCancellationToken = globalCancellationToken;
|
|
DataContext = _model;
|
|
InitializeComponent();
|
|
Left = SystemParameters.VirtualScreenLeft;
|
|
Top = SystemParameters.VirtualScreenTop +250;
|
|
Height = SystemParameters.VirtualScreenHeight * 0.90;
|
|
Width = SystemParameters.VirtualScreenWidth - SystemParameters.PrimaryScreenWidth;
|
|
}
|
|
|
|
|
|
private void Window_Loaded(Object sender, RoutedEventArgs e)
|
|
{
|
|
_model.StartPicking(_globalCancellationToken, _scannerPort, _slotNr);
|
|
|
|
|
|
}
|
|
|
|
private void Window_Closing(Object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
_model.Dispose();
|
|
Title = "";
|
|
}
|
|
}
|
|
}
|