var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "../../../core/AtomBridge", "../../controls/AtomXFControl", "./MovieListViewModel", "./TitlePage"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var AtomBridge_1 = require("../../../core/AtomBridge");
    var AtomXFControl_1 = require("../../controls/AtomXFControl");
    var MovieListViewModel_1 = require("./MovieListViewModel");
    var TitlePage_1 = require("./TitlePage");
    var MovieList = /** @class */ (function (_super) {
        __extends(MovieList, _super);
        function MovieList(app, e) {
            return _super.call(this, app, e || AtomBridge_1.AtomBridge.instance.create("Xamarin.Forms.ContentPage")) || this;
        }
        MovieList.prototype.create = function () {
            var _this = this;
            this.setImport(this.element, "TitlePage", function () { return new TitlePage_1.default(_this.app); });
            this.loadXaml("<ContentPage\n        xmlns:atom=\"clr-namespace:WebAtoms;assembly=WebAtoms\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n        xmlns=\"http://xamarin.com/schemas/2014/forms\">\n    <Grid>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"Auto\"/>\n            <RowDefinition/>\n        </Grid.RowDefinitions>\n        <atom:JSObjectCreator\n            Type=\"TitlePage\"/>\n        <ListView\n            Grid.Row=\"1\"\n            x:Name=\"listView\"></ListView>\n    </Grid>\n</ContentPage>");
            this.viewModel = this.resolve(MovieListViewModel_1.default);
            var label1 = this.find("listView");
            this.bind(label1, "ItemsSource", [["viewModel", "list"]]);
            this.setTemplate(label1, "ItemTemplate", function () { return new MovieListItemTemplate(_this.app); });
        };
        return MovieList;
    }(AtomXFControl_1.AtomXFControl));
    exports.default = MovieList;
    var MovieListItemTemplate = /** @class */ (function (_super) {
        __extends(MovieListItemTemplate, _super);
        function MovieListItemTemplate(app, e) {
            return _super.call(this, app, AtomBridge_1.AtomBridge.instance.create("Xamarin.Forms.Grid")) || this;
        }
        MovieListItemTemplate.prototype.create = function () {
            this.loadXaml("<Grid\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n        xmlns=\"http://xamarin.com/schemas/2014/forms\">\n            <Label x:Name=\"label1\"/>\n        </Grid>");
            var label = this.find("label1");
            this.bind(label, "Text", [["data", "label"]]);
        };
        return MovieListItemTemplate;
    }(AtomXFControl_1.AtomXFControl));
});
//# sourceMappingURL=MovieList.js.map