From 20fd5a2e5737a07d7f80d6e00fba1c9437b4f6be Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Fri, 17 Jan 2025 14:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E7=A9=BA=E7=93=B6=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BB=B6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/App.xaml.cs | 2 ++ DM_Weight/ViewModels/EmptyWindowViewModel.cs | 12 ++++++++ .../ViewModels/ReturnEmptyDialogViewModel.cs | 2 +- .../ViewModels/ReturnEmptyWindowViewModel.cs | 8 ++++-- DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml | 2 +- .../Views/Dialog/ReturnEmptyDialog.xaml.cs | 12 ++++---- DM_Weight/Views/EmptyWindow.xaml | 12 ++++++++ DM_Weight/Views/EmptyWindow.xaml.cs | 28 +++++++++++++++++++ 8 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 DM_Weight/ViewModels/EmptyWindowViewModel.cs create mode 100644 DM_Weight/Views/EmptyWindow.xaml create mode 100644 DM_Weight/Views/EmptyWindow.xaml.cs diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs index fb5455e..8546c7a 100644 --- a/DM_Weight/App.xaml.cs +++ b/DM_Weight/App.xaml.cs @@ -279,6 +279,8 @@ namespace DM_Weight containerRegistry.RegisterForNavigation(); //账册服务类 containerRegistry.Register(); + + containerRegistry.RegisterForNavigation(); } private void PrismApplication_Startup(object sender, StartupEventArgs e) diff --git a/DM_Weight/ViewModels/EmptyWindowViewModel.cs b/DM_Weight/ViewModels/EmptyWindowViewModel.cs new file mode 100644 index 0000000..2909812 --- /dev/null +++ b/DM_Weight/ViewModels/EmptyWindowViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Weight.ViewModels +{ + internal class EmptyWindowViewModel + { + } +} diff --git a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs index a5fbc69..37da7da 100644 --- a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs +++ b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs @@ -220,7 +220,6 @@ namespace DM_Weight.ViewModels { get => new DelegateCommand(() => { - if (MachineRecords != null && MachineRecords.Count>0) { MachineRecords = MachineRecords.Select(x => @@ -228,6 +227,7 @@ namespace DM_Weight.ViewModels if (x.Id == _MachineRecord.Id) { x.IsSelected = !x.IsSelected; + CheckboxChecked(); } return x; }).ToList(); diff --git a/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs b/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs index f1a5610..2a3fddc 100644 --- a/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs +++ b/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs @@ -44,11 +44,13 @@ namespace DM_Weight.ViewModels //this.SqlSugarHelper.Db = sqlSugarScope; } - public DelegateCommand RowSelected + public DelegateCommand RowSelected { - get => new DelegateCommand(() => + get => new DelegateCommand(async () => { - + + // 此处延时1毫秒,等待页面渲染(规避工控机上手指点击弹出的页面上的按钮无效问题) + await Task.Delay(TimeSpan.FromMilliseconds(1)); if (Channel != null &&string.IsNullOrEmpty(Channel.DrugId)) { DialogParameters dialogParameters = new DialogParameters(); diff --git a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml index 3ed4c2c..12e732b 100644 --- a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml +++ b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml @@ -163,7 +163,7 @@ - + diff --git a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml.cs b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml.cs index 1395a14..5f93476 100644 --- a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml.cs +++ b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml.cs @@ -22,16 +22,16 @@ namespace DM_Weight.Views.Dialog /// public partial class ReturnEmptyDialog : UserControl { - IEventAggregator _eventAggregator; + //IEventAggregator _eventAggregator; public ReturnEmptyDialog(IEventAggregator eventAggregator) { InitializeComponent(); - this._eventAggregator= eventAggregator; + //this._eventAggregator= eventAggregator; } - private void CheckBox_Click(object sender, RoutedEventArgs e) - { - _eventAggregator.GetEvent().Publish(); - } + //private void CheckBox_Click(object sender, RoutedEventArgs e) + //{ + // _eventAggregator.GetEvent().Publish(); + //} } } diff --git a/DM_Weight/Views/EmptyWindow.xaml b/DM_Weight/Views/EmptyWindow.xaml new file mode 100644 index 0000000..7c2ec50 --- /dev/null +++ b/DM_Weight/Views/EmptyWindow.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/DM_Weight/Views/EmptyWindow.xaml.cs b/DM_Weight/Views/EmptyWindow.xaml.cs new file mode 100644 index 0000000..b327868 --- /dev/null +++ b/DM_Weight/Views/EmptyWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace DM_Weight.Views +{ + /// + /// EmptyWindow.xaml 的交互逻辑 + /// + public partial class EmptyWindow : UserControl + { + public EmptyWindow() + { + InitializeComponent(); + } + } +}