From 49469a74cbe35a8c342c9a731a015fea168cc80f Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Thu, 23 Dec 2021 04:10:37 -0800 Subject: [PATCH] dont animate item opacity --- Indirect/Controls/ThreadItemControl.xaml.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Indirect/Controls/ThreadItemControl.xaml.cs b/Indirect/Controls/ThreadItemControl.xaml.cs index 1137ca2..c9adb8a 100644 --- a/Indirect/Controls/ThreadItemControl.xaml.cs +++ b/Indirect/Controls/ThreadItemControl.xaml.cs @@ -17,7 +17,6 @@ using NeoSmart.Unicode; using System.Numerics; using Windows.UI.Xaml.Hosting; -using Windows.UI.Composition; // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 @@ -74,22 +73,12 @@ private void MainContentControl_SizeChanged(object sender, SizeChangedEventArgs var prev = e.PreviousSize.ToVector2(); var next = e.NewSize.ToVector2(); - var batch = Window.Current.Compositor.CreateScopedBatch(CompositionBatchTypes.Animation); var anim = Window.Current.Compositor.CreateVector3KeyFrameAnimation(); anim.InsertKeyFrame(0, new Vector3(prev / next, 1)); anim.InsertKeyFrame(1, Vector3.One); var content = ((ContentControl)sender).ContentTemplateRoot; var panel = ElementCompositionPreview.GetElementVisual(content); - - if (!Item.IsInitialized) - { - var scalarAnim = Window.Current.Compositor.CreateScalarKeyFrameAnimation(); - scalarAnim.InsertKeyFrame(0, 0); - scalarAnim.InsertKeyFrame(1, 1); - panel.StartAnimation("Opacity", scalarAnim); - } - panel.CenterPoint = new Vector3(Item.FromMe ? next.X : 0, 0, 0); panel.StartAnimation("Scale", anim); @@ -102,8 +91,6 @@ private void MainContentControl_SizeChanged(object sender, SizeChangedEventArgs var text = ElementCompositionPreview.GetElementVisual(content.FindDescendant()); text.StartAnimation("Scale", factor); } - - batch.End(); } public void OnItemClick()