Windows Phone Application
11K views
Nov 7, 2023
Windows Phone Application
View Video Transcript
0:00
In this video we are going to see how to create our first Windows Phone 7 application using Visual Studio 2010
0:15
Before you start developing Windows Phone application what you have to do is, you need to actually download Visual Studio 2010
0:27
either Express version which is a Visual Studio C-Sharp 2010 Express or Visual Studio 2010
0:35
professional or ultimate or any versions out there. After you if you already have Windows 2010
0:43
what you got to do is go to this website right here it's called create.msdn.com this website is
0:53
for Windows Phone Developers where you can download the tools, free tools. To build a
1:01
Windows Phone 7 application you would need these tools. Once you click on these download
1:07
the free tools option here, what you will see is you will see a getting started guide
1:15
download the free tools. You need to make sure you install these tools and then you
1:20
bunch of documentation are out there you can you know learn from the videos training kit and bunch
1:25
of other resources so then you can also learn more about you know how to how it works how to deploy
1:34
a windows phone 7 application to the library so other people can download from here and share with
1:42
the others and sell it and you know everything else out there so once you have this uh down if
1:50
the sdk installed and on visual studio platform what you need to do is now
1:57
let's build our application so what we are going to do is uh
2:04
once this sdk is installed windows phone sdk is installed the one template is added to your
2:10
So we are going to create a new project. File, New Project
2:16
As you can see here a Windows Phone Application template is project template is added to your templates list
2:24
So I am going to select Windows Phone Application. One more thing you probably would notice is when you install this Windows Phone 7 SDK an emulator is also installed on your machine that is used to test your application since you may not already have a physical Windows Phone present
2:46
So I'm going to discuss that in a little bit. So let's create your Windows Phone application
2:52
So select Windows Phone and say, all right, I just picked the default name
3:01
So as soon as you create the project, what you see is here
3:06
you will see this is my design this is my main page dot jml page one thing you need to you should
3:22
know is windows forms have an application either it can be a an xna application or it can be silver
3:32
by default this application is a silver light application so if you already know how to code
3:37
silver light for you it will be really piece of cake it's just it's very easy to build this
3:43
application so as you can see this is my ui and if i switch back to i can switch back to both
3:49
design and xaml so this is my jamal page look like if you are you've been doing a wpf or silver
3:58
like programming you should this should actually look familiar to you I got a grid panel here in
4:06
grid panel I have these two rows then I got a stack panel here stack panel has inside that grid panel
4:14
I got a stack panel where you know I have a title panel and this is my application title and page
4:19
title so I'm going to change this application to and then I'm going to
4:31
change this to eventually I'm going to convert this application to a fully
4:40
functional working C sharp programming language for now I'm doing is for test
4:49
I am just creating a simple Hello World application. You can resize right now you probably may not want to resize because this is the perfect size for Windows Phone now but you can also resize and do whatever you want This is just a giant size for now
5:11
Now let's take a quick look. If you look at your solution explorer you'll see there's nothing much out there
5:20
There's app.xaml which is same your application file where you'll see all your application related events
5:27
events like this is a constructor and then you'll see application launching
5:32
activated deactivated application closing navigation and failed and on accept exceptions so anything you have to do when application is starting or
5:44
closing that kind of code you probably have to write it here now go back to
5:51
solution explorer this is a splash screen image which is your image used on
5:58
the home page by default and there are two more png images here but for our
6:03
focus is just a main page dot jamml that's where only we are going to do is now
6:08
before we make this video really large what I'm going to do is create a simple
6:14
UI where you can see how it works and then we can go from there so as usual
6:20
you are in Visual Studio, first thing we look for is Toolbox. In Toolbox as you can see
6:25
Windows Phone controls, you have bunch of controls here. They are not enough, they are
6:29
not as much as you will see in WPF or Silverlight. But I'm sure eventually they'll be there
6:37
I'm sure Microsoft is adding more controls here. But for now there's a good set of controls
6:44
here and I think we can use these to build at least our application. So let's create
6:50
drag and drop a button control first and I create a button control here as you
6:56
can see it's already nice design by default and I'm going to say let me say
7:03
text box control so I got a button control I got text box control similar
7:11
to any Visual Studio go to properties and here you can see properties of that
7:16
control. So content-sage button, I will say click me. You can change layout, background, color, everything you need
7:27
It's just another control for you. I like to sort by this so I can see background you can change background to any color I want foreground whatever you know you just have to remove your transparency and change out
7:47
all the properties here you can also write events here so what I'm going to do is on
7:53
my click event handler I'm double clicking here as soon as you double click you will
7:56
see button click event handler is added to the code so here I'm going to do is
8:01
text box one which is my text box added to the again if you are you know
8:07
silverlight programmer WPF you already know what you're doing your name your
8:13
name of these controls is already added and I'm just going to say
8:26
So, simple now, if you F5 you build and run you will see one error message comes which
8:36
is if you build and run you will see there were deployment errors, yes
8:44
You see that you are going to see Zoom software is not installed, this is because by default
8:51
the setting for build is here it's for Windows phone 7 device and I do not have a device attached
8:58
to this computer right now so for testing purpose we are going to use the emulator which so I'm
9:03
going to switch build setting to Windows phone 7 emulator now if I build it I will see my UI
9:10
boom right here so as you can see my Windows phone is loading here and I can just go to next
9:19
screen and you will see it's loading my UI that there you go this is my home page so if I say
9:25
click me hello windows phone there you go your first windows phone application is ready congratulations
9:32
and from now on I'm going to start adding more and more functionality to this application and
9:40
soon you'll see a fully featured c sharp corner windows phone application but also I'm going to
9:47
do is I'm going to share this whole development with you guys so if you come back and keep
9:52
watching all the videos you will know actually actually how to build a ready to use real world
9:57
application for Windows phone using C sharp and Visual Studio 2010
#Business & Productivity Software
#Windows & .NET