/// <summary>
        /// Retrieves a UI Automation provider for each child element that is selected.
        /// </summary>
        public IRawElementProviderSimple[] GetSelection()
        {
            List <IRawElementProviderSimple> providerSamples = new List <IRawElementProviderSimple>();

            foreach (object selected in this.ListViewOwner.SelectedItems)
            {
                ItemInfo?info = this.ListViewOwner.Model.FindItemInfo(selected);
                if (!info.HasValue)
                {
                    continue;
                }

                GeneratedItemModel generatedModel = this.ListViewOwner.Model.GetDisplayedElement(info.Value.Slot, info.Value.Id);
                RadListViewItem    container      = null;
                if (generatedModel != null)
                {
                    container = generatedModel.Container as RadListViewItem;
                }
                if (container == null)
                {
                    continue;
                }

                AutomationPeer itemPeer = (RadListViewItemAutomationPeer)FrameworkElementAutomationPeer.CreatePeerForElement(container);
                if (itemPeer != null)
                {
                    providerSamples.Add(this.ProviderFromPeer(itemPeer));
                }
            }

            return(providerSamples.ToArray());
        }
Exemple #2
0
 internal void PrepareReorderItem(RadListViewItem reorderItem)
 {
     if (reorderItem != null)
     {
         (reorderItem as IReorderItem).Coordinator = this.reorderCoordinator;
         DragDrop.SetAllowDrop(reorderItem, true);
     }
 }
Exemple #3
0
 internal void CleanupReorderItem(RadListViewItem reorderItem)
 {
     if (reorderItem != null)
     {
         (reorderItem as IReorderItem).Coordinator = null;
         DragDrop.SetAllowDrop(reorderItem, false);
     }
 }
        internal void OnItemActionControlTap(RadListViewItem radListViewItem, double offset)
        {
            var item = radListViewItem.DataContext;

            if (item != null)
            {
                this.commandService.ExecuteCommand(CommandId.ItemActionTap, new ItemActionTapContext(item, radListViewItem, offset));
            }
        }
        internal void FocusCurrentContainer()
        {
            RadListViewItem container = this.GetCurrentContainer();

            if (container != null)
            {
                container.Focus(FocusState.Programmatic);
            }
        }
        internal void OnItemHold(RadListViewItem radListViewItem, HoldingRoutedEventArgs e)
        {
            // TODO add holdCommand.
            DragDrop.StartDrag(radListViewItem, e, DragDropTrigger.Hold);

            //// var item = radListViewItem.DataContext;
            //// if (item != null)
            //// {
            ////     this.commandService.ExecuteCommand(CommandId.ItemTap, new ItemTapContext(item, radListViewItem));
            //// }
        }
