Jump to content


Help Cannot Add Enemytemplate - Right Click On Contentcontrol

  • Please log in to reply
1 reply to this topic

#1 HamsterMan


    New Member

  • Members
  • Pip
  • 1 posts

Posted 17 February 2014 - 09:05 AM

Hi Everyone.

I could use some help, if you have a moment.

I am using the WPF Learners guide as I have Windows 7 and Visual Studio Express 2010. I am on page 23, section 3. I am trying to add the enemy template. The instructions says to

"right-click on the ContentControl in the Document Outline window. Choose Edit Template, then choose Create Empty... from the menu. Name it EnemyTemplate"

When I right click, there is nothing. No sub menu nothing. Am i missing something or could you suggest a way around this issue.

Thank you in advance.

#2 AndrewStellman


    Andrew Stellman

  • O'Reilly Author
  • PipPipPipPipPipPipPipPipPipPipPip
  • 832 posts
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:Author of: "Head First C#", "Beautiful Teams", "Head First PMP", "Applied Software Project Management"

Posted 18 February 2014 - 05:59 AM

That's right, this feature was only available starting with Visual Studio 2012. See the box on the top right corner of page 22:

The user interface for editing colors in earlier versions of VisualStudio is not as advanced, but you should still be able to set the colors so they look correct. The Document Outline window is also a little more primitive, but it still works. However, there is not an easy way to visually create a template in VisualStudio 2010. The easiest way to do this in the old version of the IDE is to copy the entire <Window.Resources> section (up through the closing </Window.Resources> tag) from the downloadable source code and paste it into your XAMLjust above the opening <Grid> tag. Then you can select theContentControl and use Properties window to set the Templateproperty to EnemyTemplate. Your enemies will already look like evil aliens, so make sure you still read pages 44 and 45.

Andrew Stellman
Author, Head First C#
Building Better Software -- http://www.stellman-greene.com

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users