Hello,
I'm trying to get a reference to objectInfo where objectInfo inherits from ReadOnlyBase. What I want to do is in my form, pass objectInfo to a method in another class that sets a filter.
I can successfully do this for objectReadOnlyList, where I have a property of type Csla.Core.IReadOnlyCollection, but I can't seem to use a property of type Csla.Core.IReadOnlyObject because:
FilteredBindingList(Of _objectInfo)(_objectReadOnlyList) complains that _objectInfo "Type _objectInfo is not defined"
Really would appreciate some help with this.
Thanks,
Andrew
Sorry, code reference is mis-leading. The _objectInfo is a property of type (object class) in my form. What I am trying to do is abstract a common method for filtering in my baseform, from which my forms are derived. I am expecting the inherited form to be able to set the property in the baseform and then the baseform execute the filter method - for any form.
Thanks,
Andrew
Thanks! This is what I was attempting:
What I was trying to do was create a common method like this in my baseclass:
Me.BOBindingSource.DataSource = New SortedBindingList(Of _ReadOnlyInfo)(_ReadOnlyList). I was hoping in my baseclass to have two properties for _ReadOnlyInfo and _ReadOnlyList and then set these from the calling form.
Part of this works. This is what I have in my baseform:
Private
WithEvents _ReadOnlyList As Core.IReadOnlyCollection Protected Property ReadOnlyList() As Csla.Core.IReadOnlyCollection Get Return _ReadOnlyList End Get Set(ByVal value As Csla.Core.IReadOnlyCollection)_ReadOnlyList = value
End Set End PropertyPrivate WithEvents _ReadOnlyInfo As Core.IReadOnlyObject Public Property ReadOnlyInfo() As Csla.Core.IReadOnlyObject Get Return _ReadOnlyInfo End Get Set(ByVal value As Csla.Core.IReadOnlyObject)
_ReadOnlyInfo = value
End Set End Property
Private WithEvents _BindingSource As BindingSource
Protected Property BindingSource() As BindingSource Get Return _BindingSource End Get Set(ByVal value As BindingSource)baseBindingNavigator.BindingSource = value
_BindingSource = value
...
End If End Set End Propertyand then in my form, I have:
Private WithEvents _ChartFieldInfo As ChartFieldInfo
Private ReadOnly Property ChartFieldInfo() As ChartFieldInfo Get Return _ChartFieldInfo End Get End Property Private WithEvents _ChartFieldList As ChartFieldList Public ReadOnly Property ChartFieldList() As ChartFieldList Get Return _ChartFieldList End Get End Property_ChartFieldList = ChartFieldList.GetChartFieldList()
Me.ChartFieldListBindingSource.DataSource = New SortedBindingList(Of ChartFieldInfo)(_ChartFieldList)MyBase.BindingSource = Me.ChartFieldListBindingSource
MyBase.ReadOnlyList = _ChartFieldListMyBase.ReadOnlyInfo = ChartFieldInfo
In the common method in my baseclass, I'd like to do something lik:
Me.BindingSource.DataSource = New SortedBindingList(Of _ReadOnlyInfo)(_ReadOnlyList)
Note from above, (code in red), I cannot pass _BOInfo (which I like to have as a reference to ChartFieldInfo) as a parm, as the object cannot be resolved.
Is something like this possible?
Thanks,
Andrew
Tried that - seems that the parm can't be a reference, of any type. VS complains that "Type 'xxx' is not defined."
Copyright (c) Marimer LLC