From 1a1350ee5323660c016537942aae164ecda30868 Mon Sep 17 00:00:00 2001 From: liufei Date: Mon, 23 May 2022 17:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BC=98=E5=8C=96=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E9=80=9F=E5=BA=A6,=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PannelCard/RightCardControl.xaml.cs | 66 +++++++++++++++++-- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml.cs b/Control/UserControls/PannelCard/RightCardControl.xaml.cs index 1017ac9..ebc1473 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/RightCardControl.xaml.cs @@ -14,6 +14,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media.Animation; +using System.Windows.Threading; namespace GeekDesk.Control.UserControls.PannelCard { @@ -437,10 +438,10 @@ namespace GeekDesk.Control.UserControls.PannelCard Thread t = new Thread(() => { - this.Dispatcher.BeginInvoke(new Action(() => - { - ImgStoryBoard(sender, appData.AppConfig.ImageWidth, appData.AppConfig.ImageHeight, 260); - })); + this.Dispatcher.BeginInvoke(new Action(() => + { + ImgStoryBoard(sender, appData.AppConfig.ImageWidth, appData.AppConfig.ImageHeight, 260); + })); }); t.IsBackground = true; t.Start(); @@ -453,6 +454,59 @@ namespace GeekDesk.Control.UserControls.PannelCard if (appData.AppConfig.PMModel) return; + //int count = 0; + //Panel sp = sender as Panel; + //Image img = sp.Children[0] as Image; + + + //int nowH = (int)img.Height; + + //bool isSmall = nowH > height; + + //if (!isSmall) + //{ + // img.Height = height; + // img.Width = width; + // return; + //} + //double subLen = (double)Math.Abs(nowH - height) / (double)milliseconds; + + //new Thread(() => + //{ + // this.Dispatcher.Invoke(() => + // { + // while (count < milliseconds) + // { + // if (!isSmall) + // { + // img.Height += subLen; + // img.Width += subLen; + // } else + // { + // //if (img.Height > 1) + // //{ + // // img.Height -= 1; + // // img.Width -= 1; + // //} + // Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, + // new Action(delegate { + // img.Height -= subLen; + // img.Width -= subLen; + // })); + // //img.Height -= subLen; + // //img.Width -= subLen; + // } + // count++; + // Thread.Sleep(1); + // } + // img.Height = height; + // img.Width = width; + // }); + //}).Start(); + + + + Panel sp = sender as Panel; DependencyObject dos = sp.Parent; @@ -519,10 +573,10 @@ namespace GeekDesk.Control.UserControls.PannelCard }; img.BeginAnimation(WidthProperty, widthAnimation); img.BeginAnimation(HeightProperty, heightAnimation); - + //################################################################### //myStoryboard.Completed += (s, e) => //{ - // if (checkRmStoryboard || true) + // if (checkRmStoryboard) // { // ThreadStart ts = new ThreadStart(crs.Remove); // System.Threading.Thread t = new System.Threading.Thread(ts);