How to create a program for Windows. App Studio - a new version of the online application designer from Microsoft

💖 Do you like it? Share the link with your friends

Hi all!

I present to your attention a new tool from Microsoft "Windows App Studio» - a designer for creating applications. Today I will tell you how to the average user it became possible to create applications for Windows and Windows Phone. And a little about how this tool can be useful to a developer.

App Studio is a tool designed for creating content applications. This type of application provides the user with topical information, various catalogs and a whole range of other standard functions.

App Studio interacts with the user through a web interface, works on any browser and is available at the following link. All App Studio data is stored in the cloud.

To access App Studio, you must have a Microsoft account (formerly Live ID) and Internet access.

Review
The interface is simple and intuitive:


On home page There is a control panel for accessing the main pages of the resource:



The main page also demonstrates applications created in App Studio, functioning and available in the Windows Store:


Templates
To create an application, App studio offers the following scenarios:
  • Use templates;
  • Create an application from scratch.
App Studio templates are topic-oriented applications with a ready-made structure, demo content and editing capabilities:


Unlike other templates, Empty App does not offer any script for creating applications and is completely free of content.

All App Studio templates provide the ability to create universal applications available on Windows and Windows Phone 8.1 devices. In addition to the Web App template:

The purpose of this template is to remake mobile version website to the Web App using the site URL. This feature is only available for Windows Phone applications.

It is worth noting the variety of App Studio templates and the presence of thematic components in each of them:


Creating an application
The application creation cycle in App Studio consists of 4 stages:
  • Search for an idea;
  • Filling content;
  • Style design;
  • Using a ready-made application;
To demonstrate the capabilities of the tool, we will create a Wine Catalog based on the Empty App. Let's call it Wine Expert, start creating the structure and adding content.

The start page for the new Empty App looks like this:


The work area is divided into four parts:

  • Work on the structure and content of the application: Content;
  • Next two tabs are responsible for appearance and application style: Themes And Tiles.
  • Publish info contains preliminary settings for publishing an application in the Windows Store.
Working on content
In the Content area, we determine which pages Wine Expert will consist of:
  • About wine;
  • Wine catalogue;
  • Wine production;
  • About the creators.
To create the structure, we use a set of blocks proposed by App Studio:



Design and style of the application


App studio in the Themes tab offers to configure the application theme:

  • Standard: dark, light background;
  • The user's preferred background, including the option to set the image as the "Background Image".
Using Custom Style, you can also customize the text color and the standard Application bar of the application:


The Tiles tab designates the appearance of the application on the start screen, background image and background screensaver:


Let's set up the application tile on the start screen:

  • Flip template– living tiles;
  • Cycle template– scrolling through the specified collection from the application;
  • Iconic template– one image of all three tile sizes.
For the wine catalog, select Flip template and upload the necessary images corresponding to the specified sizes:


In the left top corner There is also an area for loading a picture, which will be displayed next to the application name, let’s fill it in too:

On the Splash&Lock tab we will perform the same actions with images:


Save the changes and move on to the next step.

Setting up an app to publish to the Windows Store
Let’s look at what data “Publish info” requires from us to prepare for publishing an application in the Windows Store, in addition to the understandable App title, App description and Language:




One of the conditions for publishing an application in the Windows Store is that the application name (App Name) be reserved in the store before publishing it. We reserve the application name in the Development Center. The store will assign its own “Package Identity” to each reserved (registered) name. The App Studio user needs to know this information, name and ID.

In order for App Studio to generate a special application package for publication, you must fill out the “Application manifest” - the application manifest. To do this, the following “Associate App with the Store” setting is provided in “Publish Info”:

The final stage of working with the application
The application is ready - click “Finish”:


We get the ability to preview the application for any device.

The “Generate” function suggests choosing for which platform you want to generate the application, select Windows Phone 8.1 and Windows 8.1, which will allow you to create a new type of application - universal:


In the “Generation type” field, note that we need an application package for installation on the device and a package for publishing. The application source code is generated by default.


So, now we can download all the materials provided by App Studio to work with the created application.

Installing the application on your device
An application created using App Studio can be installed on a device directly, outside of the Windows Store, thanks to the generated “Installable packages”.

What is needed for this:

  1. Install a certificate on the device:
    • Download the installation package provided in App Studio for the certificate depending on the device (PC, tablet, phone);
    • Run the file with the .cer extension (when installing, select Local machine, Place all certificates in the following store: Trusted Root certification Authorities).
  2. Install the application on your device:
    • Download Installable packages;
    • Find the file Add-AppDevPackage1.ps1, right-click and launch “Run with PowerShell”.


Access application data in the cloud
To add, delete, or edit dynamic data for a published application, you need to go to the corresponding application in the Dashboard list in the Dev Center. Open the collection and make all necessary changes. The application will update automatically.
Developer Features
App Studio can be useful for a professional developer by providing the source code of the application.

It can also be convenient for a developer to create the structure of his application using this tool, and then use Visual Studio 2013 (Update 2) to refine it without wasting time on writing basic elements.

Conclusion
In order to create an application in App Studio, no programming knowledge is required, in addition to creating the application and receiving it source code absolutely free.

Developers will also be interested in using the new tool, for example, to reduce the time for developing the basic structure of the application.

Creating a Windowed Visual Studio Application

Introduction to Creating Windowed Applications

API functions for working with the console

Window Application Structure

Window Controls

Graphics in windowed applications

