David Smith

David Smith

  • NA
  • 2k
  • 0

WPF Boolean Logic

Jun 8 2015 3:08 AM
I have 4 Color Phase which are boolean fields in the WPF Xaml Datasource. I am trying to come up with logic to determine when a user has click a colorphase in the xaml datagrid. Review the grid below. if a user enables any color phase to true, set or disable all other color phases to false. There can only be one enable true value per color phase, there only 4 max color phases allowed.
 
User enable red color phase 1 to true, automatically the blue, green, and yellow color was disable to false.
 
 
ColorId Color ColorPath ColorPhase1 ColorPhase2 ColorPhase3 ColorPhase4
1 Red RedPath TRUE TRUE FALSE FALSE
2 Blue BluePath FALSE FALSE TRUE TRUE
2 Green GreenPath FALSE FALSE FALSE FALSE
4 Yellow YellowPath FALSE FALSE FALSE FALSE