Private Sub Feature_Click(sender As Object, e As RoutedEventArgs)
Dim element As FrameworkElement = TryCast(sender, FrameworkElement)
Dim cb As CheckBox = TryCast(sender, CheckBox)
If element Is Nothing OrElse cb Is Nothing Then
Return
End If
Select Case element.Name
Case "RowEditing"
DirectCast(pivotGrid.DataSource, DataSourceBase).AreaFieldSettings.AllowRowsEditing = DirectCast(cb.IsChecked, [Boolean])
Exit Select
Case "ColumnsEditing"
DirectCast(pivotGrid.DataSource, DataSourceBase).AreaFieldSettings.AllowColumnsEditing = DirectCast(cb.IsChecked, [Boolean])
Exit Select
Case "FiltersEditing"
DirectCast(pivotGrid.DataSource, DataSourceBase).AreaFieldSettings.AllowFiltersEditing = DirectCast(cb.IsChecked, [Boolean])
Exit Select
Case "MeasuresEditing"
DirectCast(pivotGrid.DataSource, DataSourceBase).AreaFieldSettings.AllowMeasuresEditing = DirectCast(cb.IsChecked, [Boolean])
Exit Select
End Select
End Sub