aboutsummaryrefslogtreecommitdiffstats
path: root/Software/.metadata/.plugins/org.eclipse.core.resources/.history/5b/006750eb45b80019199adde58e229227
stat options
Period:
Authors:

Commits per author per week (path 'Software/.metadata/.plugins/org.eclipse.core.resources/.history/5b/006750eb45b80019199adde58e229227')

AuthorW25 2026W26 2026W27 2026W28 2026Total
Total00000
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Tango.BL;
using Tango.Core;
using Tango.Core.DI;
using Tango.Core.Helpers;
using Tango.PPC.Common;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
using Tango.PPC.Common.MachineSetup;
using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.Notifications.NotificationItems;
using Tango.PPC.Jobs;
using Tango.SharedUI;

namespace Tango.PPC.UI.ViewModels
{
    /// <summary>
    /// Represents the PPC loading splash screen view model.
    /// </summary>
    /// <seealso cref="Tango.PPC.Common.PPCViewModel" />
    public class LoadingViewVM : PPCViewModel
    {
        /// <summary>
        /// Gets or sets the module loader.
        /// </summary>
        [TangoInject]
        public IPPCModuleLoader ModuleLoader { get; set; }

        private bool _isLoading;
        /// <summary>
        /// Gets or sets a value indicating whether this instance is loading.
        /// </summary>
        public bool IsLoading
        {
            get { return _isLoading; }
            set { _isLoading = value; RaisePropertyChangedAuto(); }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="LoadingViewVM"/> class.
        /// </summary>
        public LoadingViewVM(IPPCApplicationManager applicationManager)
        {
            if (!DesignMode)
            {
                Task.Delay(1000).ContinueWith((x) => { IsLoading = true; });
            }
        }

        /// <summary>
        /// Called when the application has been started.
        /// </summary>
        public override void OnApplicationStarted()
        {
            IsLoading = false;
            LogManager.Log("Application started. Navigating to LoginView...");
            NavigationManager.NavigateTo(NavigationView.LoginView);
        }
    }
}