Windows Phone 8 Development for Absolute Beginners

Part 3: Writing your First Windows Phone 8 App

Download this episode

Download Video

Download captions

Download Captions


Source Code:
PDF Version:

Now that we have the tools we need installed, we can build our first Windows Phone 8 app.

Here's our game plan:

  1. We'll create a new Windows Phone App project
  2. We'll make some simple edits, like removing comments and adding a MediaControl and a Button control and we'll style it up
  3. We'll write an event handler that will respond to the click event of the Button
  4. In the Button click event handler we'll play a wav sound file

1. Create a new Windows Phone App project, name it "PetSounds"

Hopefully some of the basics steps like creating new projects, adding new files and so on are already familiar to you from personal experience or from watching other Absolute Beginner's series on Channel9. I won't take much time to explain those ... if something is unfamiliar, you may want to review the C# for Absolute Beginners series:

Generic Episode Image

  1. File
  2. New
  3. Project ...

In the New Project dialog:

Generic Episode Image

  1. Make sure you're in the Windows Phone project templates
  2. Select the Windows Phone App project template
  3. Rename to: PetSounds
  4. Make sure the name of the Solution has changed to "PetSounds" as well
  5. Click OK

You may see the following dialog:

Generic Episode Image

Since this series is only targeting the Windows Phone OS 8.0, select this option. Just know that you can create apps that target previous versions of the Windows Phone operating system in Visual Studio if you want to expand your apps reach to owners of older Windows Phone devices.


2. Delete unnecessary comments to more easily navigate through the code

After a few moments, the new Project will be created and loaded into the Solution Explorer, and the MainPage.xaml will be visible in the main area of Visual Studio. Notice that these "screens" are called "Pages", as in MainPage.xaml. In our first apps we'll only work with a single "page", but in other apps we'll add pages and navigate between them.

I'll assume you've never worked with a Windows Phone project template before. You'll see the MainPage.xaml loaded into the visual designer:

Generic Episode Image

  1. On the left, you'll see the visual designer. While you can use this as your primary means of laying out and adding controls to your Windows Phone app, I use it primarily as feedback for what I do in the ...
  2. XAML editor pane, on the right. I typically write all my XAML by hand. Changes I make in the XAML code will be reflected in the visual designer and vice versa. They are two perspectives, but represent the same thing.

There are a number of tools beneath the panes:

Generic Episode Image

... and between the panes:

Generic Episode Image

... feel free to experiment with them. They are self explanatory and you need to take a moment to play around with them and understand their usage. However, since it's not critical to our lesson, I want to move ahead. In the XAML pane, I want to remove two large comment passages so that it's easier to navigate through the XAML. I've identified these sections as follows:

Generic Episode Image

You can safely delete these comments. Be sure to delete everything from the starting:
... to the ending ...
Your XAML should look like this:

Generic Episode Image

We'll be focusing on the "ContentPanel" beginning in line 36 throughout this lesson adding new XAML code between the opening and closing <Grid> elements.


3. Add a Button control to the ContentPanel and style it

Add the following code between the opening and closing <Grid> elements:

Generic Episode Image

Once you add the:


... code, notice how the visual designer changes:

Generic Episode Image


The button takes up practically the entire area of the screen. That won't do ... we need to limit the size of the Button by setting a Height and Width attribute:

Generic Episode Image


The value "200" infers "200 pixels".

The visual designer updates to a smaller button size:

Generic Episode Image


Let's move the Button control to the upper left-hand corner of the page (beneath the page title), and make its background color red:

Generic Episode Image


I also gave the <Button> control a name so that I can reference that control in C#. Giving controls names is optional. You only need to give things names that you want to access somehow in C#. I know I'll want to access the button later, so I give it a programmatic name now.

The visual designer updates to show the effect of our changes:

Generic Episode Image


That's a great start. You can see that we can manipulate the visual qualities of objects on our Windows Phone page by setting it's attributes.


4. Add a MediaElement control

Next, let's add a MediaElement control to the XAML, beneath the Button control:

Generic Episode Image

Notice I can add whitespace and extra lines between my XAML code and it won't harm anything. As you'll learn later, Visual Studio will automatically indent and space the code for readability, however it will not impact how it is rendered on the page.

Also, I've not set the Source attribute of the MediaElement yet. That's because I do not have any sources (i.e., media elements, like sound files) in my project to choose from.


5. Add a wav file as an asset to the project

Make sure you've downloaded the assets the accompany this video. You can download them from the place where you downloaded this document, or are watching the videos.

I've unzipped that file into a folder called C9Phone8 in my Documents directory.
The C9Phone8 directory has 3 sub-directories:

Generic Episode Image


We want to use the assets contained in the PetSounds_Assets folder. Inside that folder, there's two sub folders ... we want to copy the Audio sub-folder into our project.

Generic Episode Image


The target for our Audio folder is the Assets subfolder of our project:

Generic Episode Image


I drag and drop the Audio folder from Windows Explorer to the target directory in Visual Studio's Solution Explorer, specifically the Assets folder ... now my Assets folder looks like this as I expand everything out:


Generic Episode Image


There are a number of .wav sound files in my app. I want to access one specific file ... a Duck.wav file. I'll add that as the value for the Source attribute in my MediaElement XAML element:

Generic Episode Image


First, notice that I added the full subfolder path relative to the MainPage.xaml file, which lives in the project's root directory.

Second, notice that I also have added two more attributes ... I set Volume to "1" which means the loudest. Many settings in the Windows Phone API are 0.0 for the smallest and 1.0 for the largest value, with 0.5 somewhere in between. Most of these values are the C# data type Double.

Third, I will want to access this control programmatically to trigger the playback of the sound when someone taps the button, so I'll need to give the MediaControl a name. You may wonder what the x: prefix is for ... I'll explain that in the next lesson. Just keep that in the back of your mind for now.

Finally, I set the AutoPlay attribute to "False". If I set this to "True", the Duck.wav sound file would play immediately as my app loaded. That's not what I want. I want to trigger the wav file to play when I click the "Quack" button. We'll write code to accomplish that next.


6. Add an event handler for the Button click event

In the <Button> XAML element, I'll add the Click="" attribute. Visual Studio's Intellisense feature gives me the option to create a new event handler:

Generic Episode Image


Making sure that option is highlighted, I'll hit the enter key on my keyboard to generate a name for the click event handler:


Generic Episode Image


I want to write code that will execute when someone clicks the button, so I'll want to navigate to the PlayAudioButton_Click() method and write C# code there.

I right-click anywhere on that line of code and choose "Navigate to Event Handler" from the context menu:

Generic Episode Image


This opens up a file called MainPage.xaml.cs in the main area of Visual Studio.

If you're new to creating Windows, Web or now Phone apps in Visual Studio, you'll come to realize that there's two parts to these "pages" we're creating. The XAML and design view allows us to write declarative code (XAML). The related code view (the .cs file) allows us to define behavior in C#. These are two halves of the same concept. More on that later. In Visual Studio, your cursor should be located between the opening and closing curly braces for the PlayAudioButton_Click() method:

Generic Episode Image


Since this code block will execute whenever someone taps the Quack button on the phone, we'll want to trigger the MediaElement to play the sound we set in its Source attribute, namely, the Quack.wav file:

Generic Episode Image

I use the MediaElement's name, QuackMediaElement, to access it programmatically. I want to call its Play() method to kick off the playback of the Source, in other words, the Quack.wav file.

