当前位置: 首页>>代码示例>>C#>>正文


C# Controls.ListViewBase类代码示例

本文整理汇总了C#中Windows.UI.Xaml.Controls.ListViewBase的典型用法代码示例。如果您正苦于以下问题:C# ListViewBase类的具体用法?C# ListViewBase怎么用?C# ListViewBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ListViewBase类属于Windows.UI.Xaml.Controls命名空间,在下文中一共展示了ListViewBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnContainerContentChanging

 private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
 {
     if (args.InRecycleQueue)
     {
         ListViewItem lvi = (args.ItemContainer as ListViewItem);
         if (lvi != null)
         {
             UIElement element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
             if (element != null)
             {
                 element.PointerPressed -= OnPointerPressed;
                 element.PointerReleased -= OnPointerReleased;
                 element.PointerCaptureLost -= OnPointerCaptureLost;
                 element.PointerExited -= OnPointerExited;
             }
         }
     }
     else if (args.Phase == 0)
     {
         ListViewItem lvi = (args.ItemContainer as ListViewItem);
         if (null != lvi)
         {
             UIElement element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
             if (null != element)
             {
                 element.PointerPressed += OnPointerPressed;
                 element.PointerReleased += OnPointerReleased;
                 element.PointerCaptureLost += OnPointerCaptureLost;
                 element.PointerExited += OnPointerExited;
             }
         }
     }
 }
开发者ID:jj09,项目名称:ShoppingPad,代码行数:33,代码来源:EdgeTappedListView.cs

示例2: ScrollItem

        public static void ScrollItem(ListViewBase control, int indexDelta)
        {
            if (control == null || control.Items == null)
                return;

            var scrollViewer = VisualTreeUtilities.GetVisualChild<ScrollViewer>(control);

            var p = new Point(Window.Current.Bounds.Width/2, 10);
            var transform = control.TransformToVisual(Window.Current.Content);
            var checkPoint = transform.TransformPoint(p);

            var q = from lvi in VisualTreeHelper.FindElementsInHostCoordinates(checkPoint, scrollViewer).OfType<ListViewItem>()
                where lvi.Content != null
                select lvi.Content;

            var item = q.FirstOrDefault();

            if (item == null)
                return;

            var index = control.Items.IndexOf(item);
            var nextItemIndex = index + indexDelta;
            if (index != -1 && nextItemIndex >= 0 && nextItemIndex < control.Items.Count)
            {
                var nextItem = control.Items[nextItemIndex];
                control.ScrollIntoView(nextItem, ScrollIntoViewAlignment.Leading);
            }
        }
开发者ID:valeronm,项目名称:handyNews,代码行数:28,代码来源:ScrollUtils.cs

示例3: lvListSelectionChanged_Changed

        //SignoffStatus Grid Select Event : Load WorkFlowBar 
        private async void lvListSelectionChanged_Changed(object sender, ListViewBase e)
        {
            try
            {
                ucWorkFlowBanner.GridClear();
                IWPWorkflowStatusdto = (IWPWorkflowStatusBypersonnelid_type_term)e.SelectedItem;
                List<WorkflowDetailByIWPID> workflowbannerdto = new List<WorkflowDetailByIWPID>();
                await _Workflow.GetWorkflowDetailByProcessID(IWPWorkflowStatusdto.ProcessId);
                workflowbannerdto = _Workflow.GetWorkflowDetail();
                ucWorkFlowBanner.LoadWorkFlow(workflowbannerdto);

                Lib.WorkFlowDataSource.PackageTypeCode = IWPWorkflowStatusdto.PackageTypeCode;

                Lib.WorkFlowDataSource.selectedTypeName = IWPWorkflowStatusdto.PackageTypeName;
                Lib.WorkFlowDataSource.selectedDocumentID = IWPWorkflowStatusdto.TargetId;
                Lib.WorkFlowDataSource.selectedIwpID = IWPWorkflowStatusdto.IwpId;
                
                if (btnsentstatus != "")
                    Lib.WorkFlowDataSource.sentyn = btnsentstatus;
            }
            catch (Exception ex)
            {

            }
        }
开发者ID:paraneye,项目名称:WinApp,代码行数:26,代码来源:IWPSignoffStatus.xaml.cs

