I have a problem displaying graphs that are filtered when I select ComboBoxwithout blocking the user interface. Statistical filtering is quite heavy and should start async. This works fine until I try to call FilterStatisticsAsyncand MonthSelectionChangedfrom the property setting tool. Does anyone have any good advice on how to solve or get around this?
XAML is as follows:
<ComboBox x:Name="cmbMonth"
ItemsSource="{Binding Months}"
SelectedItem="{Binding SelectedMonth }"
IsEditable="True"
IsReadOnly="True"
And the set ViewModel property looks like this:
public string SelectedMonth
{
get { return _selectedMonth; }
set { SetProperty(ref _selectedMonth, value); LoadStatisticsAsync(); MonthSelectionChanged(); }
}
SetProperty comes from a base class that encapsulates INPC as follows:
public event PropertyChangedEventHandler PropertyChanged = delegate { };
protected virtual void SetProperty<T>(ref T member, T value, [CallerMemberName] string propertyName = null)
{
if (Equals(member, value))
return;
member = value;
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
source
share