コード例 #1
0
        private async Task StartAnimatingTextBox(TextBox textBox)
        {
            int count = animations.Count;

            if (count > 0)
            {
                List <AnimationSet> animationsToRemove = new List <AnimationSet>();
                for (int i = 0; i < count; i++)
                {
                    animations[i].Completed -= Fade_Completed;
                    animations[i].Stop();
                    animationsToRemove.Add(animations[i]);
                }
                int deleteCount = animationsToRemove.Count;
                for (int i = 0; i < count; i++)
                {
                    animations.Remove(animationsToRemove[i]);
                }
                animationsToRemove.Clear();
            }


            var changedTextBox = (TextBox)textBox;

            await changedTextBox.Fade(1, 0).StartAsync();

            if (TweetButton.IsEnabled)
            {
                double duration = FadeAnimationTime;
                var    fade     = TweetTextBox.Fade(0, duration / 2, duration / 2);
                fade.Completed += Fade_Completed;
                animations.Add(fade);
                await fade.StartAsync();
            }
        }
コード例 #2
0
 private async void Fade_Completed(object sender, AnimationSetCompletedEventArgs e)
 {
     TweetTextBox.Text = "";
     await TweetTextBox.Fade(1, ShowAnimationTime).StartAsync();
 }