55using System . Collections . Specialized ;
66using System . Collections . Generic ;
77using System . Linq ;
8+ using System . Collections . ObjectModel ;
89
910namespace NControl . Controls
1011{
@@ -15,15 +16,9 @@ public class WizardLayout: Grid
1516 {
1617 #region Private Members
1718
18- /// <summary>
19- /// The page.
20- /// </summary>
21- private readonly WizardStackLayout _contentStack ;
22-
23- /// <summary>
24- /// The pager.
25- /// </summary>
26- private readonly PagingView _pager ;
19+ readonly WizardStackLayout _contentStack ;
20+ readonly PagingView _pager ;
21+ readonly ObservableCollection < View > _pages = new ObservableCollection < View > ( ) ;
2722
2823 #endregion
2924
@@ -32,6 +27,8 @@ public class WizardLayout: Grid
3227 /// </summary>
3328 public WizardLayout ( )
3429 {
30+ _pages . CollectionChanged += PagesChanged ;
31+
3532 // Wrapping layout
3633 var layout = new RelativeLayout ( ) ;
3734 Children . Add ( layout ) ;
@@ -83,35 +80,14 @@ public int Page
8380 }
8481 }
8582
86- /// <summary>
87- /// The pages property.
88- /// </summary>
89- public static BindableProperty PagesProperty = BindableProperty . Create ( nameof ( Pages ) ,
90- typeof ( IEnumerable < View > ) , typeof ( WizardLayout ) , null , propertyChanged : ( bindable , oldValue , newValue ) => {
91- var ctrl = ( WizardLayout ) bindable ;
92- ctrl . Pages = ( IEnumerable < View > ) newValue ;
93- } ) ;
94-
9583 /// <summary>
9684 /// Gets or sets the pages.
9785 /// </summary>
9886 /// <value>The pages.</value>
99- public IEnumerable < View > Pages
100- {
101- get { return ( IEnumerable < View > ) GetValue ( PagesProperty ) ; }
102- set
103- {
104- if ( Pages != null && Pages is INotifyCollectionChanged )
105- ( Pages as INotifyCollectionChanged ) . CollectionChanged -= PagesChanged ;
106-
107- SetValue ( PagesProperty , value ) ;
108-
109- if ( Pages != null && Pages is INotifyCollectionChanged )
110- ( Pages as INotifyCollectionChanged ) . CollectionChanged += PagesChanged ;
111-
112- UpdatePages ( ) ;
113- }
114- }
87+ public IList < View > Pages
88+ {
89+ get { return _pages ; }
90+ }
11591
11692 #endregion
11793
0 commit comments