BookWidget.Book.prototype = {
initialize: function () {
BookWidget.Book.callBaseMethod(this, 'initialize');
var BookObject = this.get_silverlightBookObject();
BookObject.onLoad = Function.createDelegate(this, this.pluginLoaded);
},
dispose: function () {
BookWidget.Book.callBaseMethod(this, 'dispose');
},
pluginLoaded: function (sender, args) {
var imagesArr = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_imagesCollection());
slCtl = sender.getHost();
for (var idx = 0; idx < imagesArr.length; idx++) {
slCtl.Content.mainPage.SetItem(imagesArr[idx]['Url']);
}
slCtl.Content.mainPage.SetBookProperties(Sys.Serialization.JavaScriptSerializer.deserialize(this.get_properties()));
},
get_imagesCollection: function () {
return this._imagesCollection;
},
set_imagesCollection: function (value) {
if (this._imagesCollection !== value) {
this._imagesCollection = value;
this.raisePropertyChanged('imagesCollection');
}
},
get_properties: function () {
return this._properties;
},
set_properties: function (value) {
if (this._properties !== value) {
this._properties = value;
this.raisePropertyChanged('properties');
}
},
get_silverlightBookObjectId: function () {
return this._silverlightBookObjectId;
},
set_silverlightBookObjectId: function (value) {
if (this._silverlightBookObjectId !== value) {
this._silverlightBookObjectId = value;
this.raisePropertyChanged('silverlightBookObjectId');
}
},
get_silverlightBookObject: function () {
return $get(this.get_silverlightBookObjectId());
}
}