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

The Archive Base Latest Questions

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

I am extending the WPF Calendar control, and I have copied the control templates

  • 0

I am extending the WPF Calendar control, and I have copied the control templates for the Calendar, CalendarItem, CalendarButton, and CalendarDayButton to the Generic.xaml of my custom control. The TargetType for the Calendar control template is my custom control, FsCalendar:

<!-- Calendar Control Template -->
<Style TargetType="{x:Type local:FsCalendar}">
...
</Style>

But what about the other control templates? Do I leave them targeted at the original Calendar, like this?

<!-- CalendarDayButton Control Template -->
<Style TargetType="CalendarDayButton">
...
</Style>

Or do I target it to my custom control? If so, how would I do that?

I tried putting my namespace (local) in the declaration, but that didn’t work. So, as it stands, the TargetType is set to the default System.Windows.Controls.Primitives namespace.

Thanks for your help.

  • 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-16T10:06:26+00:00Added an answer on May 16, 2026 at 10:06 am

    If you’re still using the same objects from the original, i.e. haven’t created a new FsCalendarDayButton, you just need the original TargetTypes exactly as you copied them.

    If you want to change the templates for them whenever they’re used in your FsCalendar you can either add x:Key to each of them and then add StaticResource references on each usage (might not be practical if they’re nested or auto-generated instances) in your FsCalendar template or leave them as implicitly typed with just a TargetType and move them into the Resources of your Style or ControlTemplate so they’ll get pulled along whenever that Style is loaded.

    If you aren’t modifying those controls then you don’t need the copies of their Styles at all – the defaults will be picked up when you use the controls, just like a Button or ComboBox.

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

Sidebar

Related Questions

I'm extending the available WPF's T reeView control. I wish to add to it
I have a custom class that extends the in built WPF Canvas called VisualCanvas
Background I have a custom control that inherits from a TreeView and is modified
When extending with doLayout you can only have one sub-template, but you can include
We have a set of VS 2008 packages which leverages custom Project/Item templates, designers
I am extending the WPF textbox in order to place a custom image on
Hey, i'm extending some WPF controls, and need to implement some custom events. I've
I am creating a custom control derived from the one of the Standard WPF
I have tried to play with the new WPF Ribbon control available in the
I have a ModalPopupExtender extending a panel and in the panel, there is a

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.