Feb 04, 2017, 8:41 PM
Initializing read only properties in a derived class' constructor?
How come the following code can set a read only property "Reader":
I am hoping to code all of my UI classes through a simple subclassing of the most fitting class but it seems the config property visibilities are not the same there and some properties are not able to be set...
Thanks
new ext.Store()
{
ID = "store",
Proxy =
{
new ext.RestProxy()
{
Url = "/infohubuser",
Reader = {
new ext.JsonReader()
{
RootProperty="data",
//SuccessProperty = "success",
MessageProperty = "message"
}
},
Writer =
{
new ext.JsonWriter()
{
//Encode = true,
//RootProperty="data"
AllowSingle = true
}
},
}
},
But I can't seem to set it in a derived class constructor as such: public class InfoHubUserProxy : AjaxProxy
{
public InfoHubUserProxy(): base()
{
Url = "/infohubuser";
Reader = ...
}
}
And how come the API property of RestProxy is not available to set in the first code block?I am hoping to code all of my UI classes through a simple subclassing of the most fitting class but it seems the config property visibilities are not the same there and some properties are not able to be set...
Thanks