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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:06:22+00:00 2026-06-14T18:06:22+00:00

I have the same options in different WPF dialog. One option that depends on

  • 0

I have the same options in different WPF dialog. One option that depends on another. If I click on the first, I also want to check the second. Both options correspond to the private bool variable in different classes. What is the best solution for this problem?

  • 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-14T18:06:23+00:00Added an answer on June 14, 2026 at 6:06 pm

    You could do that in WPF/XAML with Style.Triggers. For example the following code is an example on how to bind a textblock control’s IsEnabled status based on the status of a checkbox (checked/unchecked)

    <TextBlock Text="mytextblockText: ">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsChecked,ElementName=myCheckbox}" Value="False">
                                        <Setter Property="IsEnabled" Value="True"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding IsChecked, ElementName=myCheckbox}" Value="True">
                                        <Setter Property="IsEnabled" Value="False"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>                            
                    </TextBlock>
    

    For a checkbox being checked when another checkbox is checked, it looks like this (I guess)

    <CheckBox>
                <CheckBox.Style>
                    <Style TargetType="CheckBox">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsChecked,ElementName=myCheckbox}" Value="False">
                                <Setter Property="IsChecked" Value="True"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsChecked, ElementName=myCheckbox}" Value="True">
                                <Setter Property="IsChecked" Value="False"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </CheckBox.Style>                            
            </CheckBox>
    

    *edit
    can the properties in the classes be changed by something different than by those checkboxes? If yes, you could fire an event when the property is changed or directly manipulate the checkstate of the according box. Also, are the boxes dependent on each other? Or is just one dependent on the other (A <=> B or A => B)?

    For manipulating the properties when one of the boxe’s state is changed you could use the Checked/Unchecked events. Or use DependencyProperty as described in Pat’s answere over here

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

Sidebar

Related Questions

how can I copy the selected option between two s that have the same
I have a table on my site that contains the options for different products.
I have 4 different select boxes (to select one option from drop down). All
I have a select form with different options. I want to get the value
Is it possible to have same table name on different schema with different data
Is it possible to have same hashcode for different strings using java's hashcode function?or
I want to display some div's in a wrap. The div have same class
I have two windows in my WPF app: a login window and an options
Hi i have to create some multiselect element in zend with same options. i.e.
I have a set of data that I'd like to present via a WPF

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.