Suppose you have the following class:
class ProcessController
{
public List<Process> Active { get { ... } }
...
public List<Process> GetProcesses() { ... }
}
I can use GetMethodto bind a method ObjectDataProviderto a method GetProcesses():
<ObjectDataProvider x:Key="pList"
MethodName="GetProcesses"
ObjectType="{x:Type local:ProcessController}"/>
My question is, can I also be attached to a property Active?
If it turns out that I can do the following:
<ObjectDataProvider x:Key="pList"
MethodName="get_Active"
ObjectType="{x:Type local:ProcessController}"/>
But for some reason this does not seem right.
Is there a cleaner way or a “correct” way to access a property instead of calling a method?
source
share