コード例 #1
0
 public void Hide()
 {
     UiThread.Dispatch(() =>
     {
         _scoreLabel.Visibility = Visibility.Hidden;
     });
 }
コード例 #2
0
 public void Hide()
 {
     UiThread.Dispatch(() =>
     {
         _photoRectangle.Visibility = Visibility.Hidden;
     });
 }
コード例 #3
0
 public void Refresh()
 {
     UiThread.Dispatch(() =>
     {
         System.Windows.Controls.Canvas.SetLeft(_photoRectangle, _photo.Center.X - _width / 2);
         System.Windows.Controls.Canvas.SetTop(_photoRectangle, _photo.Center.Y - _height / 2);
     });
 }
コード例 #4
0
 public void Show()
 {
     UiThread.Dispatch(() =>
     {
         _rectangle.Visibility        = Visibility.Visible;
         _nationalityLabel.Visibility = Visibility.Visible;
     });
 }
コード例 #5
0
 public void Show(int currentScore)
 {
     UiThread.Dispatch(() =>
     {
         _scoreLabel.Content    = $"Total score is {currentScore}";
         _scoreLabel.Visibility = Visibility.Visible;
     });
 }
コード例 #6
0
        private void AddControls()
        {
            UiThread.Dispatch(() =>
            {
                AddRectangle();

                AddNationalityLabel();
            });
        }
コード例 #7
0
        public void Hide()
        {
            UiThread.Dispatch(() =>
            {
                _scoreLabel.Content = string.Empty;

                _stackPanel.Visibility = Visibility.Hidden;
            });
        }
コード例 #8
0
        public void Show(int totalScore)
        {
            UiThread.Dispatch(() =>
            {
                _scoreLabel.Content = $"Your total score is {totalScore}";

                _stackPanel.Visibility = Visibility.Visible;
            });
        }
コード例 #9
0
        private void CreateControls()
        {
            UiThread.Dispatch(() =>
            {
                CreateStackPanel();

                CreateScoreLabel();

                CreatePlayAgainButton();
            });
        }
コード例 #10
0
        public void Show(Photo photo)
        {
            _photo = photo;

            UiThread.Dispatch(() =>
            {
                RemovePreviousPhotoRectangleIfExists();

                CreatePhotoRectangle();
            });

            Refresh();
        }
コード例 #11
0
        public void StartFadingOut(double durationInMs)
        {
            UiThread.Dispatch(() =>
            {
                var animation = new DoubleAnimation
                {
                    From         = 1.0,
                    To           = 0.0,
                    FillBehavior = FillBehavior.Stop,
                    BeginTime    = TimeSpan.FromSeconds(0),
                    Duration     = new Duration(TimeSpan.FromMilliseconds(durationInMs))
                };

                var storyboard = new Storyboard();
                storyboard.Children.Add(animation);

                Storyboard.SetTarget(animation, _photoRectangle);
                Storyboard.SetTargetProperty(animation, new PropertyPath(OpacityProperty));

                storyboard.Completed += delegate { _photoRectangle.Visibility = Visibility.Hidden; };

                storyboard.Begin();
            });
        }
コード例 #12
0
 private void CreateControls()
 {
     UiThread.Dispatch(CreateScoreLabel);
 }