示例4: Phase0Load

 internal bool Phase0Load(ListViewBase sender, ContainerContentChangingEventArgs args)
 {
     if (!args.InRecycleQueue)
     {
         if (((CommentViewModel)args.Item).IsEditing)
         {
             var editContent = (Resources["editingTemplate"] as DataTemplate).LoadContent() as FrameworkElement;
             editContent.DataContext = ((CommentViewModel)DataContext).ReplyViewModel;
             contentControl.Content = editContent;
             contentControl.MinHeight = 0;
             return false;
         }
         else
         {
             contentControl.ContentTemplate = null;
             contentControl.Content = null;
             var body = ((CommentViewModel)args.Item).Body ?? "";
             contentControl.MinHeight = Math.Max(25, body.Length / 2);
             args.Handled = true;
             LoadPhase = 1;
             return true;
         }
     }
     return false;
 }
开发者ID:hippiehunter,项目名称:Baconography,代码行数:25,代码来源:CommentView.xaml.cs

示例5: ItemListView_ContainerContentChanging

        /// <summary>
        /// We will visualize the data item in asynchronously in multiple phases for improved panning user experience 
        /// of large lists.  In this sample scneario, we will visualize different parts of the data item
        /// in the following order:
        /// 
        ///     1) Title and placeholder for Image (visualized synchronously - Phase 0)
        ///     2) Subtilte (visualized asynchronously - Phase 1)
        ///     3) Image (visualized asynchronously - Phase 2)
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        void ItemListView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            Scenario2ItemViewer iv = args.ItemContainer.ContentTemplateRoot as Scenario2ItemViewer;

            if (args.InRecycleQueue == true)
            {
                iv.ClearData();
            }
            else if (args.Phase == 0)
            {
                iv.ShowTitle(args.Item as Item);

                // Register for async callback to visualize Title asynchronously
                args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            }
            else if (args.Phase == 1)
            {
                iv.ShowSubtitle();
                args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            }
            else if (args.Phase == 2)
            {
                iv.ShowImage();
            }

            // For imporved performance, set Handled to true since app is visualizing the data item
            args.Handled = true;
        }
开发者ID:mbin,项目名称:Win81App,代码行数:40,代码来源:Scenario2.xaml.cs

示例6: ItemGridView_ContainerContentChanging

        void ItemGridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            //ItemViewer iv = args.ItemContainer.ContentTemplateRoot as ItemViewer;

            //if (args.InRecycleQueue == true)
            //{
            //    iv.ClearData();
            //}
            //else if (args.Phase == 0)
            //{
            //    iv.ShowPlaceholder(args.Item as Item);

            //    // Register for async callback to visualize Title asynchronously
            //    args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            //}
            //else if (args.Phase == 1)
            //{
            //    iv.ShowTitle();
            //    args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            //}
            //else if (args.Phase == 2)
            //{
            //    iv.ShowCategory();
            //    iv.ShowImage();
            //}

            //// For imporved performance, set Handled to true since app is visualizing the data item
            //args.Handled = true;
        }
开发者ID:prashanthganathe,项目名称:PersonalProjects,代码行数:29,代码来源:UserList.xaml.cs

示例7: Items_ContainerContentChanging

        /// <summary>
        /// We will visualize the data item in asynchronously in multiple phases for improved panning user experience 
        /// of large lists.  In this sample scneario, we will visualize different parts of the data item
        /// in the following order:
        /// 
        ///     1) Placeholders (visualized synchronously - Phase 0)
        ///     2) Labels (visualized asynchronously - Phase 1)
        ///     3) Values (visualized asynchronously - Phase 2)
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        void Items_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            TeamsDrillDownItem iv = args.ItemContainer.ContentTemplateRoot as TeamsDrillDownItem;

            if (args.InRecycleQueue == true)
            {
                iv.ClearData();
            }
            else if (args.Phase == 0)
            {
                iv.ShowPlaceholder(args.Item as TeamsDrillDownViewModel);

                // Register for async callback to visualize Title asynchronously
                args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            }
            else if (args.Phase == 1)
            {
                iv.ShowLabels();
                args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            }
            else if (args.Phase == 2)
            {
                iv.ShowValues();
                args.RegisterUpdateCallback(ContainerContentChangingDelegate);
            }

            // For improved performance, set Handled to true since app is visualizing the data item
            args.Handled = true;
        }
