Button textWrap implemented

This commit is contained in:
Vladimir Enchev
2015-11-02 11:11:25 +02:00
parent a3601b06cd
commit 0f3732d73f
8 changed files with 71 additions and 1 deletions

View File

@@ -37,6 +37,12 @@ export class Button extends view.View implements definition.Button {
public static textProperty = textProperty;
public static formattedTextProperty = formattedTextProperty;
public static textWrapProperty = new dependencyObservable.Property(
"textWrap",
"Button",
new proxy.PropertyMetadata(false, dependencyObservable.PropertyMetadataSettings.AffectsLayout)
);
public _onBindingContextChanged(oldValue: any, newValue: any) {
super._onBindingContextChanged(oldValue, newValue);
if (this.formattedText) {
@@ -68,6 +74,13 @@ export class Button extends view.View implements definition.Button {
}
}
get textWrap(): boolean {
return this._getValue(Button.textWrapProperty);
}
set textWrap(value: boolean) {
this._setValue(Button.textWrapProperty, value);
}
private onFormattedTextChanged(eventData: observable.PropertyChangeData) {
this.setFormattedTextPropertyToNative(eventData.value);
}