|
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using BPA.Helper;
- using BPASmartClient.CustomResource.UserControls;
- using BPASmartClient.CustomResource.UserControls.MessageShow;
-
- namespace BPASmartClient.DosingSystem.ViewModel
- {
- public class CommparSetViewModel : NotifyBase
- {
- public CommparSetViewModel()
- {
- SaveCommand = new BPARelayCommand(() =>
- {
- if (!string.IsNullOrEmpty(CommBaseParModel.NetworkSegAddress))
- {
- var res = CommBaseParModel.NetworkSegAddress.Split(".");
- if (res != null)
- {
- if (res.Length >= 3)
- {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < 3; i++) sb.Append($"{res[i]}.");
- Json<DevicePar>.Data.BaseParModel.NetworkSegAddress = sb.ToString();
- Json<DevicePar>.Save();
- NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"参数保存成功!");
- }
- }
- }
- });
- }
-
- public BasePar CommBaseParModel { get { return Json<DevicePar>.Data.BaseParModel; } set { Json<DevicePar>.Data.BaseParModel = value; OnPropertyChanged(); } }
- //private BasePar _mCommBaseParModel;
-
- public BPARelayCommand SaveCommand { get; set; }
-
- }
- }
|