Windows apps
Collapse the table of content
Expand the table of content

Add the project resources

The project files that you received from the developer include a game engine (a C# source code file) and a folder that contains the images that are the visual elements of the game.

You can quickly add these resources to your game by using the Add Existing Item command, by copying and pasting files, or by dragging and the dropping the files to the desired location.

To begin, you add the C# file by using the Add Existing Item command. You then add the images by copying and then pasting them into your project.

To add the game engine

  1. In the Projects panel, right-click the Memory folder, and click Add Existing Item.

  2. In the Add Existing Item dialog box, navigate to the location where you saved the project files (C:\Visual Studio 2012\Projects\Memory, for example).

  3. Locate MemoryViewModel.cs, and then click Open to add the file to the project.


    The MemoryViewModel.cs file can be found in subfolder.

To add the images

  1. In File Explorer, navigate to the location where you saved the project files.

  2. Open the Photos folder, and then select all of the files by pressing Ctrl+A. Right-click the selected files and then click Copy.

  3. In the Projects panel, right-click the Assets folder, and then click Paste. When prompted, click Yes to overwrite any existing files.

To build and save project

  1. On the Project menu, click Build Project or press Ctrl+Shift+B.


    When a build successfully completes, Output pane on the Results panel will display the message "The build has successfully completed."

  2. To save the project, on the File menu, click Save, or press Ctrl+S.


    An asterisk on the document tab indicates that a file has changed. If multiple files have changed, an asterisk will appear on each of the tabs.

The files you received from the developer use GameBoard and LayoutRoot instead of the default names for the main page and the root grid. You can quickly rename these files to match the resources given to you by the developer.

To rename MainPage.xaml

  • In the Project panel, right-click MainPage.xaml, click Rename, and then type GameBoard.xaml. Press Enter.

    Caution noteCaution

    If MainPage.xaml isn't visible, expand the Memory folder.

To rename the root grid

  • In the Objects and Timeline panel, right-click Grid, click Rename, and then type LayoutRoot. Press Enter.


    If Grid isn't visible, expand Page.

The next step: Create the app resource.

© 2018 Microsoft