In the Windows operating system, 3 types of program structures are possible:

  • dialog (main window - dialog),
  • cantilever or windowless structure,
  • classic (window, frame) structure

Conversational applications for Windows have a minimal user interface and transmit information to the user through standard dialog boxes (for example, the MessageBox() message box). The program works “blindly”.

Non-window (console) applications is a program that runs in text mode. The operation of the console application resembles the operation of an MS-DOS program. But this is only an external impression. The console application is provided with special Windows functions. Console applications are a system of means for user interaction with a computer, based on the use of text (alphanumeric) display mode or similar (MS-DOS command line, Far). Console applications are very compact, not only in compiled form, but also in text form, and have the same ability to access Windows resources through API functions as window applications.

Window (frame) applications are built on the basis of a special set of API functions that make up the graphical user interface (GUI, Graphic User Interface). The main element of such an application is the window. A window can contain control elements: buttons, lists, editing windows, etc. These elements, in fact, are also windows, but with special properties. Events that occur with these elements (and the window itself) result in messages being sent to the window procedure.

The difference between windowed and console Windows applications is what type of information they work with.

In the New Project Visual Studio dialog, select Visual C#, Silverlight for Windows Phone and a simple Windows Phone Application template and call it ExploringXAMLFeatures.


In the target selection dialog operating system select Windows Phone OS 7.1


After creating the project, the Visual Studio window will look like this:


Let's look at the project structure in the Solution Explorer window:

File name Purpose
AppManifest.xmlThe manifest file required to generate the XAP file into which the application is packaged for deployment on the phone.
AssemblyInfo.csAnother configuration file that defines some metadata of the main Assembly of the application.
WMAppManifest.xmlA metadata file that contains various application settings: title, setting the first page, paths to icons, defining the necessary system capabilities etc.
App.xamlThis is the application resource file. Global resources (this will be discussed when using styles) or global events (occurring when the application starts) are located here. This file is also the application's entry point.
App.xaml.csCode file (code-behind) for App.xaml. Here you can handle application-level events and errors, including application tombstoning. This concept will be discussed later when multitasking is discussed.
ApplicationIcon.pngA picture that will be the application icon on the phone. This is a really important file as it is the first thing that users will see when working with the application.
Background.pngThis image is used when the application is pinned to the phone's start screen. This is essentially a large application icon. It makes sense to make it visually similar to ApplicationIcon.png.
MainPage.xamlThis is part of the selected application template. MainPaige is not a very good name, but it is what the default project template uses. This page represents the interface that the user sees when starting the application.
MainPage.xaml.csMainPage.xaml page code file.
SplashScreenImage.jpgThis picture is displayed while the application is loading. You can set your own picture with animation to inform that the application is loading. There is a technique for creating very dynamic loading pages in XNA, but it is well beyond the scope of this article series.

XAML files define the application's interface. In fact it's simple XML files with XAML markup language.

Although this is the simplest project, it contains all the key elements that all other templates and project types contain.

Please note that some of the settings presented in the form configuration files, can be edited in the visual interface for editing application settings.

Adding controls to a XAML page

Note that Visual Studio renders both the design and XAML of the page by default.

If you navigated to other solution files, double-click on the MainPage.xaml file.

In the XAML code of the MainPage.xaml file, inside a Grid element named ContentPanel, insert a Button control:

In the design window, the button will appear immediately approximately in the center of the interface. Pay attention to the attribute Name? This is the element's unique identifier, which helps you reference it in code. Think of this as the ID attribute of the control. Let's now add some action when this button is clicked. There are two ways to bind an event to a Button (or any other control). In XAML, right in the Button definition, we can add a Click attribute and InteliSense will automatically ask if we want to generate a new event handler:


You can bind the event handler directly in the Home.xaml.cs page code without specifying it in the XAML file:

Public MainPage() ( InitializeComponent(); MyButton.Click +=new RoutedEventHandler(MyButton_Click); )

Both methods work. You can use any of them. For simplicity, we'll use the XAML method definition here. You can now write managed code in the MyButton_Click function that will change the interface or call other functions. Let's complete our example application by adding code that will change the text in the TextBlock PageTitle (PageTitle is a Name, so you can reference it directly in code) to "hello wp7". To do this, add the following code to the function:

Private void MyButton_Click(object sender, RoutedEventArgs e) ( PageTitle.Text = "hello wp7"; )

Select in the project settings Windows Device Emulator

And launch the application by clicking on the green triangle or the F5 button. After launching the application and clicking on the “Press Me” button, the screen should look similar to the screenshot below:

Adding new pages to a project

Only the simplest application consists of one page. We want to learn how to write complex multi-page applications. We can use the Pivot, Panorama templates, we can use the MVVM (Model-View-ViewModel) design pattern, and first we will learn how to add new pages to the project and move between them.

In the Solution Explorer window, right-click on the project name, and in the menu that appears, select Add, then New Item, in the dialog box that opens, select Windows Phone Portrait Page and name it SecondPage.xaml:


We now have a blank XAML page, an exact copy of the MainPage.xaml page before we edited it.

To better distinguish between pages, let's go to the XAML code of the SecondPage page and edit the TextBlock element with Name PageTitle Text property as below:

Navigation between application pages

So, we have two pages in the project; when the application starts, the MainPage.xaml page is displayed. How can I now move from MainPage.xaml to SecondPage.xaml?

Let's try two simple ways, how to do it.

In the XAML code of the MainPage.xaml file after the Button code we added earlier, add the HyperlinkButton code as shown below:

tell friends