Mapping F # to DataGridColumn.Visibility

I am faced with a situation where I use pattern matching to determine the visibility property of a column. System.Windows.Visibilityhas two fields: Visibility.Visibleand Visibility.Collapsed. Can enyone tell me why the following code:

let colItem = myDataGrid.Columns.Item 1
     chkBox.IsChecked <-
          match colItem.Visibility with
               | Visibility.Visible -> new Nullable<bool>(true)
               | Visibility.Collapsed -> new Nullable<bool>(false)

generates the following warning:

Incomplete expression pattern matches. For example, the value “2uy” may indicate an unreviewed case by pattern (s).

+5
source share
1 answer

- , , .net ( , ORing).

+7

All Articles