Now, let's test the app.


7. Run the app

Again, this should be familiar to you. You'll run the application in debug mode the same way you would run Console applications that we created in the C# Fundamentals series ... by either using the Play button in the toolbar OR using the F5 key on your keyboard.


Generic Episode Image


What you see next is the Windows Phone Emulator. It's a virtual machine that is running the full Windows Phone 8.0 operating system. In other words, the operating system actually thinks it is running on a physical phone device, however it is "virtual" in the sense that Microsoft created software that mimics the phone hardware in every way. We'll be using the Phone Emulator extensively in this series as it's easier than deploying our tests to a physical phone each time we want to test the code we've written or a change we've made. You'll learn more about the features of the Phone Emulator in this series.

Generic Episode Image


Use your mouse to simulate using your finger to tap the screen of the phone. You want to click on the red Quack button. If your computer is set up to hear audio, then you'll hear a duck's quack through your headset or speakers.

To stop debugging the app, click the red square button in the toolbar:

Generic Episode Image



To quickly recap, in just one lesson, we've created a simple sound board app. We learned how to create a Windows Phone project, how to modify the declarative XAML code to add and configure controls. We learned how to add assets to the project and reference them in our code, and how to add event handlers to respond to certain events that are triggered by the end user. We learned how the MainPage.xaml and the MainPage.xaml.cs are related ... we'll learn more about that in the next lesson. We learned how to trigger methods of the controls to play the sound when a user taps the button. Finally, we learned about the Windows Phone emulator as a means of testing our apps in a virtual environment.

