Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Animation performance descrease over time
    primarykey
    data
    text
    <p>i have two animation:</p> <pre><code> &lt;Storyboard x:Key="ChangeLayout"&gt; &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="currentContent"&gt; &lt;EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="900"/&gt; &lt;EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"&gt; &lt;EasingDoubleKeyFrame.EasingFunction&gt; &lt;CircleEase EasingMode="EaseInOut"/&gt; &lt;/EasingDoubleKeyFrame.EasingFunction&gt; &lt;/EasingDoubleKeyFrame&gt; &lt;/DoubleAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;Storyboard x:Key="HideLayout"&gt; &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="currentContent"&gt; &lt;EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-900"&gt; &lt;EasingDoubleKeyFrame.EasingFunction&gt; &lt;CircleEase EasingMode="EaseInOut"/&gt; &lt;/EasingDoubleKeyFrame.EasingFunction&gt; &lt;/EasingDoubleKeyFrame&gt; &lt;/DoubleAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; </code></pre> <p>And code that begin they:</p> <pre><code>private void btnUser_Click(object sender, RoutedEventArgs e) { if (currentContent.Content != null) if (currentContent.Content.GetType() == typeof(Layouts.User)) return; ((hl.Children[0] as DoubleAnimationUsingKeyFrames).KeyFrames[0] as EasingDoubleKeyFrame).Value = -this.ActualWidth; hl.Completed += (_sender, _e) =&gt; { currentContent.Content = new Layouts.User(); cl.Completed += (ssender, ee) =&gt; { btnMusic.Opacity = 0.5; btnUser.Opacity = 0.9; }; cl.Begin(); }; hl.Begin(); } private void btnMusic_Click(object sender, RoutedEventArgs e) { if (currentContent.Content != null) if (currentContent.Content.GetType() == typeof(Layouts.Music)) return; ((hl.Children[0] as DoubleAnimationUsingKeyFrames).KeyFrames[0] as EasingDoubleKeyFrame).Value = -this.ActualWidth; hl.Completed += (_sender, _e) =&gt; { if (Layouts.Music.CurrentMusic == null) { Layouts.Music.CurrentMusic = new Layouts.Music(); Layouts.Music.CurrentMusic.GetMusic(); } currentContent.Content = Layouts.Music.CurrentMusic; cl.Completed += (ssender, ee) =&gt; { btnUser.Opacity = 0.5; btnMusic.Opacity = 0.8; }; cl.Begin(); }; hl.Begin(); } </code></pre> <p>After a few switches between user and content of music, ChangeLayout animation begins very slow and laggy and animated according to the WPF Performance Suite FPS animation after switching drops from 500 + to a maximum of 4eh ... Can't find any solution for this =(</p> <p>Sry for my english, i am studying so far.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload