예제 #1
0
 private void GamePage_BindingContextChanged(object sender, EventArgs e)
 {
     ((BaseViewModel)BindingContext).PropertyChanged += GamePage_PropertyChanged;
     if (((GameViewModel)BindingContext).IsBusy)
     {
         OldImage.FadeTo(1, 100u);
         DescriptionLabel.FadeTo(0, 100u);
         ContentPage_SizeChanged(null, null);
     }
 }
예제 #2
0
        private async void GamePage_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(GameViewModel.Progress))
            {
                AdjustTemp(((GameViewModel)BindingContext).Progress);
            }
            else if (e.PropertyName == nameof(GameViewModel.VictoryMode))
            {
                bool state = ((GameViewModel)BindingContext).VictoryMode;
                Shell.Current.FlyoutBehavior = state ? FlyoutBehavior.Disabled : FlyoutBehavior.Flyout;
                if (state)
                {
                    OldImage.Opacity = 1;
                    HamburgerButton.FadeTo(0, 800u, Easing.CubicOut);
                    await BottomSheet.TranslateTo(0, Height, 800u, Easing.CubicOut);

                    Darkener.FadeTo(0.4);
                    VictoryView.FadeTo(1);
                }
                else
                {
                    Darkener.FadeTo(0);
                    await VictoryView.FadeTo(0);

                    await OldImage.FadeTo(0, easing : Easing.CubicIn);

                    await Task.Delay(250);

                    HamburgerButton.FadeTo(0.85);
                    await BottomSheet.TranslateTo(0, positions[1], 350u, Easing.CubicOut);
                }
            }
            else if (e.PropertyName == nameof(GameViewModel.IsDone))
            {
                if (((GameViewModel)BindingContext).IsDone)
                {
                    TempFinisher.FadeTo(1);
                }
                else
                {
                    TempFinisher.FadeTo(0);
                }
            }
        }