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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:35:53+00:00 2026-05-10T23:35:53+00:00

I have a custom template for an expander that is close to the code

  • 0

I have a custom template for an expander that is close to the code below. I had to change some of the code to take out custom classes, brushes, etc..

<Style TargetType='{x:Type Expander}'>   <Setter Property='HorizontalContentAlignment'           Value='Stretch' />   <Setter Property='VerticalContentAlignment'           Value='Top' />   <Setter Property='BorderBrush'           Value='Transparent' />   <Setter Property='FontFamily'           Value='Tahoma' />   <Setter Property='FontSize'           Value='12' />   <Setter Property='Foreground'           Value='Black' />   <Setter Property='BorderThickness'           Value='1' />   <Setter Property='Margin'           Value='2,0,0,0' />   <Setter Property='Template'>     <Setter.Value>       <ControlTemplate TargetType='{x:Type Expander}'>         <Border x:Name='Border'                 SnapsToDevicePixels='true'                 Background='White'                 BorderBrush='{TemplateBinding BorderBrush}'                 BorderThickness='{TemplateBinding BorderThickness}'                 Margin='0,0,0,10'                 Padding='0'                 CornerRadius='8'>           <DockPanel>             <Border x:Name='HeaderSite'                     Background='Blue'                     CornerRadius='8'                     Height='32'                     DockPanel.Dock='Top'>               <DockPanel>                 <ToggleButton Foreground='White'                               HorizontalContentAlignment='{TemplateBinding HorizontalContentAlignment}'                               VerticalContentAlignment='{TemplateBinding VerticalContentAlignment}'                               Margin='0'                               MinHeight='0'                               MinWidth='0'                               Padding='6,2,6,2'                               IsChecked='{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}'                               DockPanel.Dock='Left'>                 </ToggleButton>                                  <ContentPresenter SnapsToDevicePixels='True'                                   HorizontalAlignment='Left'                                   Margin='4,0,0,0'                                   ContentSource='Header'                                   VerticalAlignment='Center'                                   RecognizesAccessKey='True' />               </DockPanel>             </Border>             <Border x:Name='InnerBorder'                     Margin='0' >               <ContentPresenter Focusable='false'                                 Visibility='Collapsed'                                 HorizontalAlignment='{TemplateBinding HorizontalContentAlignment}'                                 Margin='{TemplateBinding Padding}'                                 x:Name='ExpandSite'                                 VerticalAlignment='{TemplateBinding VerticalContentAlignment}'                                 DockPanel.Dock='Bottom' />             </Border>           </DockPanel>         </Border>         <ControlTemplate.Triggers>           <Trigger Property='IsExpanded'                    Value='true'>             <Setter Property='Margin'                     TargetName='InnerBorder'                     Value='5' />                        <Setter Property='Visibility'                     TargetName='ExpandSite'                     Value='Visible' />           </Trigger>           <Trigger Property='IsEnabled'                    Value='false'>             <Setter Property='Foreground'                     Value='{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}' />           </Trigger>                  </ControlTemplate.Triggers>       </ControlTemplate>     </Setter.Value>   </Setter> </Style> 

As you can see there are two ContentPresenters. I would like the first one to use Tahoma Bold as the font instead of the default Tahoma. How can I do this?

  • 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. 2026-05-10T23:35:53+00:00Added an answer on May 10, 2026 at 11:35 pm

    You need to use the FontWeight property to specify a bold font. However, you’ve probably noticed that ContentPresenter doesn’t have that property. So you’ll need to use the TextBlock.FontWeight attached property to tell the ContentPresenter that any text inside it should be bold.

    Try this:

    <ContentPresenter TextBlock.FontFamily='Tahoma'                   TextBlock.FontWeight='Bold'                   SnapsToDevicePixels='True'                   HorizontalAlignment='Left'                   Margin='4,0,0,0'                   ContentSource='Header'                   VerticalAlignment='Center'                   RecognizesAccessKey='True' /> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 52k
  • Answers 52k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer If you just want to redirect www.example.com: <if header='HTTP_HOST' match='www.example.com'>… May 11, 2026 at 6:37 am
  • added an answer In XSLT 1.0 the upper-case() and lower-case() functions are not… May 11, 2026 at 6:37 am
  • added an answer There are two WPF books on 3D that I have… May 11, 2026 at 6:37 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.