Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

My First Windows 8 Application – Metro Puzzle

, 7 Apr 2012
My first Windows 8 application, Metro Puzzle.
PuzzleMetro.zip
PuzzleMetro
bin
Debug
Images
PuzzleMetro.build.appxrecipe
resources.pri
Release
Converters
Images
Help
1.png
2.png
3.png
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
WideLogo.png
Winner.png
obj
Debug
puzzlemetro
TempPE
Package.appxmanifest
Properties
PuzzleMetro_TemporaryKey.pfx
PuzzleMetro_-_Consumer_Preview.zip
PuzzleMetro.v11.suo
Assets
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
ARM
Debug
Release
AppX
Assets
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
Common
Images
Help
1.png
2.png
3.png
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
WideLogo.png
Winner.png
microsoft.system.package.metadata
S-1-5-21-2796664923-3921637894-3850728130-1001.pckgdep
PuzzleMetro.exe
PuzzleMetro.pdb
resources.pri
vs.appxrecipe
Assets
Common
Help
x64
Debug
Release
x86
Debug
Release
Common
1.png
2.png
3.png
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
WideLogo.png
Winner.png
Common
DesignTimeResolveAssemblyReferencesInput.cache
intermediatexaml
PuzzleMetro.exe
PuzzleMetro.pdb
LanguageQualifiers.txt.intermediate
Package.appxmanifest
PuzzleMetro.csproj.user
PuzzleMetro_TemporaryKey.pfx
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227

namespace PuzzleMetro
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
       public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="args">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs args)
        {
            if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
            {
                //TODO: Load state from previously suspended application
            }

            // Create a Frame to act navigation context and navigate to the first page
            var rootFrame = new Frame();
            rootFrame.Navigate(typeof(BlankPage));

            // Place the frame in the current Window and ensure that it is active
            Window.Current.Content = rootFrame;
            Window.Current.Activate();
        }

        /// <summary>
        /// Invoked when application execution is being suspended.  Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        void OnSuspending(object sender, SuspendingEventArgs e)
        {
            //TODO: Save application state and stop any background activity
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

About the Author

Shai Raiten
Architect Sela
Israel Israel
Shai Raiten is VS ALM MVP, currently working for Sela Group as a ALM senior consultant and trainer specializes in Microsoft technologies especially Team System and .NET technology. He is currently consulting in various enterprises in Israel, planning and analysis Load and performance problems using Team System, building Team System customizations and adjusts ALM processes for enterprises. Shai is known as one of the top Team System experts in Israel. He conducts lectures and workshops for developers\QA and enterprises who want to specialize in Team System.
 
My Blog: http://blogs.microsoft.co.il/blogs/shair/
Follow on   Twitter

| Advertise | Privacy | Mobile
Web03 | 2.8.140905.1 | Last Updated 7 Apr 2012
Article Copyright 2011 by Shai Raiten
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid