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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:12:17+00:00 2026-05-26T16:12:17+00:00

I have to apply the same data trigger on multiple items. Data trigger is

  • 0

I have to apply the same data trigger on multiple items. Data trigger is

<Style>
    <Style.Triggers>
        <DataTrigger Binding="{Binding ElementName=someButton, Path=IsChecked}" Value="False">
            <Setter Property="UIElement.Visibility" Value="Collapsed" />
        </DataTrigger>
    </Style.Triggers>
</Style>

The issue is that I have to copy it for every label, text field, check box, button etc that I want to collapse/show, and this is one button, and the end layout is pretty complicated, with many buttons, so, is there a better way (something like class etc?)

Also the trigger is working perfectly with items such as buttons etc, but it is not working for any panels, dock panel, grid, canvas etc. Any ideas?

Using .NET 4.0, Visual Studio 2010 express.

  • 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-26T16:12:18+00:00Added an answer on May 26, 2026 at 4:12 pm

    I think the first question is why this is a DataTrigger in the first place. Using a BooleanToVisibilityConverter, you can bind Visibility directly to the IsChecked property.

    Beyond that, you can clean things up substantially by making IsChecked a two-way binding to a property on the viewmodel, like AreControlsVisible. Then all the other controls can simply have Visibility="{Binding AreControlsVisible…

    Another option is to make that style a resource, and apply it to all of the appropriate elements.

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

Sidebar

Related Questions

Example: I have two shared objects (same should apply to .dlls). The first shared
I have a style rule I want to apply to a tag when it
In SQL Server assuming one has columns that need to have the same data
I have multiple images taken simultaneously pointing at the same direction from the same
I currently have a data template I apply to cells to get them styled
I have been using the following CSS to apply an effect at the bottom
I have an idea and I want to apply it to my Application (C#
I have the following code to create and apply a few styles for a
if i have a function A,which can apply a certain rule on a given
I have some auto-instantiation code which I would like to apply to about 15

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.