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 6766733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:52:00+00:00 2026-05-26T14:52:00+00:00

is there a way to specify something like this in WPF: CSS: #someSpan input

  • 0

is there a way to specify something like this in WPF:

CSS:

#someSpan input { color: #f1f1f1; }
or
span input { color: #f1f1f1; }

meaning, i’d like to have all TextBlock elements within container follow x style, w/out having to apply the style to each textblock.

just to clarify, i need to do something like this in WPF.

i know about the BasedOn attribute of a style.. but that’s not quite what i’m looking for here

looking for something like this

 <Style x:Key="FileItem"  TargetType="{x:Type #SomeContainer TextBlock}">

or maybe within SomeContainer, add a TextBlock style that will apply to all of its textblocks

  • 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-26T14:52:01+00:00Added an answer on May 26, 2026 at 2:52 pm

    Regarding the last part of your question, if you want to apply a style to all TextBlocks within a particular element, just put the Style within that elements resources:

    <TextBlock /> <!-- unaffected -->
    
    <Grid>
        <Grid.Resources>
            <Style TargetType="TextBlock">
                <!-- ... -->
            </Style>
        </Grid.Resources>
    
        <TextBlock /> <!-- will be styled -->
    </Grid>
    

    If you have your styles stored in a separate ResourceDictionary then you can “import” them all for a particular element by merging resource dictionaries:

    <Grid>
        <Grid.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="/Resources/MyOtherStyles.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Grid.Resources>
    
        <TextBlock /> <!-- will be styled -->
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to specify a mysql query that does something like this
Is there a way to specify pretty-print-like formatting around HTML tags? I want to
Say you have a schema that looks something like this Foo FooId Bar BarId
Is there any way to specify different font sizes for fallback fonts in CSS?
I have a aspxgridview control from DevXpress. Is there a way to dynamically specify
I have something like this going on in my Java program: void f(Object o)
I have a grid in GXT, something like this: List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
Is there a way to specify a child's initial window position in Qt? I
Is there a way to specify a one dimensional array in a ini file.
Is there a way to specify some JavaScript to execute on the OnBlur event

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.