Search code examples
silverlightmvvm

How can you bind 2 properties on checkbox on silverlight?


I want to use 2 properties on binding the value of checkbox when loading. This is what I have currently:

<CheckBox x:Name="chkIsAssigned" 
 IsChecked="{Binding IsAssigned, Mode=TwoWay}" 
 VerticalAlignment="Center" HorizontalAlignment="Center"
 Click="chkParticipantUser_ToggleCheck" />

I want to do something like IsChecked="{Binding Property1 Property2}"


Solution

  • MultiBinding is not supported in Silverlight, but there are some third-party attempts to implement it externally.

    In your case, looking simple enough, your best bet would be to create a property in the ViewModel combining the value of the two properties on get and setting the value to the two properties on set.