Solutions vs. Projects
- A Windows Phone app is organised into a 'Solution' and 'Projects'
- A Solution groups together Projects that are associated with your application
-
Usually you just have one project in your solution for the app itself, however there may be other projects, for example,
- unit tests
- a desktop front-end
- a web front-end
- a separate library spun out of the main project
- A Window Phone project generates lots of files automatically, see Understanding Windows Phone Project files for a guide on what they do
-
.cproj
or.vbproj
and.sln
files are just XML. Take a look inside with a text editor to see that they mostly contain references to other files
Default skeleton project
When creating a new Project a series of file are created as follows,
-
- AppManifest.xml
- AssemblyInfo.cs
- WMAppManifest.xml
-
- App.xaml.cs
-
- MainPage.xaml.cs
- ApplicationIcon.png
- Background.png
- SplashScreenImage.png
Properties
- Properties folder contains Windows Phone App metadata (i.e. data about the app itself such as version number)
- Data in these files can be edited safely using the 'Project - YourAppName Properties' window in Visual Studio, otherwise these files can be mostly be left alone
-
AppManifest.xml contains a list of extra resource files to be included in the final built
.xap
package -
AssemblyInfo.cs contains metadata for management of the
.NET
.dll
that is compiled from the project such as.dll
version number -
WMAppManifest.xml contains,
- a list of app capabilities (e.g. the app uses GPS, microphone, push notifications etc.)
- the company name, version etc.
- the reference for the first page loaded in your app (i.e. MainPage.xaml)
References
- Contains references to libraries, see adding libraries to a project
Other files
- App.xaml is the first xaml file loaded by the project when it runs. It does not display anything but is where global XAML styles and other resources are placed
-
App.xaml.cs contains the definition for the global
App
object. It is a good place to attach the View-Model instance. Also provides the appLaunching
,Closing
,Activated
andDeactivated
methods used for Lifecycle management - MainPage.xaml is an ordinary Windows Phone XAML page. However it is referenced in WMAppManifest.xml to be the first page loaded when the app starts. When moving to the View folder, be sure to update the reference in WMAppManifest.xml