|
|
@ -1,7 +1,7 @@
|
|
|
|
using GalaSoft.MvvmLight;
|
|
|
|
|
|
|
|
using GalaSoft.MvvmLight.Command;
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
using SlnMesnac.Serilog;
|
|
|
|
using SlnMesnac.Serilog;
|
|
|
|
using SlnMesnac.WPF.Page.Generate;
|
|
|
|
using SlnMesnac.WPF.Page.Generate;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
@ -9,7 +9,7 @@ using System.Windows;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.WPF.ViewModel
|
|
|
|
namespace SlnMesnac.WPF.ViewModel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class MainWindowViewModel: ViewModelBase
|
|
|
|
public partial class MainWindowViewModel: ObservableObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public readonly SerilogHelper _logger;
|
|
|
|
public readonly SerilogHelper _logger;
|
|
|
|
|
|
|
|
|
|
|
@ -23,8 +23,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
private int _PlcStatus = 0;
|
|
|
|
private int _PlcStatus = 0;
|
|
|
|
public int PlcStatus
|
|
|
|
public int PlcStatus
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return _PlcStatus; }
|
|
|
|
get => _PlcStatus;
|
|
|
|
set { _PlcStatus = value; RaisePropertyChanged(nameof(PlcStatus)); }
|
|
|
|
set => SetProperty(ref _PlcStatus, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 箱壳扫码器状态
|
|
|
|
/// 箱壳扫码器状态
|
|
|
@ -32,8 +32,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
private int _ShellScannerStatus = 0;
|
|
|
|
private int _ShellScannerStatus = 0;
|
|
|
|
public int ShellScannerStatus
|
|
|
|
public int ShellScannerStatus
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return _ShellScannerStatus; }
|
|
|
|
get => _ShellScannerStatus;
|
|
|
|
set { _ShellScannerStatus = value; RaisePropertyChanged(nameof(ShellScannerStatus)); }
|
|
|
|
set => SetProperty(ref _ShellScannerStatus, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -42,39 +42,25 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
private int _BoldScannerStatus = 0;
|
|
|
|
private int _BoldScannerStatus = 0;
|
|
|
|
public int BoldScannerStatus
|
|
|
|
public int BoldScannerStatus
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return _BoldScannerStatus; }
|
|
|
|
get => _BoldScannerStatus;
|
|
|
|
set { _BoldScannerStatus = value; RaisePropertyChanged(nameof(BoldScannerStatus)); }
|
|
|
|
set => SetProperty(ref _BoldScannerStatus, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public System.Windows.Controls.UserControl _content;
|
|
|
|
public System.Windows.Controls.UserControl _content;
|
|
|
|
|
|
|
|
|
|
|
|
public System.Windows.Controls.UserControl UserContent
|
|
|
|
public System.Windows.Controls.UserControl UserContent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return _content; }
|
|
|
|
get => _content;
|
|
|
|
|
|
|
|
set => SetProperty(ref _content, value);
|
|
|
|
set
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_content = value;
|
|
|
|
|
|
|
|
RaisePropertyChanged(nameof(UserContent));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 事件定义
|
|
|
|
#region 事件定义
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 界面跳转按钮事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public RelayCommand<object> ControlOnClickCommand { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 打开系统键盘
|
|
|
|
/// 打开系统键盘
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public RelayCommand OpenSystemKeyboardCommand { get; set; }
|
|
|
|
public RelayCommand OpenSystemKeyboardCommand { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 窗体控制
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public RelayCommand<object> FormControlCommand { get; set; }
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public MainWindowViewModel()
|
|
|
|
public MainWindowViewModel()
|
|
|
@ -82,8 +68,6 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
_logger = App.ServiceProvider.GetService<SerilogHelper>();
|
|
|
|
_logger = App.ServiceProvider.GetService<SerilogHelper>();
|
|
|
|
|
|
|
|
|
|
|
|
ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj));
|
|
|
|
|
|
|
|
FormControlCommand = new RelayCommand<object>(x => FormControl(x));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -91,6 +75,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
/// 窗体控制
|
|
|
|
/// 窗体控制
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="obj"></param>
|
|
|
|
/// <param name="obj"></param>
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
private void FormControl(object obj)
|
|
|
|
private void FormControl(object obj)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
@ -137,6 +122,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 界面跳转
|
|
|
|
/// 界面跳转
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
private void ControlOnClick(object obj)
|
|
|
|
private void ControlOnClick(object obj)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|