define(['scripts/knockout-3.3.0','scripts/ACTComponent.js'], function(ko, ACTComponent) {

    function SceneGraphComponentViewModel(params, element) {
		var self = this;
		self.base = new ACTComponent($(element), params);
		self.element = element;
		self.baseModel = params.baseModel;
		self.Resize = params.Model.Resize;
		
		self.base.onRefresh = function(obj) {
		}.bind(self);		
		
		self.resizeFunction = function(height,width) {
			this.resize(this.baseModel.getX(),this.baseModel.getY(),width, height);
		}.bind(self);
		
		self.base.addCallbackX(self, "resize", "Resize");
		params.baseModel.resizeFunctions[params.baseModel.resizeFunctions.length] = self.resizeFunction;
		params.ready(true);
    }

	return {
		createViewModel: function(params, componentInfo) {
            return new SceneGraphComponentViewModel(params, componentInfo.element);
        }
	};

});

