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

I was playing around with class templates and statics and saw this: template<int I>
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 :
I was playing with Visual Studio and templates. Consider this code struct Foo {
I'm playing around with templates. I'm not trying to reinvent the std::vector, I'm trying
So I've been playing around with Silverlight's button styling and, personal feelings about just
I am working on a stylesheet employing many templates with match attributes: <xsl:template match=//one
I've been playing around with type deduction/printing using templates with code of the form:
I'm playing around with template specialization, and I've found an issue I can't seem
I am playing with the wcf 4.0 rest template and trying to get it

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.