@@ -9,6 +9,7 @@ import { Color } from "color";
9
9
import { Label } from "ui/label" ;
10
10
import { Button } from "ui/button" ;
11
11
import { StackLayout } from "ui/layouts/stack-layout" ;
12
+ import { Observable } from "data/observable" ;
12
13
13
14
14
15
declare var CGRectMake : any , CGPointMake : any ;
@@ -23,7 +24,7 @@ export class CheckBox extends Button implements CheckBoxInterface {
23
24
private _hideBox : boolean ;
24
25
private _boxType : number ;
25
26
private _tint : string ;
26
- private _checkBoxBackgroundColor :string ;
27
+ private _checkBoxBackgroundColor : string ;
27
28
private _onCheckColor : string ;
28
29
private _animationDuration : number ;
29
30
private _onAnimationType : number ;
@@ -51,7 +52,7 @@ export class CheckBox extends Button implements CheckBoxInterface {
51
52
this . _setValue ( CheckBox . checkedProperty , value ) ;
52
53
}
53
54
54
- set checkBoxBackgroundColor ( color :string ) {
55
+ set checkBoxBackgroundColor ( color : string ) {
55
56
( < any > this . _iosCheckbox ) . backgroundColor = new Color ( color ) . ios ;
56
57
this . _checkBoxBackgroundColor = color ;
57
58
}
@@ -223,6 +224,14 @@ export class CheckBox extends Button implements CheckBoxInterface {
223
224
public _onCheckedPropertyChanged ( data : PropertyChangeData ) {
224
225
if ( this . _iosCheckbox ) {
225
226
this . _iosCheckbox . setOnAnimated ( data . newValue , true ) ;
227
+ let _old = data . oldValue ;
228
+ let _new = data . newValue ;
229
+ let obj = new Observable ( {
230
+ view : this ,
231
+ oldValue : _old ,
232
+ newValue : _new
233
+ } ) ;
234
+ this . notify ( { eventName : "checkedChanged" , object : obj } ) ;
226
235
}
227
236
}
228
237
}
@@ -258,12 +267,6 @@ class BEMCheckBoxDelegateImpl extends NSObject implements BEMCheckBoxDelegate {
258
267
public didTapCheckBox ( checkBox : BEMCheckBox ) : void {
259
268
let owner = this . _owner . get ( ) ;
260
269
if ( owner ) {
261
- var eventData = {
262
- eventName : "tap" ,
263
- object : owner
264
- } ;
265
-
266
- owner . notify ( eventData ) ;
267
270
owner . _onPropertyChangedFromNative ( CheckBox . checkedProperty , checkBox . on ) ;
268
271
}
269
272
}
0 commit comments