Exemple #7
0
        internal void OnIsCheckModeActiveChanged()
        {
            var handler = this.IsCheckModeActiveChanged;

            if (handler != null)
            {
                handler(this.Owner, new CheckModeActiveChangedEventArgs(this.IsCheckModeActive, tappedItem, this.selectedItems));
            }
            this.tappedItem = null;
            this.Owner.updateService.RegisterUpdate((int)UpdateFlags.AffectsContent);
        }
        internal void OnItemHold(RadListViewItem radListViewItem, HoldingRoutedEventArgs e)
        {
            var item = radListViewItem.DataContext;

            if (item != null)
            {
                this.commandService.ExecuteCommand(CommandId.ItemHold, new ItemHoldContext(item));
            }

            if (this.ReorderMode == ListViewReorderMode.Default)
            {
                DragDrop.StartDrag(radListViewItem, e, DragDropTrigger.Hold);
            }
        }
        protected void LinqDataSourceRadGridDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            var data = EsmHelper.GetData(portalDc, this.itemFilter);

            RadDataPager radDataPager = RadListViewItem.FindControl("RadDataPagerItem") as RadDataPager;

            vw_item vwItem = data.ToList()[pageIndex];

            var query = from c in portalDc.purchaseOrderLines
                        where c.itemId == vwItem.itemId && c.purchaseOrder.company.companyCode == vwItem.companyCode
                        select new { c.openQuantity, c.uomCode, c.deliveryDate, c.purchaseOrder.businessPartner.bpName, c.purchaseOrder.businessPartner.country.description };

            e.Result = query;
        }
        internal void OnItemTap(RadListViewItem radListViewItem, Point relativePosition)
        {
            var item = radListViewItem.DataContext;

            this.CleanupSwipedItem();
            if (item != null)
            {
                var  touchPoint = this.Orientation == Windows.UI.Xaml.Controls.Orientation.Vertical ? relativePosition.X : relativePosition.Y;
                var  itemSize   = this.Orientation == Windows.UI.Xaml.Controls.Orientation.Vertical ? radListViewItem.arrangeRect.Width : radListViewItem.arrangeRect.Height;
                bool isInArea   = this.ItemCheckBoxPosition == CheckBoxPosition.BeforeItem ? touchPoint <= CheckBoxSelectionTouchTargetThreshold : itemSize - touchPoint <= CheckBoxSelectionTouchTargetThreshold;
                if (isInArea && this.SelectionMode == DataControlsSelectionMode.MultipleWithCheckBoxes)
                {
                    this.itemCheckBoxService.OnItemTap(radListViewItem);
                }
                this.commandService.ExecuteCommand(CommandId.ItemTap, new ItemTapContext(item, radListViewItem));
            }
        }
        private RadListViewItem GetCurrentContainer()
        {
            if (this.CurrentItem == null || this.currencyService.CurrentItemInfo == null || !this.currencyService.CurrentItemInfo.HasValue)
            {
                return(null);
            }

            ItemInfo           currentInfo    = this.currencyService.CurrentItemInfo.Value;
            GeneratedItemModel generatedModel = this.Model.GetDisplayedElement(currentInfo.Slot, currentInfo.Id);

            RadListViewItem result = null;

            if (generatedModel != null)
            {
                result = generatedModel.Container as RadListViewItem;
            }
            return(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            portalDc = new DALPortalDataContext();

            this.itemFilter = (ItemFilter)Session["itemFilter"];

            if (!IsPostBack)
            {
                this.selectedItemId      = Convert.ToInt32(Session["selectedItemId"]);
                this.selectedCompanyCode = Session["selectedCompanyCode"].ToString();

                IQueryable <vw_item> data = EsmHelper.GetData(portalDc, this.itemFilter);

                int index = data.ToList().FindIndex(c => c.itemId.Equals(selectedItemId) && c.companyCode.Equals(selectedCompanyCode));

                RadDataPager radDataPager = RadListViewItem.FindControl("RadDataPagerItem") as RadDataPager;
                radDataPager.FireCommand("Page", (index).ToString());
            }
        }
        /// <inheritdoc />
        protected override IList <AutomationPeer> GetChildrenCore()
        {
            List <AutomationPeer> childPeers = new List <AutomationPeer>();

            foreach (GeneratedItemModel itemModel in this.ListViewOwner.Model.ForEachDisplayedElement())
            {
                if (itemModel.Container == null)
                {
                    continue;
                }

                RadListViewItem listItem = itemModel.Container as RadListViewItem;
                if (listItem != null)
                {
                    var peer = CreatePeerForElement(listItem);
                    childPeers.Add(peer);
                }
            }
            return(childPeers);
        }
Exemple #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadListViewItemAutomationPeer"/> class.
 /// </summary>
 /// <param name="owner">The <see cref="RadListViewItem"/> that is associated with this <see cref="RadListViewItemAutomationPeer"/>.</param>
 public RadListViewItemAutomationPeer(RadListViewItem owner)
     : base(owner)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemActionTapContext"/> class.
 /// </summary>
 public ItemActionTapContext(object item, RadListViewItem visualItem, double offset)
     : base(item, visualItem)
 {
     this.Offset = offset;
 }
Exemple #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemTapContext"/> class.
 /// </summary>
 public ItemTapContext(object item, RadListViewItem visualItem)
 {
     this.Item      = item;
     this.Container = visualItem;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemSwipeContextBase"/> class.
 /// </summary>
 public ItemSwipeContextBase(object dataItem, RadListViewItem container, double dragDelta)
 {
     this.Item      = dataItem;
     this.Container = container;
     this.DragDelta = dragDelta;
 }
 internal void OnItemReorderHandlePressed(RadListViewItem radListViewItem, PointerRoutedEventArgs e, DragDropTrigger trigger, object sender = null)
 {
     DragDrop.StartDrag(radListViewItem, e, trigger, sender);
 }
Exemple #19
0
 internal void OnItemTap(RadListViewItem listViewItem)
 {
     this.tappedItem = listViewItem;
     this.Owner.IsCheckModeActive = true;
 }
Exemple #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemSwipingContext"/> class.
 /// </summary>
 public ItemSwipingContext(object dataItem, RadListViewItem container, double dragDelta) : base(dataItem, container, dragDelta)
 {
 }
 internal void OnItemHold(RadListViewItem radListViewItem, HoldingRoutedEventArgs e)
 {
     // TODO add holdCommand.
     DragDrop.StartDrag(radListViewItem, e, DragDropTrigger.Hold);
 }
Exemple #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemSwipeActionCompleteContext"/> class.
 /// </summary>
 public ItemSwipeActionCompleteContext(object dataItem, RadListViewItem container, double dragDelta) : base(dataItem, container, dragDelta)
 {
     this.FinalDragOffset = this.GetOffset(container.ListView.Orientation, dragDelta, container.ListView.ItemSwipeOffset);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemDragStartingContext"/> class.
 /// </summary>
 public ItemDragStartingContext(object dataItem, DragAction itemAction, RadListViewItem container)
     : this(dataItem, itemAction)
 {
     this.Container = container;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemReorderCompleteContext"/> class.
 /// </summary>
 public ItemReorderCompleteContext(object dataItem, object destinationItem, RadListViewItem container)
 {
     this.Item            = dataItem;
     this.DestinationItem = destinationItem;
     this.Container       = container;
 }