拍单信息优化 异常单逻辑优化,异常单直拍(50%)
This commit is contained in:
1 parent
e00209cb24
commit
ac0430f3f7
26 files changed
+1663
-478
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AllBase.Helper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -109,34 +110,48 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
DialogResult = false;
|
||||
}
|
||||
|
||||
public static void ShowAnimateMessage(string message)
|
||||
public static void ShowAnimateMessage(string message, string type = "Msg", int DurationSeconds = 1)
|
||||
{
|
||||
MainWindow.Instance.tbMessage.Text = message;
|
||||
MainWindow.Instance.borderMessage.Visibility = Visibility.Visible;
|
||||
// 创建Storyboard并添加动画
|
||||
Storyboard storyboard = new Storyboard();
|
||||
DoubleAnimation fadeInAnimation1 = new DoubleAnimation
|
||||
MainWindow.Instance.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
From = 0, // 开始时完全透明
|
||||
To = 1, // 结束时完全不透明
|
||||
Duration = new Duration(TimeSpan.FromSeconds(0.2)) // 持续时间2秒
|
||||
};
|
||||
Storyboard.SetTarget(fadeInAnimation1, MainWindow.Instance.borderMessage);
|
||||
Storyboard.SetTargetProperty(fadeInAnimation1, new PropertyPath(OpacityProperty));
|
||||
storyboard.Children.Add(fadeInAnimation1);
|
||||
if (type.ToLower() == "msg")
|
||||
{
|
||||
MainWindow.Instance.borderMessage.BorderBrush = Application.Current.Resources["pageColorBrush"] as SolidColorBrush;
|
||||
MainWindow.Instance.tbMessage.Foreground = Application.Current.Resources["pageColorBrush"] as SolidColorBrush;
|
||||
}
|
||||
if (type.ToLower() == "error")
|
||||
{
|
||||
MainWindow.Instance.borderMessage.BorderBrush = Application.Current.Resources["PageWarningBrush"] as SolidColorBrush;
|
||||
MainWindow.Instance.tbMessage.Foreground = Application.Current.Resources["PageWarningBrush"] as SolidColorBrush;
|
||||
}
|
||||
|
||||
DoubleAnimation fadeInAnimation2 = new DoubleAnimation
|
||||
{
|
||||
BeginTime = new TimeSpan(0, 0, 1),
|
||||
From = 1,
|
||||
To = 0,
|
||||
Duration = new Duration(TimeSpan.FromSeconds(0.2)) // 持续时间2秒
|
||||
};
|
||||
Storyboard.SetTarget(fadeInAnimation2, MainWindow.Instance.borderMessage);
|
||||
Storyboard.SetTargetProperty(fadeInAnimation2, new PropertyPath(OpacityProperty));
|
||||
storyboard.Children.Add(fadeInAnimation2);
|
||||
// 开始动画
|
||||
storyboard.Begin();
|
||||
MainWindow.Instance.tbMessage.Text = message;
|
||||
MainWindow.Instance.borderMessage.Visibility = Visibility.Visible;
|
||||
// 创建Storyboard并添加动画
|
||||
Storyboard storyboard = new Storyboard();
|
||||
DoubleAnimation fadeInAnimation1 = new DoubleAnimation
|
||||
{
|
||||
From = 0, // 开始时完全透明
|
||||
To = 1, // 结束时完全不透明
|
||||
Duration = new Duration(TimeSpan.FromSeconds(0.2)) // 持续时间2秒
|
||||
};
|
||||
Storyboard.SetTarget(fadeInAnimation1, MainWindow.Instance.borderMessage);
|
||||
Storyboard.SetTargetProperty(fadeInAnimation1, new PropertyPath(OpacityProperty));
|
||||
storyboard.Children.Add(fadeInAnimation1);
|
||||
|
||||
DoubleAnimation fadeInAnimation2 = new DoubleAnimation
|
||||
{
|
||||
BeginTime = new TimeSpan(0, 0, DurationSeconds),
|
||||
From = 1,
|
||||
To = 0,
|
||||
Duration = new Duration(TimeSpan.FromSeconds(0.2)) // 持续时间2秒
|
||||
};
|
||||
Storyboard.SetTarget(fadeInAnimation2, MainWindow.Instance.borderMessage);
|
||||
Storyboard.SetTargetProperty(fadeInAnimation2, new PropertyPath(OpacityProperty));
|
||||
storyboard.Children.Add(fadeInAnimation2);
|
||||
// 开始动画
|
||||
storyboard.Begin();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user