Tip:
Highlight text to annotate it
X
Welcome to the first video in a series
to teach Windows Phone Basics for Developers.
The device is actually a tiny mobile computer
that can also be used as a phone.
Windows Phone 7 is a flexible fun platform
with lots of free help and training.
Right now, the development environment is also free.
Microsoft is opening the doors.
Learn the tools.
Now is a great time.
This video series is accompanied by lesson files
currently posted on my skydrive.
Links are in the video description.
Foundation knowledge to develop a simple application
from start to finish will be covered
I want to especially pass on understanding in areas where I stumbled.
(Steve Brooks: "another year gone by …")
Start Microsoft Visual Studio 2010 Express for Windows Phone
and choose New Project.
For the .Net development language, choose Visual C#.
When I started learning, there seemed to be more help for C#
-- and more examples.
So instead of Visual Basic, which would have been my preference,
I chose to learn C#.
I still might go to Visual Basic but for now, C# is good.
I'm learning something new.
In the middle pane for the type,
I choose Windows Phone Application.
At the bottom of the dialog box
I specify a Name for my project.
By default, the project will be in a new solution with the same name.
(I added "by Crystal and Rob" to the solution name)
Solutions can have more than one project.
My location is good.
A top-level folder will be created with my solution name
I click OK (note checkbox to Create Directory for Solution)
Then I am prompted for the platform. I leave at the default and click OK.
The wizard creates directories and files.
The main folder is my solution name.
There is my SLN file; what I double-click to open my solution.
There is also a folder for my StopWatch project.
My StopWatch project has a Bin folder for binary and other files.
The Bin>Debug directory is initially empty.
After I build my project,
the Bin>Debug directory contains files,
including my deployment file.
My deployment file has an XAP extension -- "zap"
XAP is really a .zip file.
The OBJ folder has stuff that we don't need to be concerned with right now.
The 3 files under Properties show up in the Solution Explorer:
- AppManifest.xml
- AssemblyInfo.cs
- WMAppManifest.xml
Each file in the main project directory is also listed in the Solution Explorer:
- App.xaml
- App.xaml.cs
- ApplicationIcon.png
- Background.png
- MainPage.xaml
- MainPage.xaml.cs
- SplashScreenImage.jpg
- StopWatch.csproj (not in Solution Explorer)
- StopWatch.csproj.user (not in Solution Explorer)
This is the Solution Explorer. I recognize the filenames.
Here are the 3 property files.
Here are a bunch of references.
App.xaml and its corresponding code file are responsible for my general application needs
such as handling startup and shutdown procedures.
Common resources are also defined here.
App.xaml is not a user interface page; its class type is "Application".
MainPage is my user interface.
MainPage has a XAML file and a XAML.CS file.
This is the AppManifest.xml file.
AssemblyInfo.cs contains general information that is referenced
when the project is assembled, such as Assembly Title and Assembly Product,
which are both initially set to the Name specified in the File dialog box.
WMAppManifest.xml provides application and localization information
when deploying a Windows Phone application
to the Windows Phone MarketPlace.
The Deployment root element is defined by the specified xml namespace and the application platform version.
During the application submission process,
a new ProductID is inserted into the manifest file.
Other values such as Author and Publisher
are also automatically changed.
The ICONPATH specifies the application icon that is displayed in the application list.
The default image is ApplicationIcon.png for Silverlight projects.
You must change this file or your application will be rejected.
The Capabilities element needs to be edited
to remove features that the app does not need.
The Tasks element specifies the startup page; default is MainPage.xaml.
The TOKENS element specifies the Tile that users can pin to their Start screen. (Also specifies TITLE)
Like ApplicationIcon, Background must be changed.
("give me one good year")
("get my feet back on the ground")
("I've been Chasing Grace")
("but Grace ain't so easily found")
On the left side is my Designer.
on the right is my markup.
It is called XAML: eXtensible Application Markup Language.
I turn on the Solution Explorer.
It will appear in a new pane on the right.
My markup is now in the middle pane
It will also be useful to turn on the Properties Window.
This shows me information about whatever is selected.
I am going to resize the phone designer so it is not so big.
I need more space for my markup.
Now I can make the left pane narrower.
Designer on the left
and markup in the middle.
On the right I see the Solution Explorer and the Properties Window.
Your layout may look different.
MainPage.xaml.cs is the code behind my main page.
I want my xaml page to be the first tab,
so I drag it to the left.
TitlePanel is the name of the StackPanel control in the page header with my Application title and my Page title.
ContentPanel is the name of the grid
where the contents of my page will go.
At the top of my xaml page is the root element.
It contains references, including those to theme resources.
The LayoutRootGrid contains TitlePanel and ContentPanel.
At the bottom of the page is
markup for the ApplicationBar and ApplicationBarIcons,
which will appear below my content.
This will save me time down the road
when I uncomment and customize.
TitlePanel contains control definitions.
I put each property setting on a new line.
("will your darkest hour")
("write a blank check on your soul?")
Now I think I will make the designer big again
What I see on the designer corresponds to my xaml markup.
This is my Application Title.
Here is the Page Title.
Watch the designer while I delete the margin setting
for my page title in the xaml markup.
My application title is StopWatch.
I can change the text property in the xaml.
As I type, my changes show up in the designer.
The text for my page title will be "Welcome!"
As I make changes to property settings in the xaml
they are displayed in the Properties window.
I can change text in the Properties Window too.
Now my xaml also says "Welcome Everyone!"
That is a bit long though.
I edit the text property in the xaml.
The changes show everywhere.
Now I build my solution.
I want to see the error list.
yay! no errors
I Save All the files.
I make sure the target is set to Windows Phone Emulator
and I run my application
The emulator is loading
My application dances.
I plan to make more changes so I click the Back button
to unload my application from the emulator
and leave the emulator running.
If I choose Windows Phone device as my target,
I will get an error message because my phone is not plugged in.
My app will not be able to deploy using the current target.
The error message says something about installing Zune software.
Remember this; it will probably happen to you.
The first time this happened to me,
I spent a few hours doing what it told me to do and still
of course, I had the error.
I change the target back to emulator and it works :)
("a good one can turn him around")
Hopefully these videos will inspire you. ("One Good Year")
Then maybe you can teach me
-- or maybe you can teach me right now.
I'm still learning and I welcome your comments.
Links to lesson files,
the music by Steve Brooks,
as well as other resources for learning
are in the video description.
My channel description also has links.
Through sharing, we will all get better ~Crystal �