mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Rename the files
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<tc:TemplateView id="template-view" xmlns:tc="xml-declaration/template-builder-tests/template-view">
|
||||
<tc:TemplateView.template>
|
||||
<tc:TemplateView text="Click!" test="test" />
|
||||
</tc:TemplateView.template>
|
||||
</tc:TemplateView>
|
||||
@@ -0,0 +1,2 @@
|
||||
// Our unit test will set this function and expect it to be set as a handler on a View in the XML.
|
||||
export var test: (args: any) => void;
|
||||
@@ -0,0 +1,4 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
|
||||
xmlns:fragment="xml-declaration/template-builder-tests">
|
||||
<fragment:event-in-codeless-fragment-the-fragment />
|
||||
</Page>
|
||||
@@ -0,0 +1,2 @@
|
||||
// Our unit test will set this function and expect it to be set as a handler on a View in the XML.
|
||||
export var test: (args: any) => void;
|
||||
@@ -0,0 +1,8 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
|
||||
xmlns:tc="xml-declaration/template-builder-tests/template-view">
|
||||
<tc:TemplateView id="template-view">
|
||||
<tc:TemplateView.template>
|
||||
<tc:TemplateView text="Click!" test="test" />
|
||||
</tc:TemplateView.template>
|
||||
</tc:TemplateView>
|
||||
</Page>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
|
||||
xmlns:tc="xml-declaration/template-builder-tests/template-view">
|
||||
<tc:TemplateView id="template-view">
|
||||
<tc:TemplateView.template>
|
||||
<Button text="Click!" />
|
||||
</tc:TemplateView.template>
|
||||
</tc:TemplateView>
|
||||
</Page>
|
||||
@@ -0,0 +1,35 @@
|
||||
import {Template} from "ui/core/view"
|
||||
import {Property, PropertyMetadataSettings} from "ui/core/dependency-observable"
|
||||
import * as proxy from "ui/core/proxy"
|
||||
import { LayoutBase } from "ui/layouts/layout-base"
|
||||
import { parse } from "ui/builder"
|
||||
|
||||
export module knownTemplates {
|
||||
export var template = "template";
|
||||
}
|
||||
|
||||
export class TemplateView extends LayoutBase {
|
||||
public static templateProperty = new Property(
|
||||
"template",
|
||||
"TemplateView",
|
||||
new proxy.PropertyMetadata(
|
||||
undefined,
|
||||
PropertyMetadataSettings.AffectsLayout,
|
||||
null
|
||||
)
|
||||
);
|
||||
|
||||
public static testEvent: string = "test";
|
||||
|
||||
get template(): string | Template {
|
||||
return this._getValue(TemplateView.templateProperty);
|
||||
}
|
||||
|
||||
set template(value: string | Template) {
|
||||
this._setValue(TemplateView.templateProperty, value);
|
||||
}
|
||||
|
||||
public parseTemplate() {
|
||||
this.addChild(parse(this.template));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user