Skip to content

Commit 92c492b

Browse files
committed
Fix warnings
1 parent 8b7d93e commit 92c492b

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

src/DataGridExtensions/DataGridFilter.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,27 @@ public static void SetFilterEvaluationDelay(this DataGrid dataGrid, TimeSpan val
147147

148148
#region gesture
149149

150+
/// <summary>
151+
/// Gets the key gesture that moves the focus into the filter control.
152+
/// </summary>
153+
/// <param name="element">The data grid.</param>
154+
/// <returns>The gesture</returns>
150155
public static KeyGesture GetStartFilteringKeyGesture(DataGrid element)
151156
{
152157
return (KeyGesture)element.GetValue(StartFilteringKeyGestureProperty);
153158
}
159+
/// <summary>
160+
/// Sets the key gesture that moves the focus into the filter control.
161+
/// </summary>
162+
/// <param name="element">The data grid.</param>
163+
/// <param name="value">The gesture</param>
154164
public static void SetStartFilteringKeyGesture(DataGrid element, KeyGesture value)
155165
{
156166
element.SetValue(StartFilteringKeyGestureProperty, value);
157167
}
168+
/// <summary>
169+
/// Identifies the StartFilteringKeyGesture dependency property
170+
/// </summary>
158171
public static readonly DependencyProperty StartFilteringKeyGestureProperty = DependencyProperty.RegisterAttached(
159172
"StartFilteringKeyGesture", typeof(KeyGesture), typeof(DataGridFilter), new FrameworkPropertyMetadata(null, StartFilteringKeyGesture_Changed));
160173

src/DataGridExtensions/MultipleChoiceFilter.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ public MultipleChoiceContentFilter? Filter
5151
public static readonly DependencyProperty FilterProperty =
5252
DependencyProperty.Register("Filter", typeof(MultipleChoiceContentFilter), typeof(MultipleChoiceFilter), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (sender, _) => ((MultipleChoiceFilter)sender).Filter_Changed()));
5353

54+
/// <summary>
55+
/// Gets or sets a value that controls if the optional text filter is visible.
56+
/// </summary>
5457
public bool HasTextFilter
5558
{
5659
get => (bool)GetValue(HasTextFilterProperty);
5760
set => SetValue(HasTextFilterProperty, value);
5861
}
62+
/// <summary>
63+
/// Identifies the HasTextFilter dependency property.
64+
/// </summary>
5965
public static readonly DependencyProperty HasTextFilterProperty = DependencyProperty.Register(
6066
"HasTextFilter", typeof(bool), typeof(MultipleChoiceFilter), new PropertyMetadata(default(bool)));
6167

@@ -294,7 +300,7 @@ public MultipleChoiceContentFilter(IEnumerable<string?>? items, string? text = n
294300
// invalid user input, just go with a null expression.
295301
}
296302

297-
Items = items != null ? new HashSet<string?>(items.Where(item => Regex?.IsMatch(item) != false)) : null;
303+
Items = items != null ? new HashSet<string?>(items.Where(item => Regex?.IsMatch(item ?? string.Empty) != false)) : null;
298304
}
299305

300306
/// <summary>
@@ -324,7 +330,7 @@ public virtual bool IsMatch(object? value)
324330
var items = Items;
325331

326332
if (items == null)
327-
return Regex?.IsMatch(input) ?? true;
333+
return Regex?.IsMatch(input ?? string.Empty) ?? true;
328334

329335
if (string.IsNullOrWhiteSpace(input))
330336
return items.Contains(string.Empty);

0 commit comments

Comments
 (0)