However, there's a lot to talk about ... if you're new to XAML, it's really important for you to have a solid foundation with it, so in the next lesson I want to talk about the features of XAML and build on those throughout the rest of this series. As I said at the outset, many of the lessons you learn here will transfer over to all the APIs the utilize XAML, such as the Windows Presentation Foundation and Windows Store apps.



Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • hmy93

      Thank you your videos are extremely helpful! 

    • ori

      the link to sources seems to be down.

    • Playergoodi

      awesome video


    • BobTabor

      @hmy93: @Playergoodi: Thanks!  Smiley  Hope you enjoy the rest!

      @ori: It's up now.  Thanks for the heads up.


    • sina

      thanx alot for your videos,but in a beginer in programing
      can you please help me which programing language should i choose to learn for start programing for wp 8?
      i own an wp8 smartphone and i really want to learn make apps for it
      sry for my bad English.
      hope you can help me
      thank you.

    • BobTabor

      @sina: Hi, I really suggest you re-watch (or review) the first video in this series where I talk extensively about the pre-requisites for this course.  In a nut shell: C#.

      Start here:

    • Vahap

      I couldn't play the video,what is the problem ?

    • Hieu

      Hi Bob, I dont know how to show number line code in the XAML. :D

    • esedecks

      Hey! Thank you Bob I´m from México , you know I was starting to see the videos of "windows phone 7 for abosolute Beggingers" but I found these videos and I really want to congratulete, cause I can read english but when I have to listen It´s something very complicated to me , but I don´t know how I can understand you very well ! You have many skills to teach!

      Thank you again! 

    • Muhammad​Faizan

      You can turn your line No. on this way !!
      Goto "Tools" in the higher pane > "Option" a menu item available in "tools" > Then Click "Text Editor"> select "XAML" and then > "Check line Numbers" Line Number will be appearing on right side !

    • Karlzyffer

      First of all, Thank you for simply teaching.

      When i run the app, I'm getting an error message: "Deployment failed because no Windows Phone 8 phone was detected. Make sure a phone is connected and powered on."

      I think it is about Hyper-V. I have problems with hardware virtualization. Fixing it is a big problem in my mind  Mad



    • BobTabor

      @Karlzyffer: So, next to the green arrow (run F5) button on the toolbar, you have one of the Emulator options selected but you're getting that message?  That is definitely a problem.

      The emulation "just happens" ... you shouldn't have to know anything about it, or tweak it in any way.  If you already have Hyper-V installed, perhaps that's getting in the way somehow?  Can you try on another machine that is fresh (new install of the OS, etc.)? 

    • Karlzyffer

      I haven't got an Emulator option, only Device near green arrow with run function. I research on internet; this option needs processor that has SLAT (second level adressing tech..).((It is nonsense)) I installed Hyper-V, but my processor hasn't got SLAT, so Hyper-V platform (on windows attributes) can not be activated. I can't find or buy another machine so i have to find a way to fix this problem. But how?..

    • BobTabor

      @Karlzyffer: The only thing I can think of is to get a Windows Phone 8.  Your local Nokia rep might be able to loan you one for development purposes.  Unfortunately, this single requirement (SLAT) will keep many people from developing Windows Phone 8 apps.  Please let me know if you make any breakthroughs.  I would be interested to hear if you can make it work somehow.

    • usaid

      i'am unable to play the sound

    • golnazal

      @usaidDo you happen to have a Dell XP SP3? There is a known issue with the Dell soundcard drivers and a specific audio codec. Which is the codec we use on the high quality version of our videos. Have you tried downloading the video file and seeing if its still an issue?

    • Luis

      Muchas gracias, tus videos son de gran ayuda

    • Progr

      Excuse me, where i may to download this sound?

    • Yura Chebukin
      It's a "Source code" under the video.

    • Clint

      @Progr: grab the source code from, we broke them up into groups of lessons [zip files get big when you have to copy a lot of wav files Smiley]

    • XuanHien

      Thanks.Very Clear.

    • Rafay

      Hi Bob
      First of all i would like to say that you are a great teacher. I really like your way of teaching.
      Coming to my problem. When i try to run the application on the emulator i get the following error.

      "The Windows Phone Emulator requires Hyper-V. Your PC is missing the following pre-requisites required to run Hyper-V:

      Windows 8 Professional (64-bit)"

      My laptop came with pre-installed window 8 single language edition. And it is a 64bit version. Is it necessary to have a professional version of windows 8. I recently bought my laptop and i cant afford another one. Please let me knoe if there is any solution for this. Or do i have to buy the professional version of windows 8.

    • Clint

      @Rafay: you can update the version of windows from the standard to Professional or the other option is to directly deploy onto a phone.  Sorry, the emulator requires hyper-v, an emulation technology.

    • Rui

      Hi,I was running the code at 20th min in the video and got an XamlParseException.How do i solve this?I thought ive written the same code :(

    • Clint

      @Rui: I'd have to see the XAML.  Chances are it is a simple markup mistake.  This happens to everyone.

      You could either post the XAML in a comment or do and post that link.

    • Mohamed Kamel

      how can i parse an html File ??
      and Also how can i add an element in a grid dynamically according to my element size ?

      Can You help me?

    • Clint

      @Mohamed Kamel: Hey Mohamed, we're trying to keep the questions to only what is about the video at hand.  I suggest asking over on the forums at or try  both are great sites.

      Bing works as well Smiley

    • narendra

      good videos, plain , simple and well delivered. Simple is beautiful indeed!

    • Ank

      Why its not allowing me drag and drop ?

    • Janice

      How to configure hyper-v is explained in the first or second video correct? I have the same problem, not letting me select emulator, however when developing for win8 using windows store template I can use the emulator, hugh smh, can anyone explain why?
      I am running VS Ultimate 2012 on virtual box.
      Otherwise good lessons, I'm enjoying this, the code actually works, I have had soo many problems trying to learn this.
      Thanks a bunch

    • Clint

      @Ank: drop and drop what?  Controls onto the surface?  Personally I strongly suggest knowing XAML markup rather than doing it via the WYSIWYG editor.  You get better XAML along with XAML that can be easier ported to other platforms like WinStore

    • Clint

      @Janice: 2nd video.  it requires Win8 x64 Pro to run the emulator for the phone.  WinStore is a simulator, not an emulator.  It actually remote desktops into your own machine!  Totally different way.

      I don't believe you can run the emulator on Virtual Box as well.  A VM within a VM.

    • Scott

      The videos seem to only stream or 30 seconds and the die. The same is true for the different versions (resolutions) of the videos (all of the different lessons) from multiple locations on different machines (desktop win7, laptop win8, surfaceRT) When I do a "save as" it does the same thing.

    • BobTabor

      @Scott: Just to test, I re-watched this video and I'm about 3:30 into it ... seems fine on my end (I live in Dallas, TX).  Perhaps this is a regional CDN issue?  If that's the case, I'd be willing to bet it would resolve itself.  May I ask where in the world you are?

    • sregitz

      @BobTabor:I'm sure you are correct. I live in Houston, Tx. Since I tried it from 3 different ISP (Comcast, U-Verse, Phonoscope) I thought it might be something else. I'll give it a few days. Sounds like everything on the Channel 9 side is solid. I'll remote into a machine on the East coast and give it another try.Thanks!

    • BobTabor

      @sregitz: Are you the same person as @Scott: ?

    • George Clement

      Hi, great tutorials however I am getting an error saying there is no editor available and make sure the application for the file type (.wav) is installed. What do I need to do.

    • Clint

      @George Clement: Visual Studio cannot edit a WAV file (audio file).  In windows explorer, you can just use Media Player (or just double click on the file) to play it.

    • Mahesh

      Hi , Thanks for the great tutorial.

      I have installed SDK and tried to run the simple app as described in tutorial.

      I get following exception

      See the end of this message for details on invoking
      just-in-time (JIT) debugging instead of this dialog box.

      ************** Exception Text **************
      System.ArgumentException: Value does not fall within the expected range.
      at Microsoft.Xde.Client.RdpClientInterop.IMsRdpClientNonScriptable3.set_NegotiateSecurityLayer(Boolean pfNegotiate)
      at Microsoft.Xde.Client.DisplayForm.SetSecureModeOn()
      at Microsoft.Xde.Client.DisplayForm.InitClientSettings()
      at Microsoft.Xde.Client.DisplayForm..ctor()
      at Microsoft.Xde.Client.EmulatorForm.InitDisplayForm()
      at Microsoft.Xde.Client.EmulatorForm.OnActivated(EventArgs e)
      at System.Windows.Forms.Form.set_Active(Boolean value)
      at System.Windows.Forms.Form.WmActivate(Message& m)
      at System.Windows.Forms.Form.WndProc(Message& m)
      at Microsoft.Xde.Client.SkinnedForm.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

      ************** Loaded Assemblies **************
      Assembly Version:
      Win32 Version: 4.0.30319.18051 built by: FX45RTMGDR
      CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
      Assembly Version:
      Win32 Version: 8.0.9900.0
      CodeBase: file:///C:/Program%20Files%20(x86)/Microsoft%20XDE/8.0/XDE.exe

      Could you please advice how to fix it as I am stuck and cant progress.


    • Clint


      • Did you just install the tooling? 
      • Have you restarted your computer if the installer prompted?
      • Is this the code straight from our ZIP file?
    • Mahesh

      Yes , I installed it and have created new blank project , trying to run without any changes.

    • Clint

      @Mahesh: this pains me to ask as it is the most "default" question ... but since WP8's installer does do some stuff with Hyper-V, have you restarted your computer since installing?

    • Mahesh

      I have done it couple of times.
      Do you think its some instillation issue ?

      Following are the details for my install

      Microsoft Visual Studio Express 2012 for Windows Phone
      Version 11.0.60610.01 Update 3
      Microsoft .NET Framework
      Version 4.5.50709

      Installed Version: PD Express

      Team Explorer for Visual Studio 2012 04937-004-0029003-02235
      Microsoft Team Explorer for Visual Studio 2012

      Visual Basic 2012 04937-004-0029003-02235
      Microsoft Visual Basic 2012

      Visual C# 2012 04937-004-0029003-02235
      Microsoft Visual C# 2012

      Visual C++ 2012 04937-004-0029003-02235
      Microsoft Visual C++ 2012

      Visual Studio 2012 Code Analysis Spell Checker 04937-004-0029003-02235
      Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

      Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

      The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

      Windows Phone SDK 8.0 - ENU 04937-004-0029003-02235
      Windows Phone SDK 8.0 - ENU

      Microsoft Advertising SDK for Windows Phone 6.2.923.0
      Microsoft Advertising SDK for Windows Phone
      Build 6.2.923.0

      Microsoft XNA Game Studio 4.0
      Microsoft XNA Game Studio 4.0
      Build 4.0.40906.0

      NuGet Package Manager 2.0.30717.9005
      NuGet Package Manager in Visual Studio. For more information about NuGet, visit

    • Clint

      @Mahesh: doing a quick look, it is something with Hyper-v, not totally sure what however.  let me ask around

    • Mahesh

      Hi ,

      Have you got any updates on how to resolve the issue ?


    • Clint

      @Mahesh: are you running this from a VM?

    • Mahesh

      No , I used my HP laptop spec

      HP G62-452SA Laptop, Core i3-350M 2.26GHz, 3GB RAM, 320GB HDD, 15.6" HD, DVD±RW, HDMI.

      I upgraded this from Windows 7 to Windows 8 Pro.(64bit)

    • Clint

      @Mahesh: was more of a "are you running any additional software that could conflict with Hyper-V".  Can you verify the i3 you are running is SLAT.

    • Duduosun

      I am using my Nokia Lumia to test directly, as I don't have Windows 8 Pro. Everything works except that I don't get the Duck.wav sound on the phone. 

    • Clint
      @Duduosun: are you 100% you stores the audio in the same directory we did and you have the file path the same? Slashes and everything. does our version work for you?
    • Duduosun

      Thanx Clint, User error, yes I had spelling mistake within the path. It works fine now

    • Mahesh

      Running systeminfo on my machine show following a the end

      Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.

      Is this ok?

    • Clint

      @Mahesh: no you need SLAT (EPT == extended page tables)

      I've never run into this issue (I've installed the tooling on a lot of computers).  It could be something on your computer that is causing this.  It could be something with user access privileges ...  I'd suggest asking the question over on the forums at

    • Rex

      The autocomplete feature doesn't seem to work for me. When I type Click, the "PlayAudioButton_Click" option doesn't show up...

      I went to Tools -> Options -> XAML -> general, and the "Auto list members" option is grey and cannot be turned on..

    • McDomi


      Thanks for this great tuto, very helpfull.

      I have used your code on Windows 7; Visual Studio 10; targeted, of course Windows OS 7.1, all compiles fine and works fine but when I click on the button on the emulator, no sound is played although the sounds fine are correctly located in the directory Assets/Audio/Animals ... any idea ?

      Another question: which app Bob uses to record the videos and to appear in a small window ?

      thanks in any way for any answer,



    • Clint
      @McDomi: assuming you mean windows 8, not 7. Are you 100% you have the leading slash and entire file path the same? Does our same for this lesson work for you?
    • McDomi

      Hi Clint,

      I'm running Visual Studio 2010 with SDK for windows mobile 7, all running on Windows 7 (PC) 64 bits.

      Nota : I have loaded the same project into a Windows 8 (PC) 64 bits running Visual Studio 2012 and SDK for windows mobile 8 WITHOUT CHANGING A LINE OF CODE and this works fine !; I just want to test your example for windows mobile 7; I get no error during compilation, and I trace until the .Play() function but no sound is given; all is correct the sound files appear in the solution explorer (of VS2010) and I hear the sound when I double-clic on the sound file in solution explorer.

      Any clue ?




    • Clint

      @McDomi: first, it is Windows Phone, not Windows Mobile.  I have to stress that fact.  Next, we are trying to only answer questions that are related to the topic covered in the video.  This is Windows Phone 8 material and some things will be different between Phone 7 and Phone 8 content so be warned.

      So on to the code.  Are you using our sample from codeplex and the link above?  How are you sharing files between wp7 and wp8 in your projects?  are your audio files listed as reference or content (should be content)? 

      Chances are it is a reference VS content or if you're 100% not using the same file, it could be a slash is missing.  What I can recommend is zipping up your solution for both wp8 and wp7 and I can take a look if you can't solve this.

    • McDomi

      @Clint: sorry for bad posting here (win 7) and the wrong name (Windows Mobile) !

      I have built the code (for WP7) from scratch, step by step, following the video; I have just pickup the .wav files from your zip from codeplex.

      Ok, I'll tried to post the zip of the solution for 'your investigation' if I can't solve it.



    • Clint

      @McDomi: since you didn't use linked files, I worry they are truly not the same then.  Why are you targeting phone 7 instead of 8?

      For your problem, as my initial statement said, I believe it is a reference VS content or a missing slash issue but that is my blindingly guessing without looking at your stuff.

    • Samet


      I dont know if anybody gets this error : : A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in


      I do the same things as in video, but the error comes from 


      I run the app in real phone...

      Any thoughts?


    • Samet

      An Update about the question: If I comment out the whole button, app works and duck.wave plays...

      so,it means that problem comes from button...

      Ideas Perplexed ?

    • Samet

      Solved it...

      Width and Height: I wrote "200px" instead of "200"...aspx habit Smiley 

    • WinAppy

      Hi BobTabor!

      Thanks for your great tutorial. I am VC++ developer, so I like to do phone app on the same. So I want to know whether it is possible to create windows phone applications in vc++. If so, what are the steps to do.


    • BobTabor

      @Samet: Nice catch.  Smiley  I don't know I would have caught it without trial and error (removing attributes, etc.)

      @WinAppy: YES YOU CAN!  Smiley  Use this as a starting point (or google it using

      "C++ phone 8"

      ... helped me find this ...

    • joel

      Good series so far. Only on lesson three. I can follow everything you're doing thanks to the pause and position slider. New to C# and XAML. Reading Andrew Troelsen's book Pro C# 5.0 and the .NEW 4.5 Framework simultaneously. One thing that threw me when I loaded this first app onto my phone, a Lumia 928, (I don't have Hyper capabilities on my computer) was that the application loaded fine but when I pressed the button, no duck. I played around with the path (I was using a different one at first) with no luck. Then I noticed that you were using forward slashes instead of backslashes. Forward slashes to me are the Unix-Linux world and backslashes are the Windows world. Since Linux is nowhere to be found in this environment, why does this path use forward slashes? Once I fixed the slashes it worked fine. Now that I know what works I don't think I'll have the problem, but I would like to know why the forward slashes work here and nowhere else in Windows.

    • Clint

      @joel: file paths are URIs in this case much like a web URL.  Window Store applications work the same way.  You can pull from different sources, as well, app data, isolated storage, ...

    • chaochao

      Do you have this series subtitles??I'm very supposed

    • thenerd

      I successfully installed the Windows Phone 8 SDK and also enabled Hyper-V successfully.But when I was deploying the PetSounds app on Emulator, the virtual phone displayed "Windows Phone OS is starting" and took a long time before the emulator shut itself down and I got the error message : "App deployment failed. Please try again.". I searched msdn site for it and tried everything I could from troubleshooting(defragmented, ran chkdsk utility, am not using VHD) to checking my Hyper-V virtual adapter settings but still it doesn't works. What should I do to fix this??


    • Clint

      @thenerd: can you get the emulator up and started at all?  How much RAM does your computer have?

    • thenerd

      @Clint: it has 4 GB ram...yaah the emulator starts up and shows that "Windows phone os is starting" but then it shuts down after a while...and the deploy fails..

    • Clint

      @thenerd: Are you running in a virtualization environment?

      ok, try this for me.  Go into hyper-v manager, right click on your VM, and go to delete then try again.

    • devlife3

      Interesting. The sound isn't playing.  I hit the break point but I don't actually hear anything.

    • Naveen

      BoB....After writing my code for petsounds when i start emulator it gives err mssg....Deployment to application of device failed..err ox80131500 pls help

    • Naveen

      M using windows 8.1 preview...

    • tysoft

      Installed Windows 8.1 Pro (64bit) in a WMware Player 6.0 on a Windows 7 Ultimate (64bit) machine. In order to get Hyper-V running, refer to Editing the *.vmx did the job for me even though the OS & SDK was already installed. Had to install VS 2012 Update 3 to resolve compatibility issues with the emulator, but now the duck is quacking :o)

    • Clint

      @devlife3: are you 100% sure you have the file path correct?  Note the first slash.

      If not, upload the solution to and i'll take a look

    • Hari Babu

      Very helpful

    • nima

      first of all thank u so much for great tutorial.
      i have a problem.
      when i want to insert click equal to new event handler and enter on it i get error that says: Method name 'play audio button_click_1' is not a valid language identifier.
      can u please help me? what should i do?
      sorry for my very bad English.

    • Clint

      @nima: Did you compare our sample source code for this lesson against yours?

    • nima

      yes , i didn't find any difference!

    • Clint

      @nima: the fact you have what you listed, something isn't correct in your XAML or your CS file.  If you want, you can upload your solution to and I will take a look

    • thenerd

      @Clint: I am not  running it in a virtualization environment. Done, didn't work.


    • KenChen

      what a good videos!

      I have a question:Why do you write XAML files, instead of in the design surface? With more efficiency.
      Are writing XAML files really necessary?

    • BobTabor

      @KenChen: I think I talk about this in the series ... probably just haven't gotten to it yet.  Several reasons:

      (1) I don't have to lift my hands off the keyboard ... makes me more productive than with a mouse clicking all over the place.

      (2) Precision ... I can get exactly the results I want.  Sometimes you *think* you've done something in the designer that you really didn't do.

      (3) Most importantly, even if I did use the designer, I would want to know exactly what the designer is doing to the XAML and why.  If I don't understand what's going on behind the scenes, then I'm going to hit a wall at some point in the future.

      Just a work ethic developed over a long period of time.  Trust me ... took me a long time to ween myself off a designer.  Smiley

    • BIlal

      can we play the .mp3 files same way as we play .wav files ?
      i just copied a .mp3 file in the same directory and tried to play it
      e.g ".Assets/Audio/Animals/song.mp3"
      but it didnt worked

    • Clint

      @BIlal: are you sure your file path is correct?  I just did a test with an MP3 on the final project and it worked fine.

      For this lesson, path should have a leading slash.  You have a period.

    • devlife3

      @Clint:It turns out that I didn't include the Audio folder in the solution.  Always the dumb mistakes!

    • Bilal

      @Clint : i used this line of code
      " Source="/Assets/Audio/Animals/10396.mp3"
      and i copied the mp3 file in the folder with the rest of other animal sounds but it didnt work.
      i am using VLC player for mp3 files as default. Does it have to do anything with this ?
      Should i use Media Player as default ?

    • Clint

      @Bilal: without looking more at it, I don't know.  For this series, I can really only provide support for our samples.  It gets really hard to support the series otherwise.  I know our samples and audio files are encoded properly and are tested.

      If you want, you can upload your solution to and I will take a look when I get a chance.

    • PedroG

      Why its not allowing me to drag and drop the Audio folder from Windows Explorer to the target directory in Visual Studio's Solution Explorer?

      Using the copy/paste menu options, the paste is disabled on the target directory in Visual Studio's Solution Explorer.

    • BobTabor

      @PedroG: May need to unzip the file first?  If that's not it, perhaps a permissions issue on your desktop?  Outside of that, I'm not sure, maybe Clint has a better idea.

    • Clint

      @PedroG: I agree with bob, I tried from my desktop and it worked, if it is from a zip file that is just opened (will say "Compressed folder tools" at the top if it is) VS won't accept the drag in.

    • PedroG

      @Bob and @Clint: I'm trying to add the Audio folder, after I've extracted the zip, of course Smiley. I'm just trying exactly the same way you have done in the vídeo Bob.

      Ank added a post with the same problem, I think, at Aug 25, 2013 at 10:43 AM. He received a reply from Clint, but I think Clint missed the point then too. I don't know if Ank solved it out, but he didn't replied again.

      Because I couldn't, I just copied the folder to the Assets folder of the project, and used "Include in project" option to add it. But it would be nice to be able to do the way you did. And I don't get it why you could and I can't.

      So I create the project in other PC and tried again and... it works!!! I still not understand why it doesn't work in my PC. Sad

    • Anuraag


    • Clint

      @PedroG: I need to see what is happening and more details.  Are you using VS Express or VS Pro?

    • Padmanabhan K

      Great Tutorial, but I am facing an issue here
      When I press the emulator button, everything starts off well and the emulator opens up with a black screen and then displays the error
      'The Windows Phone Emulator wasn't able to create the virtual machine
      Couldn't change the processor of the virtual machine
      Cannot assign the specified number of processors for virtual machine "....." is out of range
      The range is 1 through 1 (virtual machine ID is ...................)
      What should I do? This is from the Windows 8.1 Preview with VS 2012 Update 3

    • Farhad

      Great Video! Many thanks :)

    • sabra

      the sounds must be .wave ?

    • Sugan

      Hi there,

      Pardon me if I am so silly ..

      Why should I add a MediaElement Control tool?
      And why should I place it outside the <grid> tag ..

      Is it wrong if I place it within the <grid> tag?

    • Sugan

      Also .. How to make the button as toggle?

      That is like to make the button play and pause/stop?

    • mmm011

      awesome series (Y)
      When I type "Click" inside the <Button> , and press return key and then press return key again on seeing the "New Event Handler", I get the following(EXACT) Error message:
      Method name 'PlayAud ioButton_Click_1' is not a valid language identifier.
      Please help ASAP
      Thank you.

    • mmm011

      Sorry to disturb , but I figured it out myself.It was a spelling mistake in the Name attribute of the Button Hence the Visual studio created some method name according to it hence it didn't worked out.
      By the way this also led to the .cs file's method not identifying the QuackMediaElement .
      @nima I guess u must have had the same problem!!!

    • danz

      a first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in

      whats solution?

    • Clint

      @danz: Chances are somewhere in your xaml you either misspelled something or used the incorrect casing.  XAML, just like C# is a case sensitive language

    • Clint

      @Sugan: use a ToggleButton instead of just a button.  You'll want to use different events than Click, Checked and Unchecked

    • Clint

      @mmm011: awesome you fixed it!  Programming typically will involve a lot of debugging.  Don't forget we do have full source code samples for every sample!

    • Clint

      @Sugan: it isn't wrong if you place it outside the Grid or in the grid for this sample.  If the Media Element's source is a video, the order and playment within the XAML could matter then. 

    • Clint

      @sabra: audio file can be a MP3.  It must be a format the media element can understand.  For this sample, we just decided on WAV files so we could reuse them in other projects if needed

    • Clint

      @Padmanabhan K: what order did you install the windows phone tooling and VS update 3?  There is a known documented issue with 8.1 Preview and WinPhone tooling.  You need to install VS Update 3 after you install WP tooling.  This is documented on the download page for the SDK.

    • faker62342

      Hi everyone Smiley

      first of all ,a big thank's for Bob for this series ,really great work man Cool

      I just have a problem when i'm trying to emulate any code Sad

      every time i tried to emulate i have this code as an error Error 1 0x80131500 .

      notes :i have an intel i3 380m processor ,and the hyper V is enabled in the bios part,ans i use windows 8.1 64 bits .

      thank you in advance Angel

    • Clint

      @faker62342: you need to install Visual Studio 2012 Update 3 after installing the developer tools to get it to work under Win8.1

    • Shayne

      So I'm trying to mess around with the knowledge I got from this video; I want to have my app make a sound when the app begins. What I tried doing was to set an event handler for when the MainPage was loaded call a method that does MySound.Play(). Turns out this works about 60% of the time, I'm so confused! Why doesn't this work all the time (or not at all). My app just creates a WebBrowser that then navigates to a specified webpage.

    • BobTabor

      @Shayne: Could you show us some code ... the entire event method where you're attempting to play the sound?  I'm betting you're relying on an event to fire that doesn't ALWAYS fire ... some events around re-activation (Launch, Navigate Away, Back, Close, Launch, Close, etc.) only happen in certain scenarios.

    • Clint
      @Shayne: instead of playing on the page load event, play on media source loaded. I think you are hitting a race condition.
    • dsrajapaksa

      When i'm running my app on Emulator i am getting an error.That says..

      The windows phone emulator wasn't able to connect to the window phone operating system:

      The emulator couldn't determine the host IP address,which is used to communicate with the gust virtual machine.

      Some functionality may be disabled.

      How can i resolve this problem?  

    • Clint

      @dsrajapaksa: are you running anything special like proxies, in a VM, or special networking stuff?

      If this is a fresh install, have you restarted your computer?

    • ChuckJ

      How do you add a Stop button to stop any of the sounds from playing?

    • Clint

      @ChuckJ: add in a new button (or additional logic to verify the current state of the media element) and just do QuackMediaElement.Stop(); or QuackMediaElement.Pause();


    • ChuckJ

      @Clint: Thanks. To be more clear, how about a button that would stop ANY mediaelement that may be playing within the app?

    • Angad Singh

      Hi Bob and friends,I am searching how to enable XAML Statement Completion which is default unselected and uneditable(INTELLISENSE)
      for xaml and activated for C#.But i see you are using the same for XAML in Express 2012 for Windows Phone.Can you plz guide me how to enable it?

      I went to Tool->options->Text Editor and then XAML or C#

    • Angad SIngh

      I was able to resolve this error by updating the VS edition Update 4 being the latest.

    • samantha

      These tutorials are amazing and perfect for beginners like me :) I have started developing but I would like to know if you will be able to help me in developing mobile apps related to "sailing schedules" for Windows 8 Phone. Thanks a million :)

    • BobTabor


      This series will definitely be helpful.  If you're asking me personally whether I can help you build your app ... I'm sorry, but I'm booked solid right now.  Thank you for your interest, though and good luck!

    • Robsoan


      Hi Bob can you help please I am following your instructions but I am having a problem with

      5. Add a wav file as an asset to the project

      as I cannot drag the audio folder into the assets area on the SDK. It appears that I cannot add wav files.

      Can you advise what may be the problem thanks Andy

    • Clint

      @Robsoan: are you trying to add this from a zip file?  extract first then try to drag them in.

    • samantha

      I am soooooooo happppyyyyyyyy!!!!!!!!!!! I have started developing...... I just can't express how excited I am to develop these apps.. THANK YOU SOOOOOO MUCH BOB & CLINT :)

    • paulo


    • Rani

      Hi Bob, I have a problem look forward to your help.
      I have absolutely applies in your way (create Button, MediaElement, the Click event ...)
      I have created 10 Click play sound! and it was only 6 the first run, 4 the latter can not emit sound when I click.
      I desperately need your help. Sincerely grateful!

    • Clint

      @Rani: not 100% sure what you're trying to do here.  If you want, you can upload your solution to and I will take a look when I get a chance.  This is outside the scope of our lesson here but will do a once over.

      My gut says you're jumping a bit off the deep end and wanting to do something more complex without understanding how the event life cycle works on a few things.  This is where debugging comes in Smiley

    • Rani

      @Clint : thank very much ^_^

    • Pooja

      Thank you so much . This tutorial is really helpful :)

    • Kaustabh Datta Choudhury

      Whenever I try to run my code, the Windows Phone 8 Emulator tells me that it cannot run as it needs Windows 8 Professional (64 bit) to execute. Currently I am running Windows 8.1 Single Language (64 bit) upgraded from Windows 8 Single Language 64 bit(It came bundled with my HP Pavilion g6 Laptop). Also I have Hardware Virtualization enabled and my laptop is SLAT supported.

      Please do help me out in fixing this problem.

      Thank You.


    • Clint

      @Kaustabh Datta Choudhury: you need windows 8/8.1 professional or better to use the emulator.  You can still deploy to a phone directly.

      Hyper-V is what is required for the emulator and only comes the Professional edition or better.  You should be able upgrade your edition to professional but it does cost some money to do so.

    • onimoD

      Bob/Clint, Greetings from the UK. Truly impressed with the series and the fact that you guys are still responding to these comments. Also, documenting the content of the videos makes it great reference material and is helping me produce my first WP8 app. Thanks.

      Just wanted to share a small finding. Fractional numbers seem to reduce the volume of a .wav MediaElement on an exponential scale. E.g. Volume = "0.9" seems to reduce volume by about a half and "0.8" by half again. So setting volume to "0.5" (as I did initially) might mean you can't actually hear it at all (as I couldn't)  Wink

      Took a bit of head-scratching to figure it out so I thought it might help someone else.

      Br,  Nick


    • Clint

      @onimoD: is this emulator or phone?  You have to remember, your phone's base volume is also taken in there.  So what seems like a small drop chances are could be much larger of a total drop depending if the phone's volume was set to.

      My opinion is to always just set the volume to a media element to 1 and let the end user adjust as needed using their volume.

    • keluhanh


      Hi, I'm very interested in this series! thank you a lot!!!

      Can I make an app same same your demo about English alphabet for children?

      sorry for my bad English.




    • Clint

      @keluhanh: sure, we provided the source code as a good starting off point.

    • onimoD

      @Clint: This was using my phone (L920) with the phone's volume set to max. My first thought was that there was something wrong with the wav so it was a while before I tried a volume setting other than "1" (which worked) and "0.5" (which appeared not to).

      I hear what you're saying about letting the user adjust as needed. This is for an app that is likely to be used in quite areas so I was trying to make this 'alert' sound more subtle. You are right of course though. I'll let the user control the volume and even give them the chance to turn sound off and have a haptic response only.

      Off to Google 'WP8 Haptics' now.  Wink

    • Soumya Ranjan Panda

      I am really sorry but i cant find from where to download the Assets required for the PetSounds project. Please provide me with the links.


    • Clint
      @Soumya Ranjan Panda: the like is at the top of the page to the codeplex page for the series with all the material like sounds in zip files Smiley. Since this is lesson 3, get the lessons 1-10 zip file.
    • onimoD

      I've discovered a bug but I'm not sure if it's hardware or software. With both your source code and the app I'm developing separately, I find that if I leave the app idle long enough for the screen to time out, the sounds don't play after the phone is re-awakened. I haven't found this with any other apps or games installed on the phone. Any ideas as to why this is happening? I tried changing the time-out setting from 3mins to 30secs and it makes no difference.

    • Clint

      @onimoD: you have to deal with resetting the source on tombstoning.

      we intentionally skip over a few things as they are far more advanced topics

    • onimoD

      @Clint: That's cool. Thanks for the pointer.

    • Abhishek

      When I run PetSounds project of this very same video I got this error:

      A specified communication resource (port) is already in use by another application.

      I tried:
      1) Restarting VS 2012 and my computer but it didn't work.
      2) Tried solutions via Google (e.g. but it doesn't work for me.

      Please help me!

    • kushtrim

      Hello Bob, My computer doesn't support Second Level Address Translation (SLAT) does that mean that I cannot develop windows 8 apps ? The emulator won't run there a way to enable SLAT on my computer?

    • sdasdas

      Many thanks @Bob for such a helpful and clear tutorial. I started to learn WP programming by your this series. It is awesome.

    • Clint

      @kushtrim: you can, you just need a physical phone to deploy the application to.

    • totti10hj

      Hi,sir. I just installed WP8 SDK, and I can also open a template of WP projects in Visual Studio, but when I'm trying to create a new WP project, no such options show up, only one choice: install WP8 SDK. So now I can only practise coding in a template. I need ur help, thanks a lot.
      BTW, in this video I do the same like u guys do: put in Click="", but VS doesn't show a New Event Handler choice for me.
      Need ur reply, thanks again.

    • Clint

      @totti10hj: this goes through visual studio 2012.  Sounds like you have Visual Studio 2013 if you are talking about the item above.  If you launch that, it will install properly for 2013.

      for the new event handler, do you have resharper or another tool installed?  I just tried with resharper disabled and it came up right away. 

      If you miss the prompt for wiring up the event handlers automattically, you can hit control-space to get the context menu to come up with the options.

    • ahsan123

      any body help me please when I run the emulator it runs but my app dosnt run a dialog box appears that says application takes longer time than expected  is this a machine problem ? am using dell core i3


    • BobTabor

      @ahsan123: I would recommend starting over, retracing your steps.  Nothing we've done so far should have killed the emulator.  Create a new blank Grid App template app and don't add any code -- just see if you can get it to work without that issue.  At least you can rule out the machine issue.

    • Omar Shamali

      Well, I'm an iOS developer, I become interested to learn making Windows apps after i watched this video, it seems quiet simple and smooth!

      Thanks Bob, keep the posting up.

    • ahsan123

      @BobTabor:thanx bob fo the rep i start a new project and run it without any modification but problem is still same emulator runs but app doesnt and same dialog box appears 'remote operation is taking longer than expected' and this dialog box coninues it never ends am using windows 8 pro 64bit del core i3.can  u tell me how to enable hyper v on this system ???but i thing it is enabled cuz sdk installed smmothly without any error message !!!

    • Rida221

      Hi there i wanted to shoe toast prompt when my app is not running,any help with that?

    • BobTabor

      @Rida221: Unfortunately, I don't think we cover that in this series.  There are plenty of videos on Microsoft's sites and else where that cover that sort of thing.  Good luck!

    • Rohit

      Sir In debugging option only Device is Showing instead of any option of emulator.I cannot run the app.

    • Akhil Menon

      Hey Bob please help me here....I am totally stuck.
      When I start the project and try to run using emulator,the emulator shows and then it shows Windows phone OS is loading...

      I waited for around 15-20 min,then also same.So I checked whether it is loading in Hyper V or not...there I saw that OS was already loaded.

      So why it has not loaded in VS...please help.When I close emulator in VS,it shows Deployment error

    • Saeed

      Hey Bob please help me here :(
      my CPU don't support Hyper-Threading & Virtualization Technology :((
      i can't buy another machine,,plz help me :(

    • Akhil Menon

      Here are the screenshots of my problem mentioned above....!266&authkey=!AATJ67E5DfHsPFM&v=3&ithint=photo%2c.jpg

    • Li Yu

      Thank you Bob,I find this video very useful!But there is some trouble with my environment..
      The grammer highlighting function with .xaml file seems doesn't work!I use Microsoft Visual Studio Express 2012 for Windows Phone,and the .xaml file is set to open with "XAML UI Designer",but there is no grammer highlighting there,despite the Intelli is still working.Could you tell me how to fix this? Thank you!

    • lmelikardi

      Hi Bob, i'm Brazilian and i think your classes are very Helpful. I didn't find the duck.wav to download!

      Could you send it for me? Thanks!

    • Ashish

      I want to show your videos in my School's computer club
      But the comps there have no internet :(
      Any way to install Studio 2012 without an internet connection (Without having to ... enter the registration code and all after installing)

    • Darkrender

      :Its really upsetting to me that, at the beginning of this series, we were told that all we needed was windows 8 64 bit, and that we did NOT need professional, and everything would work. SO.. i buy windows 8 regular to save money, and come to find out i really do need windows 8 pro if i want to use the emulator. Perhaps next time, more homework should be done so your students know EXACTLY what they need before they take their time watching the videos and spending money. All complaints aside, the teaching itself is quality stuff, and I will probably continue to follow along, despite not being able to test any of my apps.

    • BobTabor

      @Rohit: Your computer can't support the emulator / Hyper-V.  Sorry, but you're out of luck.

      @Akhil Menon: Sorry, I have no idea.

      @Saeed: Sorry, you're out of luck.

      @Li Yu: You probably need more RAM.  You don't need Intellisense, but it is helpful.

      @lmelikardi: Did you download the link at the very top of this page (under the video) that says "Source Code"?  I'm pretty sure it's in there.

      @Ashish: I'm pretty sure you can download the ISO and burn to DVD.   Go to the download page.

      @Darkrender: I agree ... In fact from now on, I'm not going to talk about installing the tools.  That will be someone else's job.  However, if you look at the previous page, I did edit the TEXT version of the video with my updated advice -- i.e., that you DID in fact need the Pro version IF you wanted the Emulator.

      Also, there were extensive discussions through the conversation thread below that video.  I had already spent a couple hundred dollars on Windows 8 licenses to figure all of this out, so I did NOT purchase the non-Pro version myself to try out every possible permutation.  My advice, when there's a mere $30 difference, always choose Pro ... regardless of the tool / OS / etc.



    • surfacepro2​boy

      Why do you prefer using C# instead of visual basic?

    • BobTabor

      @surfacepro2boy: I've recently finished a Visual Basic course for Microsoft Virtual Academy.  I tweeted something to the effect that VB has gotten a bad rap.  It was fun, and I forgot how much I enjoyed it.  I felt productive.  So, why NOT VB?

      That's a good question to ask, and a hard question to answer.  It definitely reads better to a beginner than, say, C# or JavaScript (or C or C++ or ...)

      I think it comes down to this ... in the late 90's there was a stigma with being a VB programmer ... other developers didn't take you seriously.  The fact of the matter is that VB was so easy to write that you could easily build really poorly architected applications quickly.  I think it was a cultural thing ... C# was meant to draw the Java developer crowd (or at least, stop the attrition), but to some extent it cannibalized the VB developer who wanted to differentiate themselves from the VB developers who didn't care about code quality, OOP, patterns, etc.  

      Now, almost all articles for any given topic written on MSDN, forums, videos, etc. use C#.  The main reason I would recommend C# is (a ) better community support from developers who are constantly wanting to stay abreast of the latest and greatest changes in .NET and development in general, and (b) since those people are generally regarded as the experienced / senior developers in most companies, they drive architectural spikes for new project initiatives and pick C#.  So, as a result, most jobs are looking for C# developers.

      But C#, VB ... it all is just IL when compiled to a .NET Assembly.  So in the end, with minor exceptions, it doesn't really matter.  You can mix and match languages within a solution.  But from a pragmatic perspective (and this is just my opinion, definitely NOT Microsoft's position on this matter) C# is what you should be learning if you hope to work in an enterprise.

      If you're a hobbyist and could care less about what other's think about your choice of language, AND if you don't mind the fact that there are fewer books with VB examples, then knock yourself out.

      Personally, there's only so much time in the day and only so much money in the budget.  Recording videos is hard work, despite how it might look.  I could barely get this series out the door much less turn around and do it again.  :)

      Learn C# ... it's not hard.  You'll be glad you did.  It will make you a better VB programmer, and vice versa.

    • Gabriel Hamerski

      When I open my program in the emulator, Visual Studio automatically opens the "MainPage.g.i.cs" tab ...
      On my emulator, it just gets a clock (which should be the default WP) and no longer opens the application ...
      Before my problem was with the sound, now the problem is to open my application ...
      Any suggestions?

      --- I am Brazilian, I do not know English, was translated by Google Translate ---

    • BobTabor

      @Gabriel Hamerski: Sorry, I have absolutely no idea what the problem could be.  Try asking here:

    • AnPham

      Hi BobTabor !
      this is great video for me but i have a problem. Follow your tutorial I have created 12 Button, 12 MediaElement. No have any error but only 6 on 12 button active. I don't think my code is wrong.

      Please ! help me 

    • BobTabor

      @AnPham: Have you downloaded MY source code and tried it?

    • Volkan Toksoz

      Hi Bob Tabor thanks this and others videos. I'm from Turkey, and My english is a little bad. Difficult to find in my own language resources but I well understood. Thank you again.

    • Archana

      Sir,where do i get petsounds?I couldnt able to find them..please provide link to download petsounds..

    • BobTabor

      @Archana: Ctrl + F on this page ... Search for "Source code" ... there's a link.  The files you need are (or should be) in there.  Good luck!

    • icguy

      Hi! my MediaElement doesn't quack :( i've tried to play back an mp3 file from an url (after reading this post) and it worked. What am i messing up?


      EDIT: Okay I've figured it out, i was using "\" instead of "/" in the path for the wav file.

    • rictersmith

      @BobTabor: Thanks for the great work you do. I've been a lifetime subscriber to your site close to day one.

      I've been helping my 10 year old son learn C# and we both work through your videos together. I've got both windows phone 7 & 8. We didn't have the money to go out and buy another phone or computer (neither of ours supports SLAT), so I had him use the Win 7 phone and I used my 8.

      We both had audio issues playing, however I tracked mine down to missing the "s" in "Animals" so once I fixed the path I was good to go.

      We however cannot identify why his will not play audio. I realize this is a WP8 course, but in searching I have not found a reason why it would not play, so I was hoping you might have some idea.

    • khanh le

      What can I do to open the camera on my app?

    • Daniyal

      Hello Bob Thanks !

      How can i play this sound in a loop ??

    • BobTabor

      @rictersmith: Did you ever figure this out?  Perhaps the WP7 doesn't support the same API?  Did you get compilation errors?

      @khanh le: Do you want to control the camera OR allow the user to select a photo from the camera / photo picker thingy?

      @Daniyal: Have you attempted writing a loop in C# that continues to call the play method?


    • kajal

      Hi Bob,

        Is there a way we can make the app

      1. Wait

      2. Exit

      without clicking any button. Say I want to wait for a few seconds after the duck sound is played and then close the app. How can I implement such a thing. We do not have thread.Sleep() in WP8.1.. so how can we accomplish this?




    • AnandDesmOn

      Hii bob,
      When I open my program in the emulator, there is some error were occuring like 

      Error message: "ensure that the target device screen is unlocked"

      i dont no wat to do can u help me solve tis

    • JesusGarcia

      Hi bob,
      Greetings from Perú,
      Can you tell me what is the code for changing the font's color?
      Thanks for sharing your knowdlege :-)

    • ODBS75

      A very good introduction!

    • jex

      sir , when i run my app in visual studio .. i am facing some problem " the emulator is couldn't determine the host ip address, which is used to communicate with  the guest virtual machine " .....plzzz sit give me the solution  ....i have reinstalled the visual studio .then also the same problem ......


      sorry ...for my poor english  


    • noha

      Hello Bob,

      when i run this code i have these 2 follow errors:
      1- Error 11 Could not copy "obj\Debug\PetSound.dll" to "Bin\Debug\PetSound.dll". Exceeded retry count of 10. Failed. PetSound
      2- Error 12 Unable to copy file "obj\Debug\PetSound.dll" to "Bin\Debug\PetSound.dll". The process cannot access the file 'Bin\Debug\PetSound.dll' because it is being used by another process. PetSound

      Can u help me with this ??

    • sai

      Sounds not playing,its showing 2 errors in lines 8 and 26 which we didn't change at all.

    • satishnair77


      I am having an issue with the XAML view in my VS Express 2012.

       *.xaml files are loaded but they appear as plain text (black-on-white). Intellisense works fine. Also syntax errors are underlined. Everything seems fine except the colors.

      I have tried changing the setting/reset to defaults in Tools > Options> Environment. Also Changed the settings in Tools > Options > Text Editor > XAML

      Also right clicked on .XAML file in the Solution explorer and clicked Open With, to select different editors.

      But all these make no difference. Any suggestions? The formatting of .CS files are correct. Its only XAML files that is creating this nuisance.



    • milobcl

      please please please

      how can i always initiate a new instance when the app is in dormant ?

      thanks a lot

    • edmajeja

      Thanks  but as I download the subtitles in spanish?




    • aakarsh

      Hi, I am unable to play the sound.
      I have done everything according to the video.
      I am using MSVS2010 with Silverlight Application Development for Windows Phone 7.1.

    • aakarsh


      Warnings{1}:Project does not support paths relative to the root application directory. Remove the leading '/' qualifier from the'/Assets/Audio/Animals/Duck.wav' path to correct the problem.

      I removed the leading '/' qualifier.. yet no sound is played.

    • Prem

      Hi Bob,
      Thanks for your videos. Really its very helpful for beginners like me. The audio is playing well when we give the audio file is in the Assets or any other folder in the project. But how to give the source for the mediaelement for the remote url like "" on the button click?? Please provide me a solution. Thanks in advance.

    • ravi raja jangid

      hi Bob tabor,
      its fantastic job to providing video tutorials wp-8....
      but i have 1 question .
      1. how i install wp8 sdk in win 7 32bit, is it impossible? because i dont want to format.

    • Mohan

      Hi Bob,
      I am not able to copy the audio file into the assets by drag and drop.
      I did exactly the way you showed in the vedio.

    • azadz

      hi please show me how to make dictionary  for windows phone 8.1 by video 

    • Abhinov

      Awesome Video ...The enthu with which you teach us motivates people like us to learn more and more..

    • Avani Tiwari

      All ur videos tht I followed were simply awesome n vry vivid.
      I jus wanted to know if we could play any other format thn the wav format.I tried using the mp3 format but the emulator could not play it.I got the remaining thngs in the video.
      only if u could help me with ths..thnku.

    • Soham Pal

      Thank you for this wonderful series,i have completed the entire series....and after seeing the codes i was able to create my own version of SoundBoard.....Thanks a lot

    • Niraj Trivedi

      While i am debugging this project to run it then its give me error that is "Deployment failed because no Windows Phone 8 phone was detected. Make sure a phone is connected and powered on." i think this is because emulator is not installed in machine. but Could you help me out to solve this problem. and also provide me a link from where i can download windows phone emulator. i have already installed windows 8 sdk

    • jonesgeorge

      @BobTabor:Hi Bob, first of all nice tutorial. But I have this Hyper-V problem. I can't run it. It is saying that you have to activate Hyper-V. I have AMD A8 6500 dual core processor. I checked the BIOS but I don't see any options to activate the hyper threading. How to activate this thing? Please help me out I can't do anything until thing works out!!

    • nimish

      Hi Bob,

      Thanks for your video and tutorial. I tried myself with the same code mentioned above, but in my case the when I click on the button it does play the file. I just wondered if there is any setting in the emulator is required.

    • nimish

      Hi Bob,

      Thanks for your video and tutorial. I tried myself with the same code mentioned above, but in my case the when I click on the button it does play the file. I just wondered if there is any setting in the emulator is required.

    • ubaidullah

      Hi, I have a problem that i cant update/install my windows. I currently using windows 7. I recently complete windows phone 7 series.
      is it possible to learn this series on windows 7?
      any difference between window phone 7 series and windows phone 8 series?

    • anil

      Thanx sir for your greate video.I have installed vs2013 express for web and window 7 which sdk i should installed for the same

    • vikas rawat

      hello bob..thanks for the great teaching stuff..however m stuck at the beginning..
      m unable to drag and drop folder to the just doesnt add to the assets..y so..
      if anyone can hepout...

    • vikasrawat
    • anil

      thanx for worderfull tutorial

    • John

      Has anyone an idea where I can get the assets ?
      I just can't find an link to them.

    • gduncan411

      @John: Top of the page, right below the video... (or here

    • asfend

      Hi BOB !when I run the code in Windows phone sdk visual studio express 2012 then I got a deploy error message(0x80131500) and there's no description of this error .Will you please tell me What can I do??

    • BobTabor

      @asfend: Google (in this case) is your friend:


      Read the selected answer (green check mark)

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.