还空瓶弹窗添加延时

This commit is contained in:
maqiao 2025-01-17 14:13:58 +08:00
parent aadc0be0ab
commit 20fd5a2e57
8 changed files with 67 additions and 11 deletions

View File

@ -279,6 +279,8 @@ namespace DM_Weight
containerRegistry.RegisterForNavigation<AccountWindow,AccountWindowViewModel>();
//账册服务类
containerRegistry.Register<MachineRecordService>();
containerRegistry.RegisterForNavigation<EmptyWindow, EmptyWindowViewModel>();
}
private void PrismApplication_Startup(object sender, StartupEventArgs e)

View File

@ -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
{
}
}

View File

@ -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();

View File

@ -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();

View File

@ -163,7 +163,7 @@
<GridViewColumn Header="选择" Width="100">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected}" Click="CheckBox_Click" />
<CheckBox IsChecked="{Binding IsSelected}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

View File

@ -22,16 +22,16 @@ namespace DM_Weight.Views.Dialog
/// </summary>
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<CheckBoxCheckEvent>().Publish();
}
//private void CheckBox_Click(object sender, RoutedEventArgs e)
//{
// _eventAggregator.GetEvent<CheckBoxCheckEvent>().Publish();
//}
}
}

View File

@ -0,0 +1,12 @@
<UserControl x:Class="DM_Weight.Views.EmptyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DM_Weight.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

View File

@ -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
{
/// <summary>
/// EmptyWindow.xaml 的交互逻辑
/// </summary>
public partial class EmptyWindow : UserControl
{
public EmptyWindow()
{
InitializeComponent();
}
}
}