示例#1
0
        /// <summary>
        /// Overriden method to add animations and create gameboard.
        /// </summary>
        protected override async void OnAppearing()
        {
            _gameBoard = await Task.Run(() => GameBoard.CreateAsync(AlternativeIcons));

            base.OnAppearing();

            // Showing animations unless user has chosen to skip starting animations
            // from the app's settings or app is resuming.
            if (!App.AppResumed && !App.SkipStartingAnimations)
            {
                await Task.WhenAll(
                    _gameBoardGrid.FadeTo(1, 1000, Easing.Linear),
                    _gameBoardGrid.RotateTo(360, 1500, Easing.CubicOut),
                    _gameBoardGrid.ScaleTo(1.1, 1500, Easing.Linear)
                    );

                await Task.WhenAny(
                    _gameBoardGrid.ScaleTo(1, 2000, Easing.Linear),
                    AppTitle.FadeTo(1, 1500),
                    AppTitle.ScaleTo(1, 1500, Easing.SinInOut)
                    );

                await Task.WhenAll(
                    SettingsIcon.FadeTo(1, 1000),
                    SettingsIcon.ScaleTo(1, 1500, Easing.SpringOut),
                    SettingsIcon.RotateTo(720, 2000, Easing.SinOut),
                    CalculateButton.FadeTo(1, 1000),
                    CalculateButton.ScaleTo(1, 1500, Easing.SpringOut)
                    );

                // Rotating icon back to 0, so that further animations work as intended.
                SettingsIcon.Rotation = 0;
            }
        }
示例#2
0
        private object CreateDocumentFooter(int pageNumber)
        {
            var dock = new DockPanel();

            dock.Margin = new Thickness(0, 10, 0, 0);

            var leftText = new TextBlock();

            leftText.Style = this.FooterLeftStyle;
            leftText.Text  = DateTime.Now.ToString("dd-MMM-yyy h:mm tt");
            DockPanel.SetDock(leftText, Dock.Left);
            dock.Children.Add(leftText);

            var rightText = new TextBlock();

            rightText.Style = this.FooterRightStyle;
            rightText.Text  = "Page " + pageNumber.ToString() + " of " + this.PageCount.ToString();
            rightText.HorizontalAlignment = HorizontalAlignment.Right;
            DockPanel.SetDock(rightText, Dock.Right);
            dock.Children.Add(rightText);

            var centerText = new TextBlock();

            centerText.Style = this.FooterCenterStyle;
            centerText.Text  = $"{_rowCount} items rendered";
            if (!AppTitle.IsBlank())
            {
                centerText.Text += $" by {AppTitle}";
            }
            centerText.HorizontalAlignment = HorizontalAlignment.Center;
            dock.Children.Add(centerText);

            return(dock);
        }