Files
NativeScript/tests/app/ui/lifecycle/pages/button-counter.ts
Panayot Cankov 014e7a8e0f add profile for functions, profile CSS-es on startup, use __time (#4227)
Call native setters once when a page is instantiated.

Fix background not being reset, Label's background is now set to background, not layer

Make the nativeView field instead of property for performance reasons
2017-06-08 09:51:09 +03:00

23 lines
802 B
TypeScript

import * as button from "tns-core-modules/ui/button";
import * as view from "tns-core-modules/ui/core/view";
export class Button extends button.Button {
nativeBackgroundRedraws = 0;
backgroundInternalSetNativeCount = 0;
fontInternalSetNativeCount = 0;
[view.backgroundInternalProperty.setNative](value) {
this.backgroundInternalSetNativeCount++;
return super[view.backgroundInternalProperty.setNative](value);
}
[view.fontInternalProperty.setNative](value) {
this.fontInternalSetNativeCount++;
return super[view.fontInternalProperty.setNative](value);
}
_redrawNativeBackground(value: any): void {
this.nativeBackgroundRedraws++;
super._redrawNativeBackground(value);
}
}
Button.prototype.recycleNativeView = false;