After installing the development environment, we will compile our first Windows Phone application.ProgramRight. For usProgramming LanguageOr we are familiar with the first program we have written. Helloworld.
OK. Make a simple hello World with me. Open Microsoft Visual Studio 2010 express for Windows Phone => file => new project =>
We can see two parts. One is Silverlight for Windows Phone and the other is xNa game studio 4.0. Select Windows Phone application => name to enter helloworld. Solution can be the same as name. => OK.
Pull a textblock and button control to the mainpage. XAML form. In addition, the text attribute value of textblock is cleared. Change "name" to "mytextblock. Button" control, and change "name" to "mybutton". Change "content attribute value to" Click me ", as shown in the following figure:
Double-click the "Click me" button to jump to mainpage. XAML. CS.
ImplementationCodeAs follows:
Private VoidMybutton_click (ObjectSender, routedeventargs E)
{
StringMyvalue ="Hello World";
Mytextblock. Text = myvalue;
}
Now build. F5. Loading the simulator for the first time may be slow. Then the simulator will be disconnected from the program, and our program will be loaded into the simulator. You can stop turning off the simulator. So that we can continue writing other programs.