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

  • Home
  • SEARCH
  • 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 1092241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:39:06+00:00 2026-05-16T23:39:06+00:00

It seems something like this is not allowed. Any workaround? <Style x:Key=MyDerivedStyle TargetType={x:Type Button}

  • 0

It seems something like this is not allowed. Any workaround?

  <Style x:Key=MyDerivedStyle TargetType="{x:Type Button}"
         BasedOn="{DynamicResource GlobalButtonStyle}" />       

  <Style x:Key="GlobalLabelStyle" TargetType="{x:Type Button}">

I get the error:
A ‘DynamicResourceExtension’ cannot be set on the ‘BasedOn’ property of type ‘Style’. A ‘DynamicResourceExtension’ can only be set on a DependencyProperty of a DependencyObject.

If I change it to StaticResource, the style does not appear in my control.

  • 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. Editorial Team
    Editorial Team
    2026-05-16T23:39:07+00:00Added an answer on May 16, 2026 at 11:39 pm

    Two issues here:

    First, your global style needs to appear before your derived style (either in the same resources section, or by merging in the appropriate ResourceDictionary before attempting to define the derived style.

    Also, you need to explicitly define the Style in your button:

    <Button x:Name="btnOne"
            Style="{StaticResource MyDerivedStyle}"
            Content="Derived" />
    

    Note that in this case you aren’t creating a Dynamic Resource (i.e. one that needs to be reloaded). It is static, as a Style that is being used for a BasedOn needs to be.

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

Sidebar

Related Questions

It seems like there should be something shorter than this: private string LoadFromFile(string path)
Is there some easy way to pad Strings in Java? Seems like something that
It seems if I do something like $file = fopen($filepath, w); $CR = curl_init();
Is there something like the Python descriptor protocol implemented in other languages? It seems
I'm still working on a particular RDF file, but seems that something is not
This is a follow-up from this question . Functions are not allowed to write
I'm trying to do something simple like this: members = models.ManyToManyField(User, blank=True, null=True, unique=True)
I would like to do something like the following but can't seem to get
I seem to be missing something about LINQ. To me, it looks like it's
Whichever way I do it, it seems something goes wrong when using the conditional

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.