コード例 #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <NativeListView2> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                var scroller = new NSScrollView
                {
                    AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable,
                    DocumentView     = _nsTableView = new NSTableView().AsListViewLook()
                };

                _nsTableView.RowHeight = 60;
                SetNativeControl(scroller);
            }

            if (e.OldElement != null)
            {
                // unsubscribe
            }

            if (e.NewElement != null)
            {
                // subscribe

                var s = new NativeiOSListViewSource(e.NewElement, _nsTableView);
                _nsTableView.Source = s;
            }
        }
コード例 #2
0
        protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            if (e.PropertyName == NativeListView.ItemsProperty.PropertyName)
            {
                // update the Items list in the UITableViewSource
                var s = new NativeiOSListViewSource(Element, _nsTableView);
                _nsTableView.Source = s;
            }
        }