Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 171273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:57:32+00:00 2026-05-11T12:57:32+00:00

I am playing with templates in Silverlight 2.0. I copied this… <Style x:Key=RoundButton> <Setter

  • 0

I am playing with templates in Silverlight 2.0. I copied this…

<Style x:Key='RoundButton'>     <Setter Property='Template'>         <Setter.Value>             <ControlTemplate TargetType='Button'>                 <Grid>                     <Ellipse Width='200' Height='200'>                         <Ellipse.Fill>                             <RadialGradientBrush GradientOrigin='.2,.2'>                                 <GradientStop Offset='0.2' Color='White' />                                 <GradientStop Offset='1' Color='Blue' />                             </RadialGradientBrush>                         </Ellipse.Fill>                     </Ellipse>                      <TextBlock Text='Push me' FontSize='28' HorizontalAlignment='Center' VerticalAlignment='Center'/>                 </Grid>             </ControlTemplate>         </Setter.Value>     </Setter> </Style> 

from a web page at http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-7-using-control-templates-to-customize-a-control-s-look-and-feel.aspx.

I put it into my app.xaml and as yet have not used it anywhere. When I try to run my code I get an error ‘Exception of type ‘System.ExecutionEngineException’ was thrown.’

What have I done wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:57:32+00:00Added an answer on May 11, 2026 at 12:57 pm

    I believe that Silverlight requires the TargetType attribute. If you add TargetType=’Button’ to the Style element, it’ll compile and execute without this exception.

    EDIT: Yeah…I just followed the link you posted, and he has the TargetType attribute in his sample code. Add that, and you’re all good. I created a simple test app with just that Style element and a button using it, and it worked fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Templates: template function not playing well with class’s template member function template
I was playing around with variadic templates (gcc 4.5) and hit this problem :
Just playing around with the now released Silverlight 2.0. I'm trying to put a
While playing around with regexps in Scala I wrote something like this: scala> val
I have been playing with this for a while, but the closest I have
I'm currently playing with the Silverlight(Beta 2) Datagrid control. Before I wired up the
I'm playing around with templates. I'm not trying to reinvent the std::vector, I'm trying
I've been playing around with type deduction/printing using templates with code of the form:
I've been playing around with the Liquid templating engine this weekend, and I wonder
I have been playing around with Template functions, and made a little logger program.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.