public void Hide() { UiThread.Dispatch(() => { _scoreLabel.Visibility = Visibility.Hidden; }); }
public void Hide() { UiThread.Dispatch(() => { _photoRectangle.Visibility = Visibility.Hidden; }); }
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); }); }
public void Show() { UiThread.Dispatch(() => { _rectangle.Visibility = Visibility.Visible; _nationalityLabel.Visibility = Visibility.Visible; }); }
public void Show(int currentScore) { UiThread.Dispatch(() => { _scoreLabel.Content = $"Total score is {currentScore}"; _scoreLabel.Visibility = Visibility.Visible; }); }
private void AddControls() { UiThread.Dispatch(() => { AddRectangle(); AddNationalityLabel(); }); }
public void Hide() { UiThread.Dispatch(() => { _scoreLabel.Content = string.Empty; _stackPanel.Visibility = Visibility.Hidden; }); }
public void Show(int totalScore) { UiThread.Dispatch(() => { _scoreLabel.Content = $"Your total score is {totalScore}"; _stackPanel.Visibility = Visibility.Visible; }); }
private void CreateControls() { UiThread.Dispatch(() => { CreateStackPanel(); CreateScoreLabel(); CreatePlayAgainButton(); }); }
public void Show(Photo photo) { _photo = photo; UiThread.Dispatch(() => { RemovePreviousPhotoRectangleIfExists(); CreatePhotoRectangle(); }); Refresh(); }
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(); }); }
private void CreateControls() { UiThread.Dispatch(CreateScoreLabel); }