Overview
- Visual Studio is used to write C#/VB
- Expression Blend is used to generate XAML
- Linqpad is used to test Linq queries
- There is some support for designing XAML pages in Visual Studio and editing C#/VB code in Blend but the experience is better using both tools for their intended tasks
- Editing XAML code directly is a better experience in Visual Studio
- You can edit a solution in both Visual Studio and Blend at the same time, when you save in one, it will prompt to update the file in the other
- The SDK includes a Windows Phone Emulator which is a Virtual Machine running the actual Windows Phone operating System
- If your computer does not have a dedicated graphics card, some Windows Phone 7 Emulator capabilities are missing including taking screenshots which is necessary for submitting an app to the Store
- Windows Phone 8 Emulator does not require a dedicated graphics card but does require Windows 8
Visual Studio Express
- The main limitation of the Express edition is that you cannot install extensions
Adding libraries
- All Windows Phone Silverlight projects will likely use the Windows Phone Toolkit library
- Visual Studio Express cannot install via Nuget (the recommended way) and so you should download the source from the Codeplex site (Codeplex is Microsoft's answer to GitHub)
- Open the downloaded project in a new Visual Studio window
-
Build the project and copy the compiled
Microsoft.Phone.Controls.Toolkit.dll
file in the<Toolkit Project Folder>\Bin\Debug
to theIncludes
folder in your Project - Right-click on the 'References' folder in Visual Studio and select 'Add Reference ...'
-
Browse to the
.dll
file and accept - The Windows Phone toolkit should now be accessible in Blend
-
If the
.dll
file does not appear in the Solution Explorer, right click on the folder where it is located and choose 'Add Existing Item' and select it
Expression Blend
By far the best way to learn about using Expression Blend is to watch a video of someone using it. A great introduction is Corinna Black's talk 'How to: Building a Prototype App Using Expression Blend for Windows Phone'
- It covers,
- Basic use
- Generating sample data
- Simple binding
- Animation
- I would recommend creating data as she does but only creating one data set and re-create your View-Model object
- Although there is a 'Show Snap Grid' button at the bottom of the design window, the grid mentioned in the video is part of a deeper design philosophy. This video at 6:48 explains.
Linqpad
- To install download Linqpad from the website
- LinqPad is not strictly necessary but is useful to have to learn Linq
- There are lots of interactive tutorials built into the tool but they require an operating Microsoft database
Installing a database for the Linqpad tutorials
- Download and install the 32bit or 64bit LocalDB from the Microsoft website
-
Create (or
download
) the following
.bat
files and unpack them in a suitable place (e.g.C:\Users\<username>\Scripts
).CreateDBServer.bat
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe" create DBApp1 pause
StartDBServer.bat
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe" start DBApp1 "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe" info DBApp1 pause
GetInfoDBServer.bat
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe" info DBApp1 pause
StopDBServer.bat
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe" stop DBApp1 pause
-
To access the database in Linqpad,
- Run the CreateDBServer.bat script
- Run the StartDBServer.bat script and make a note of the 'Instance pipe name:'
- In Linqpad click 'Add Connection', choose the 'Default (Linq To SQL)' and enter the pipe name in the 'Server' field, click 'Test' to see if it works
- Further down select 'Specify new or existing database' enter the name 'test' and click 'Create database' and then 'OK'
- You should now be able to select the database at the top of the Linqpad window and complete the tutorials