Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. CheckBox MultiBindings

CheckBox MultiBindings

Scheduled Pinned Locked Moved WCF and WF
wpfquestioncsharpphpwcf
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jammer 0
    wrote on last edited by
    #1

    Hey All, I have a question about MultiBinding on multiple check boxes that I can't seem to figure out. For argument sake lets say I have three checkboxes in a group. Two of which could be described as children of the master checkbox. There are in turn three boolean properties on the datacontext object that need to be kept up to date with the contents of all three checkboxes. The master checkbox has a multibinding set to the two child checkboxes so if either is checked the master becomes checked and if the master is checked the two children become checked ... What I can't figure out is how to keep the 'master' property for the master checkbox updated with the master checkbox IsChecked value. This is easy if you start roaming into C# land but I want to do this purely in XAML ... The code I have is like this at the moment:

    <CheckBox Margin="5"
    Style="{DynamicResource BlackTextOnLeft}"
    Width="325">chkBox1
    <CheckBox.IsChecked>
    <MultiBinding Converter="{StaticResource masterConfigCheckBoxConverter}">
    <Binding Path="IsChecked" ElementName="chkBox2" Mode="TwoWay" />
    <Binding Path="IsChecked" ElementName="chkBox3" Mode="TwoWay" />
    </MultiBinding>
    </CheckBox.IsChecked>
    <CheckBox>

    Any pointers would be great ... Cheers,

    Jammer My Blog | Articles | DMon | SampleSort

    B 1 Reply Last reply
    0
    • J Jammer 0

      Hey All, I have a question about MultiBinding on multiple check boxes that I can't seem to figure out. For argument sake lets say I have three checkboxes in a group. Two of which could be described as children of the master checkbox. There are in turn three boolean properties on the datacontext object that need to be kept up to date with the contents of all three checkboxes. The master checkbox has a multibinding set to the two child checkboxes so if either is checked the master becomes checked and if the master is checked the two children become checked ... What I can't figure out is how to keep the 'master' property for the master checkbox updated with the master checkbox IsChecked value. This is easy if you start roaming into C# land but I want to do this purely in XAML ... The code I have is like this at the moment:

      <CheckBox Margin="5"
      Style="{DynamicResource BlackTextOnLeft}"
      Width="325">chkBox1
      <CheckBox.IsChecked>
      <MultiBinding Converter="{StaticResource masterConfigCheckBoxConverter}">
      <Binding Path="IsChecked" ElementName="chkBox2" Mode="TwoWay" />
      <Binding Path="IsChecked" ElementName="chkBox3" Mode="TwoWay" />
      </MultiBinding>
      </CheckBox.IsChecked>
      <CheckBox>

      Any pointers would be great ... Cheers,

      Jammer My Blog | Articles | DMon | SampleSort

      B Offline
      B Offline
      BechBej
      wrote on last edited by
      #2

      You suggested that this must be done through xaml then try this [code] [/code]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups