コード例 #1
0
        string GetText(object data, string part)
        {
            _currentItem = data as Native.ListView.ItemContext;
            var span = OnGetText(_currentItem.Cell, part);

            return(span != null?ToNative(span).GetMarkupText() : null);
        }
コード例 #2
0
        void ItemDeleted(object data)
        {
            _currentItem = data as Native.ListView.ItemContext;
            var cell = _currentItem.Cell;

            _realizedNativeViews.Remove(cell);
            OnDeleted(cell);
        }
コード例 #3
0
        EvasObject ReusableContent(object data, string part, EvasObject old)
        {
            _currentItem = data as Native.ListView.ItemContext;
            var        cell       = _currentItem.Cell;
            EvasObject nativeView = OnReusableContent(cell, part, old);

            UpdateRealizedView(cell, part, nativeView);
            return(nativeView);
        }
コード例 #4
0
ファイル: ListViewRenderer.cs プロジェクト: zmtzawqlp/maui
        /// <summary>
        /// Handles item selected event. Note that it has to handle selection also for grouping mode as well.
        /// As a result of this method, ItemTapped event should be invoked in Xamarin.
        /// </summary>
        /// <param name="sender">A native list instance from which the event has originated.</param>
        /// <param name="e">Argument associated with handler, it holds native item for which event was raised</param>
        protected void OnListViewItemSelected(object sender, GenListItemEventArgs e)
        {
            GenListItem item = e.Item;

            _lastSelectedItem = item;

            if (_selectedItemChanging == 0)
            {
                if (item != null)
                {
                    int index = -1;
                    if (Element.IsGroupingEnabled)
                    {
                        Native.ListView.ItemContext itemContext = item.Data as Native.ListView.ItemContext;
                        if (itemContext.IsGroupItem)
                        {
                            return;
                        }
                        else
                        {
                            int groupIndex   = (Element.TemplatedItems as System.Collections.IList).IndexOf(itemContext.ListOfSubItems);
                            int inGroupIndex = itemContext.ListOfSubItems.IndexOf(itemContext.Cell);

                            ++_selectedItemChanging;
                            Element.NotifyRowTapped(groupIndex, inGroupIndex);
                            --_selectedItemChanging;
                        }
                    }
                    else
                    {
                        index = Element.TemplatedItems.IndexOf((item.Data as Native.ListView.ItemContext).Cell);

                        ++_selectedItemChanging;
                        Element.NotifyRowTapped(index);
                        --_selectedItemChanging;
                    }
                }
            }
        }