@@ -65,12 +65,12 @@ public bool HasTextFilter
65
65
public static readonly DependencyProperty HasTextFilterProperty = DependencyProperty . Register (
66
66
"HasTextFilter" , typeof ( bool ) , typeof ( MultipleChoiceFilter ) , new PropertyMetadata ( default ( bool ) ) ) ;
67
67
68
- private IEnumerable < string ? > ? SourceValues => ( IEnumerable < string ? > ? ) GetValue ( SourceValuesProperty ) ;
68
+ private IReadOnlyCollection < string ? > ? SourceValues => ( IReadOnlyCollection < string ? > ? ) GetValue ( SourceValuesProperty ) ;
69
69
70
70
private static readonly DependencyProperty SourceValuesProperty =
71
- DependencyProperty . Register ( "SourceValues" , typeof ( IList < string > ) , typeof ( MultipleChoiceFilter ) , new FrameworkPropertyMetadata ( null , ( sender , e ) => ( ( MultipleChoiceFilter ) sender ) . SourceValues_Changed ( ( IList < string > ) e . NewValue ) ) ) ;
71
+ DependencyProperty . Register ( "SourceValues" , typeof ( IReadOnlyCollection < string > ) , typeof ( MultipleChoiceFilter ) , new FrameworkPropertyMetadata ( null , ( sender , e ) => ( ( MultipleChoiceFilter ) sender ) . SourceValues_Changed ( ( IReadOnlyCollection < string > ) e . NewValue ) ) ) ;
72
72
73
- private void SourceValues_Changed ( IEnumerable < string ? > ? newValue )
73
+ private void SourceValues_Changed ( IReadOnlyCollection < string ? > ? newValue )
74
74
{
75
75
OnSourceValuesChanged ( newValue ) ;
76
76
}
@@ -197,12 +197,12 @@ protected virtual MultipleChoiceContentFilter CreateFilter(IEnumerable<string?>?
197
197
/// Called when the source values have changed.
198
198
/// </summary>
199
199
/// <param name="newValue">The new value.</param>
200
- protected virtual void OnSourceValuesChanged ( IEnumerable < string ? > ? newValue )
200
+ protected virtual void OnSourceValuesChanged ( IReadOnlyCollection < string ? > ? newValue )
201
201
{
202
202
var values = Values ;
203
203
var filterRegex = Filter ? . Regex ;
204
204
205
- if ( newValue == null )
205
+ if ( newValue == null || ! newValue . Any ( ) )
206
206
{
207
207
values . Clear ( ) ;
208
208
}
0 commit comments