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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:16:38+00:00 2026-05-18T08:16:38+00:00

. Hello guys, Can we write our custom controls in such a way that

  • 0

.

Hello guys,

Can we write our custom controls in such a way that later on we can re-template it partially? Means, without replacing the entire ControlTemplate, we want to change/override some of it’s look and feel?

One way, of course, is this : copy the ControlTemplate code from generic.xaml, modify it’s look and feel partially, and use it in your xaml, as shown below:

<MyCustomControl>
       <MyCustomControl.Template>
              <ControlTemplate>

                    <!-- paste the copied and modified code from generic.xaml here-->

              </ControlTemplate>
        </MyCustomControl.Template>

        <!--other code-->

</MyCustomControl>

But the problem with this approach is that, we make our xaml too verbose. And I seriously don’t like it. I’m looking for some solution that may save me from polluting the xaml where I’m using my custom control.

Thanks in anticipation!

.

  • 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-18T08:16:39+00:00Added an answer on May 18, 2026 at 8:16 am

    I agree with most of what Martin says about ControlTemplates being pretty much an all or nothing thing in WPF and I was pretty frustrated myself when I came to this conclusion.

    If your writing your own custom control however you can make it more flexible why composing or offering the ability to template pices of the control. For an example you can look at the newer WPF DataGrid control which has the ability to template different pieces of the control. Other headered content controls often have a separate template for the content and the header portion of the control making it possible to replace one but not the other.

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

Sidebar

Related Questions

Hello guys can anyone help me with the issue im having with installation of
Hello guys I'm looking for a way on the iPhone to parse an XML
Hello guys first of all apologize for asking such a simple and yet redundant
Hello can anybody solve this please I'm creating the object in the action class
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello guys I have the following method: var usuario; usuario = UniapontaService.GetUsuarioUniapontaPlanejamentoEstrategico(x => x.IdUsuario
Hello guys. I think it isn't possible just using PHP, but just to be
Hello guys I think the question i asked in the previous post is unclear
Hello guys I am having some problems with exact matches while doing a NamedQuery.
Hello guys I have a function inside a utility class which returns the current

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.