@@ -24,16 +24,8 @@ namespace Tizen.Wearable.CircularUI.Forms
2424 /// The ContentPopup is a Popup, which allows you to customize the View to be displayed.
2525 /// </summary>
2626 /// <since_tizen> 4 </since_tizen>
27- public class ContentPopup : Element , IDisposable
27+ public class ContentPopup : Element
2828 {
29- IContentPopupRenderer _renderer ;
30-
31- /// <summary>
32- /// For internal use.
33- /// </summary>
34- [ EditorBrowsable ( EditorBrowsableState . Never ) ]
35- public static Func < IContentPopupRenderer > RendererFunc { get ; set ; } = null ;
36-
3729 /// <summary>
3830 /// BindableProperty. Identifies the Content bindable property.
3931 /// </summary>
@@ -44,13 +36,7 @@ public class ContentPopup : Element, IDisposable
4436 /// BindableProperty. Identifies the IsShow bindable property.
4537 /// </summary>
4638 /// <since_tizen> 4 </since_tizen>
47- public static readonly BindableProperty IsShowProperty = BindableProperty . Create ( nameof ( IsShow ) , typeof ( bool ) , typeof ( ContentPopup ) , false , propertyChanged : ( b , o , n ) => ( ( ContentPopup ) b ) . UpdateRenderer ( ) ) ;
48-
49- /// <summary>
50- /// Occurs when the device's back button is pressed.
51- /// </summary>
52- /// <since_tizen> 4 </since_tizen>
53- public event EventHandler BackButtonPressed ;
39+ public static readonly BindableProperty IsOpenProperty = BindableProperty . Create ( nameof ( IsOpen ) , typeof ( bool ) , typeof ( ContentPopup ) , false ) ;
5440
5541 /// <summary>
5642 /// Occurs when the popup is dismissed.
@@ -69,22 +55,13 @@ public View Content
6955 }
7056
7157 /// <summary>
72- /// Gets or sets the popup is shown.
73- /// </summary>
74- /// <since_tizen> 4 </since_tizen>
75- public bool IsShow
76- {
77- get { return ( bool ) GetValue ( IsShowProperty ) ; }
78- set { SetValue ( IsShowProperty , value ) ; }
79- }
80-
81- /// <summary>
82- /// Shows the popup.
58+ /// Gets or sets the popup is opened.
8359 /// </summary>
8460 /// <since_tizen> 4 </since_tizen>
85- public void Show ( )
61+ public bool IsOpen
8662 {
87- IsShow = true ;
63+ get { return ( bool ) GetValue ( IsOpenProperty ) ; }
64+ set { SetValue ( IsOpenProperty , value ) ; }
8865 }
8966
9067 /// <summary>
@@ -93,7 +70,7 @@ public void Show()
9370 /// <since_tizen> 4 </since_tizen>
9471 public void Dismiss ( )
9572 {
96- IsShow = false ;
73+ IsOpen = false ;
9774 }
9875
9976 /// <summary>
@@ -109,27 +86,18 @@ public void SendDismissed()
10986 /// For internal use.
11087 /// </summary>
11188 [ EditorBrowsable ( EditorBrowsableState . Never ) ]
112- public void SendBackButtonPressed ( )
89+ public bool SendBackButtonPressed ( )
11390 {
114- BackButtonPressed ? . Invoke ( this , EventArgs . Empty ) ;
91+ return OnBackButtonPressed ( ) ;
11592 }
11693
11794 /// <summary>
118- /// Dispose the popup .
95+ /// To change the default behavior of the BackButton. Default behavior is dismiss .
11996 /// </summary>
120- /// <since_tizen> 4 </since_tizen>
121- public void Dispose ( )
122- {
123- Dispose ( true ) ;
124- }
125-
126- protected virtual void Dispose ( bool disposing )
97+ /// <returns>Default is false</returns>
98+ protected virtual bool OnBackButtonPressed ( )
12799 {
128- if ( disposing && _renderer != null )
129- {
130- _renderer . Dispose ( ) ;
131- _renderer = null ;
132- }
100+ return false ;
133101 }
134102
135103 protected override void OnBindingContextChanged ( )
@@ -144,15 +112,5 @@ void UpdateContent()
144112 if ( Content != null )
145113 OnChildAdded ( Content ) ;
146114 }
147-
148- void UpdateRenderer ( )
149- {
150- if ( _renderer == null )
151- {
152- _renderer = RendererFunc ( ) ;
153- _renderer . SetElement ( this ) ;
154- }
155- }
156-
157115 }
158116}
0 commit comments