开发者ID:hoovejo,项目名称:ClutchWinBaseball.Win,代码行数:41,代码来源:TeamsDrillDown.xaml.cs

示例8: ListView_ContainerContentChanging

        private void ListView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            CompositionImage image = args.ItemContainer.ContentTemplateRoot.GetFirstDescendantOfType<CompositionImage>();
            Thumbnail thumbnail = args.Item as Thumbnail;

            // Update the image URI
            image.Source = new Uri(thumbnail.ImageUrl);
        }
开发者ID:chenjianwp,项目名称:WindowsUIDevLabs,代码行数:8,代码来源:ZoomWithPerspective.xaml.cs

示例9: OnContainerContentChanging

        private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            var visual = ElementCompositionPreview.GetElementVisual(args.ItemContainer);

            visual.ImplicitAnimations = args.InRecycleQueue
                ? null
                : animations;
        }
开发者ID:nigel-sampson,项目名称:talks,代码行数:8,代码来源:ImplicitAnimationsView.xaml.cs

示例10: messageList_ContainerContentChanging

 private void messageList_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
 {
     if (args.ItemContainer.ContentTemplateRoot is MessageControl)
     {
         var message = args.ItemContainer.ContentTemplateRoot as MessageControl;
         message.DataContext = args.Item;
         message.PhaseLoad(sender, args);
     }
 }
开发者ID:hippiehunter,项目名称:Baconography,代码行数:9,代码来源:Conversation.xaml.cs

示例11: ClearPreviousEvents

		private static void ClearPreviousEvents(ListViewBase listView)
		{
			ItemClickEventHandler eventHandler;
			if (_eventHandlers.TryGetValue(listView, out eventHandler))
			{
				listView.ItemClick -= eventHandler;
				_eventHandlers.Remove(listView);
			}
		}
开发者ID:Galad,项目名称:Hanno,代码行数:9,代码来源:ItemClickCommand.cs

示例12: TrySelectItem

 private bool TrySelectItem(ListViewBase listView, Func<object, bool> predicator)
 {
     var item = listView.Items.FirstOrDefault(predicator);
     if (item != null)
     {
         listView.SelectedItem = item;
         return true;
     }
     return false;
 }
开发者ID:sunnycase,项目名称:TomatoMusic,代码行数:10,代码来源:HamburgerMenu.cs

示例13: HandleItemClick

		private static void HandleItemClick(ListViewBase listView, object item)
		{
			var command = GetCommand(listView);

			if (command == null || !command.CanExecute(item))
			{
				return;
			}
			command.Execute(item);
		}
开发者ID:Galad,项目名称:Hanno,代码行数:10,代码来源:ItemClickCommand.cs

示例14: NavMenuItemContainerContentChanging

		/// <summary>
		/// Enable accessibility on each nav menu item by setting the AutomationProperties.Name on each container
		/// using the associated Label of each item.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="args"></param>
		private void NavMenuItemContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
		{
			if (!args.InRecycleQueue && args.Item != null && args.Item is NavMenuItem)
			{
				args.ItemContainer.SetValue(AutomationProperties.NameProperty, ((NavMenuItem)args.Item).Label);
			}
			else
			{
				args.ItemContainer.ClearValue(AutomationProperties.NameProperty);
			}
		}
开发者ID:MvvmCross,项目名称:MvvmCross-Samples,代码行数:17,代码来源:MenuView.xaml.cs

示例15: OnContainerContentChanging

 private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
 {
     if (args.InRecycleQueue)
     {
         if (_index > _associatedObject.Items.Count - 1)
         {
             _index = _associatedObject.Items.Count - 1;
         }
         _associatedObject.SelectedIndex = _index;
     }
 }
开发者ID:madeinouweland,项目名称:windows-10-select-after-remove-item-behavior,代码行数:11,代码来源:SelectAfterRemoveBehavior.cs


注:本文中的Windows.UI.Xaml.Controls.ListViewBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。