mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Button textWrap implemented
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user