Tom's suggestion is the superior alternative, but if for some reason
you can't go with what he wrote, here is the problem with the code you
submitted:
object o = null;
// the line below is my problem
m_includeMerchantOwned = (bool)pi.GetValue(o, null);
The first argument to GetValue() is the object from which to fetch the
property value. To understand why this is so, you need to understand
what a PropertyInfo object contains. PropertyInfo does _not_ contain a
reference to the original this.Page that you used to get the property
info in the first place. All PropertyInfo does is contain information
about a particular property of a particular _class_, or, if you wish,
_any instance of a particular class_. This has to be so, if you think
about it, because you get PropertyInfo from a Type, not directly from
your object.
So, when you say GetValue, you have to say, "from where"? Or, more
precisely, "from what object"? The PropertyInfo knows about the class
and the property, but not about any object instance. You have to give
it that.
In your code, you don't even instantiate an object; you just create a
reference to an Object and make that reference null. Not only are you
passing no instance into GetValue (null), to add insult to injury,
you're passing in a reference of type Object, which doesn't implement
your interface and doesn't have the IncludeMerchantOwned property. No
wonder poor GetValue is unhappy!
You need to say this, instead:
// the line below is my problem
m_includeMerchantOwned = (bool)pi.GetValue(this.Page, null);
Now you're telling GetValue that you want to get the property value
from the object instance pointed to by the this.Page property, which
should work much better. :)