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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:30:16+00:00 2026-05-29T06:30:16+00:00

I have several resource dictionaries with theme-related data, where I declared styles for particular

  • 0

I have several resource dictionaries with theme-related data, where I declared styles for particular element this way:

<Style TargetType="sdk:DataForm">
    <Setter Property="Background" Value="{StaticResource Bckgrnd}"/>
</Style>

And also I have Generic.xaml, where I want to set the template for this target type, but I was faced with a situation where in one template I have to use several colors but target type have only one property for color. Something like this:

<Style TargetType="sdk:DataForm">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="sdk:DataForm">
                <Grid ctl:DataField.IsFieldGroup="True">
                    ....
                 <StackPanel Background="{TemplateBinding Background}" ...>
                    ...
                    ...
                 <!-- and I need another background from themes here -->
                 <StackPanel Background="{???}" ...>
                    ...
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

And the question is: how can I use different colors in this case without something like target type extension? It will be great if you’ll find pure xaml solution.

Thanks

  • 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-29T06:30:16+00:00Added an answer on May 29, 2026 at 6:30 am

    I don’t know of a pure XAML solution. I think I would create a subclass of DataForm and add dependency properties of type Brush to it. Then use that class in the XAML instead of DataForm, and use TemplateBindings that reference the new properties.

    Or, if you don’t want to subclass DataForm, perhaps you could create attached properties of type Brush.

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

Sidebar

Related Questions

I have several tables whose only unique data is a uniqueidentifier (a Guid) column.
We have several wizard style form applications on our website where we capture information
I have an assembly that contains several resource files. Most of them have the
I have a resource defined in my Xaml file as follows: <Path x:Key=myPath Data=M14.773241,18.080208
I have several drivers using a resource in my code, of which only one
Just a simple question, if i have several resource files for a page (contains
Could someone explain how I should use resource injection when I have several packages
I am trying to have to skin resource dictionaries for a wpf application that
I have several large embedded bitmap files in my resource project. The compiled exe
Let's say you have a complex resource in a REST API. You have several

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.