define(['scripts/knockout-3.3.0','scripts/jquery-2.1.1.min','scripts/act.js'], function(ko) {
    return function viewModel() {
        this.message = ko.observable("This is good!");
		this.properties = ko.observableArray([]);
		this.change = function() {
			ko.components.register("property-text", {
				viewModel: { require: 'mod/properties/propertytext' },
				template: '<div class="line"><div class="left text" data-bind="text: caption"></div><div class="middle"><input class="ui-widget jqx-rc-all" type="text" data-bind="value: value" style="width:100%;"></div></div>'
			});
			this.properties([
				{Component:"property-text", Caption:"My Prop 11", Value:"a"},
				{Component:"property-text", Caption:"My Prop 22", Value:"b"}]);
		}
		
		this.onMessage = function(obj) {
			var props = obj.Properties;
			this.properties(props);
		}.bind(this);
		
		var PropertyProvider = new ACTSocket("PropertyProvider");
		PropertyProvider.onmessage = this.onMessage;
		

    }
});
