How do I create a property of type FilteredBindingList in a base form, so that inherited forms can reference and set that property?
Sorry, I know this is not very specific to CSLA.
Thanks,
Andrew
That may be a little tricky, because Windows Forms doesn't like generics very much, and FilteredBindingList is a generic type.
private FilteredBindingList<????> _myProperty;
public FilteredBindingList<????> MyProperty
{
get { return _myProperty; }
set { _myProperty = value; }
}
Obviously the trick is the "???". Normally this would be something like T, where T is a generic type provided to the containing class. But you can't make a Form generic or Windows Forms will have trouble.
So you'll probably need to use the non-generic IBindingList interface:
private IBindingList _myProperty;
public IBindingList MyProperty
{
get { return _myProperty; }
set { _myProperty = value; }
}
And then cast the property value to something more specific when you want to use it.
Rocky,
Thank you sir, that worked. My next issue is how to use the non-generic IReadOnlyObject for ChartFieldInfo so that:
Dim filteredList As New Csla.FilteredBindingList(Of ChartFieldInfo)(_BOReadOnlyList)
becomes
Dim filteredList As New Csla.FilteredBindingList(Of BOReadOnlyInfo)(_BOReadOnlyList)
I tried this unsuccessfully:
Private _BOReadOnlyInfo As Csla.Core.IReadOnlyObject Protected Property BOReadOnlyInfo() As Csla.Core.IReadOnlyObject Get Return _BOReadOnlyInfo End Get Set(ByVal value As Csla.Core.IReadOnlyObject)_BOReadOnlyInfo = value
End Set End Property
By the way, in the above:
Private
_BOReadOnlyList As Csla.Core.IReadOnlyCollectionworks.
Thanks a million.
Andrew
Copyright (c) Marimer LLC