示例#1
0
        /// <summary>
        /// method Refresh
        /// </summary>
        public void Refresh()
        {
            // if the value for LoginInProcess is true
            if (LoginInProcess)
            {
                // increment by 1
                Percent += 1;

                // go a little past 100 for effect
                if (Percent >= 100)
                {
                    // Increment
                    ExtraPercent++;
                }

                // if higher than 10
                if (ExtraPercent >= 10)
                {
                    // Stop the timer
                    InvisibleSprite.Stop();
                    ShowProgress = false;
                }
            }

            // Update the UI
            InvokeAsync(() =>
            {
                StateHasChanged();
            });
        }
示例#2
0
        /// <summary>
        /// method Refresh
        /// </summary>
        public void Refresh()
        {
            // if the value for LoginInProcess is true
            if (LoginInProcess)
            {
                // increment by 4
                Percent += 4;

                // go a little past 100 for effect
                if (Percent >= 100)
                {
                    // Increment
                    ExtraPercent++;
                }

                // if higher than 10
                if (ExtraPercent >= 10)
                {
                    // Stop the timer
                    ShowProgress = false;
                }
                else if (ExtraPercent >= 20)
                {
                    // Stop the Sprite
                    InvisibleSprite.Stop();

                    // Show a login failed message
                    ValidationMessage = "The credentials entered were either not found or invalid.";
                }
            }

            // Update the UI
            InvokeAsync(() =>
            {
                StateHasChanged();
            });
        }