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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:36:05+00:00 2026-05-31T04:36:05+00:00

I have a class derived from slider which uses a custom control template and

  • 0

I have a class derived from slider which uses a custom control template and has a few added dependency properties. I would like to fire triggers within the template based on the new properties.

For example, I have a new dependency property called ThumbIsVisible which when set to false I want just the thumb portion of my slider to be hiddin. My control template looks like:

<Slider.Template>
<ControlTemplate TargetType="{x:Type Slider}">
...
<Track.Thumb>
<Thumb x:Name="m_Thumb" Style="{StaticResource SliderThumbStyle}" />
...

I would like to add in a trigger that looks like:

<ControlTempate.Trigger>
<Trigger Property="ThumbIsVisible" Value="False">
<Setter TargetName="m_Thumb" Property="Visibility" Value="Collapsed" />

Right off the bat I can see this won’t work as I have the control tempate’s target type set to Slider. However, if I change that to say:

<ControlTemplate TargetType="{x:Type local:myCustomSlider}">

then I run into problems with the template type differing from the controls. The only way around this is to create the xaml using the local:myCustomSlider as the type instead of Slider. However, doing this causes lots of problems with VisualStudio’s designer and code behind.

Does anyone know if there is a standard way to get around all of this? As a workaround I tried adding to the template’s triggers via code-behind but have not been able to get that to work.

  • 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-31T04:36:06+00:00Added an answer on May 31, 2026 at 4:36 am

    It looks like there is an even simpler way to solve this problem.

    <ControlTemplate.Triggers>   
      <Trigger Property=local:CustomSlider.ThumbIsVisible" Value="False">     
        <Setter TargetName="m_Thumb" Property="Visibility" Value="Hidden" />
      </Trigger> 
    </ControlTemplate.Triggers> 
    

    where local is the namespace of the CustomSlider class.

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

Sidebar

Related Questions

I have a class derived from TreeviewItem(Custom TreeViewItem) which is used by a class
I have a class derived from base class which has a private field. How
I have a class which is derived from a base class, and have many
I have a class, say DerivedBindingList<T> , which is derived from BindingList<T> . I
I have a class derived from QGraphicsView , which contains QGraphicsItem -derived elements. I
I have a class TChild derived from TParent. TParent has a property MyProp that
I have a class derived from JTree with custom TreeCellRenderers. I have implemented drag
I have a class Derived<T> that is derived from Base<T> . Which of the
I have DataAccess class which is derived from DataAccessor. DataAccessor class is the DB
I have created a loading scene separate class derived from CCScene which I can

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.