Exemplo n.º 1
0
        public void MenuOptions_Transitioned(object sender, EventArgs e)
        {
            CurrentOptions.Children.Clear();

            for (Int32 i = NextOptions.Children.Count - 1; i >= 0; i--)
            {
                TextBlock textBlock = NextOptions.Children[i] as TextBlock;

                textBlock.MouseEnter          += Option_MouseEnter;
                textBlock.MouseLeftButtonDown += Option_MouseLeftButtonDown;

                NextOptions.Children.Remove(textBlock);
                CurrentOptions.Children.Insert(0, textBlock);
            }

            CurrentTitle.Text = NextTitle.Text;
            TitleText         = CurrentTitle.Text;

            DoubleAnimation set = new DoubleAnimation(0.8, new Duration(TimeSpan.FromSeconds(0.0)));

            CurrentOptions.BeginAnimation(TextBlock.OpacityProperty, set);

            TextBlock option = Mouse.DirectlyOver as TextBlock;

            if (option != null && CurrentOptions.Children.Contains(option))
            {
                Option_MouseEnter(option, null);
            }

            Transitioned?.Invoke(this, new EventArgs());
        }