"Wanli Journey--windows App development" development preparation

Source: Internet
Author: User
Tags old windows

Operating system and SDK operating system

If you're going to develop Windows apps, your PC won't be able to use the old Windows 7 anymore. It is recommended to use Windows 8.1. When I wrote this blog, the operating system I used was Windows ten Pro Technical Preview [Build 10041].

Operating system In addition to the official website download, but also in DreamSpark and other places to download. Other Microsoft operating systems, development tools, and other software on DreamSpark are open to students free of charge.

Also recommend a website: MSDN I tell you

Visual Studio

As the most powerful development tool in the Visual Studio family, learning Windows app development is a natural and indispensable. Visual Studio can also download the above MSDN I tell you.

In addition, because the main direction of this blog series is the Windows app (formerly known as universal Windows app, referred to as UWA), so I use the SDK is still preview version--visual Studio [CTP 6].

Installation troubleshooting

When installing Visual Studio 2013/2015, when the blue screen appears, uninstall the NIC driver and reinstall it, especially in the case of earlier versions of Visual Studio 2013 and with the campus telecommunications network.

If you encounter any problems, please leave a message.

Learn about Windows appc#

C # is a Microsoft-driven programming language and the most appropriate development language for Windows apps, so this series of posts is unified in C #. The relevant framework is briefly explained below.

Develop Windows apps that can be used in Windows XAML (C #, C + + and VB), WinJS (Html+javascript), DirectX (c + +). Silverlight (C # and VB) is unique to WP.

Xaml

Extensible Application Markup Language (abbreviated as XAML, pronounced Zamel) is part of WPF, which is syntactically similar to HTML, and they are all "markup languages." I was the first to learn the HTML of the XAML, and at first I liked the language-it didn't have a lot of ";". XAML essentially belongs to a. NET programming language that belongs to the common language runtime (Common Language runtime, or CLR).

See a lot of tutorials and so on at the beginning to explain the xmlns such as the name space, I think this is not very suitable, after all, it is not used at all, so also can not remember, wait until the time when the natural will be impressed.

General application

In fact, I think the name "Universal application" is obviously more suitable, more emphasis on the "general" characteristics. It can run on all Windows platforms, not just PCs, tablets, phones, and even Xbox. The ability to share most of the code on multiple platforms, enabling it to be developed at once and run on multiple platforms.

I'm optimistic about this strategy, but there have been a lot of news lately that Windows 10 might be compatible with Android, and I really don't want Microsoft to do it, at least not on Android and Win8 or even Win10 's design style.

Create your first app new project

If it is not installed solid state then the installation process will be very long, please wait patiently. You can start by rubbing your hands after you've installed them.

Ctrl+shift+n call out the new Project window directly.

After the new is complete, the solution Manager will be the following style:

If the solution Manager is not displayed, you can press ctrl+w,s. Or, you can click View in the top toolbar. Right-click on solution ' WindowsApp1 ' to continue with the creation of the second project.

A total of 3 sections are shown in:
1) windowsapp1.windows (Windows 8.1)
2) Windowsapp1.windowsphone (Windows Phone 8.1)
Obviously these two are the Windows 8.1 and Windows Phone 8.1 parts that are part of the window app. The following are also:
Properties: Apply some of the relevant version numbers, and so on.
References: References are mainly used to refer to third-party stuff, such as advertising.
Assets: You can put the assets used in the app and so on in this folder.
The MainPage.xaml:XAML code is written here, oh, C # code needs to be written in the MainPage.xaml.cs file that appears after clicking the triangle to the left of MainPage.xaml.
Package.appxmanifest: Some of the list of application packages, which are later used in detail.
The remaining one is the relevant certificate.
3) windowsapp1.shared
This is the essence of the Windows app (universal application), such as the class, resource files, etc. can be put here.

Debug program

Here you can set up a debug Windows 8.1 app or a Windows Phone 8.1 app.

Here you can choose to debug in native debugging or in a virtual machine.

Hands-on Operation

Write down the following code in MAINPAGE.XAML:

<Grid Background="{ThemeResource Applicationpagebackgroundthemebrush}"> <textblock name="Tblock" Text="" FontSize=" the"Foreground="Red"margin="173,78,940,498"/> <ButtonName="BTN"Content="Show name"click="Btn_click"Width="155" FontSize="very"height=" the"margin="170,286,0,392"/> </Grid>

Only two TextBlock and button two controls are used, the properties of which are:
Name: Control names
Text:textblock the text displayed by the control
FontSize: Font
Width and Height: width and height
Margin: Margin, specific usage in the following blog will be introduced
Content: Contents, which appears on the button control
Foreground: Font Color

There is also an event:
Click: Tap Events

Double-click Btn_click with the mouse and press F12 to quickly generate the appropriate function in the C # file.

You can then debug on the local computer or on the virtual machine.

Visual Studio Small Tricks line number

The ability to see how many lines of code you have written will undoubtedly make you feel more fulfilled.
Click Tools on the toolbar, then click Options, click the Text editor, select all Language, and tick the uplink number, and then tap on the "option" button.

Shortcut keys

Auto Alignment: Ctrl+k,ctrl+f
Comment Code: CTRL+E,CTRL+C
Clear code Comment: Ctrl+e,ctrl+u

View

1) When learning to develop, the "Object Browser" in the view is very useful.
2) The controls in the toolbox can be pulled directly into the MainPage.xaml designer. This is the legendary "WYSIWYG".
3) Properties, click on a space and click on the Properties view, you can set its properties and events.

All right, this blog is over here, next goodbye!

"Wanli Journey--windows App development" development preparation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.