Exemplo n.º 1
0
        private async Task NewMethod(MyControl referenceChild, MyControl animatedChild)
        {
            AnimationHelper.TranslateX(animatedChild, 100);
            await Task.Delay(WAIT);

            AnimationHelper.TranslateY(animatedChild, 100);
            await Task.Delay(WAIT);

            AnimationHelper.TranslateX(animatedChild, -100);
            await Task.Delay(WAIT);

            AnimationHelper.TranslateY(animatedChild, 0);
            await Task.Delay(WAIT);

            AnimationHelper.TranslateX(animatedChild, 0);
            await Task.Delay(WAIT);
        }
Exemplo n.º 2
0
        private async void MyCanvas_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            var referenceChild = new MyControl();
            var animatedChild  = new MyControl()
            {
                Background = new SolidColorBrush(Colors.Beige)
            };

            this.Children.Add(referenceChild);
            this.Children.Add(animatedChild);

            Canvas.SetLeft(referenceChild, 100);
            Canvas.SetTop(referenceChild, 100);

            Canvas.SetLeft(animatedChild, 100);
            Canvas.SetTop(animatedChild, 100);

            NewMethod(referenceChild, animatedChild);
        }