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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:18:09+00:00 2026-06-19T01:18:09+00:00

I have written a custom control. I currently have several control templates that all

  • 0

I have written a custom control. I currently have several control templates that all duplicate a lot of triggers for showing/hiding stuff etc. I am trying to move some of this functionality into the control itself to tidy up the templates a bit, and have been reading up on control parts, and the visual state manager.

Currently the control exposes a property eg IsExtraInfoShown. The control templates all have their own triggers on this property to show/hide the appropriate areas.

After reading about control parts, this seems to fit perfectly. All the templates have a named PART_ExtraInfo, and the control shows/hides this as appropriate.

But then I read about the visual state manager, which seems to infer I should create an ExtraInfoVisibility group, and have InfoShown and InfoHidden states that the templates can define, and editors like Blend can operate on.

Which should I use? Or is possible to use both? Ie, I hide/show PART_ExtraInfo if it’s there, and if not I GotoState()?

  • 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-06-19T01:18:11+00:00Added an answer on June 19, 2026 at 1:18 am

    It appears that when using the VisualStateManager it is assumed that your also following the parts and states model. In this case the name really says it all. If that’s not enough, use of defined parts along with states by tutorials on the web regarding the VisualStateManger hits it home that the not only are parts still relevant when using states but they become even more useful since they specify the elements that will be used by the control in order to determine state. See Parts & States model with VisualStateManager (part 3 of 4) for more details on how.

    In terms of the overlap between traditional ways of setting visual state such as with triggers or code within event handlers and the parts and states model, the advice seems to be that once you use states to manage the visual concepts defined within the state groups that you should refrain from using triggers or direct setting of code to manipulate these values otherwise.

    If you want a good read on the concerns about how to integrate the VisualStateManager in WPF along with existing techniques that we have become comfortable with I recommend reading over the pots The VisualStateManager and Triggers by Carole Snyder. That article has an interesting quote which helped me with some of the questions I’ve had regarding.

    Control authors should continue to define properties for visual states
    even when they use the VisualStateManager to transition between their
    visual states.

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

Sidebar

Related Questions

I have written a Custom Control that contains the following: [assembly: System.Web.UI.WebResource(InSysControls.AssignmentLists.AssignmentLists.js, text/javascript)] namespace
I have written a custom control that renders some graphics. The graphics itself is
I have a custom control that I have written that does some location checking
I have a custom control written in C# that I would like to port
I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
I have written a custom Windows Service that writes data to a custom Event
I have written a custom Silverlight control based on Control. I have two DependencyProperties
I have custom control written in Java. For the sake of simplicity lets assume
I have a custom UI control which has a JavaScript class written around the
hey there, i have written a custom control for my App so things get

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.