This Question explains how to implement interface properties in interfaces: Implementing interface properties in interfaces?
Now how do I implement a Setter with this? I'm getting "Cannot convert source type ..."
Is this the right way?
class WpfReportParams : IReportParams
{
private ObservableCollection<StatusEnum> _selectedStatuses;
public WpfReportParams()
{
_selectedStatuses = new ObservableCollection<StatusEnum>();
}
public IEnumerable<StatusEnum> SelectedStatuses
{
get { return _selectedStatuses; }
set
{
var collection = value as ObservableCollection<StatusEnum>;
if (collection != null)
{
_selectedStatuses = collection;
}
}
}
}