Пример #1
0
        private const int SPLASH_FADE_TIME    = 500;  // Miliseconds

        protected override void OnStartup(StartupEventArgs e)
        {
            // Step 1 - Load the splash screen
            SplashScreen splash = new SplashScreen("StartUP/StartUp.jpg");

            splash.Show(false, true);

            // Step 2 - Start a stop watch
            Stopwatch timer = new Stopwatch();

            timer.Start();

            // Step 3 - Load your windows but don't show it yet
            base.OnStartup(e);
            WpfApplication3.MainWindow main = new WpfApplication3.MainWindow();

            // Step 4 - Make sure that the splash screen lasts at least two seconds
            timer.Stop();
            int remainingTimeToShowSplash = MINIMUM_SPLASH_TIME - (int)timer.ElapsedMilliseconds;

            if (remainingTimeToShowSplash > 0)
            {
                Thread.Sleep(remainingTimeToShowSplash);
            }

            // Step 5 - show the page
            splash.Close(TimeSpan.FromMilliseconds(SPLASH_FADE_TIME));
            main.Show();
        }
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            Process.Start("shutdown", "/a");

            WpfApplication3.MainWindow NW = new WpfApplication3.MainWindow();

            NW.Show();
            this.Close();
        }
    public static void Main()
    {
        WpfApplication3.MainWindow win = new WpfApplication3.MainWindow();
        Status status = new Status();

        if (!File.Exists("logindata.xml"))
        {
            status = Status.JustInstalled;
            if (status == Status.JustInstalled)
            {
                win.loginlabel.Content = "Please enter your desired username and password.";
            }

            Application.Run(win);
        }
    }
Пример #4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Window = ((WpfApplication3.MainWindow)(target));
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.canvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 4:
                this.button = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #5
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Window = ((WpfApplication3.MainWindow)(target));
     return;
     case 2:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     }
     this._contentLoaded = true;
 }