ListViewBase ListViewBase ListViewBase Class

Definition

Provides the infrastructure for the ListView and GridView classes.

public class ListViewBasepublic class ListViewBasePublic Class ListViewBase
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited events

Inherited methods

Remarks

For user interface purposes, ListViewBase should be thought of as an abstract base class. Use ListView or GridView instead. The main difference between ListView and GridView is that ListView has a vertical/portrait orientation and GridView has a horizontal/landscape orientation. For more info, see Adding ListView and GridView controls.

ListViewBase derived classes

ListViewBase is the parent class for GridView and ListView.

Constructors

ListViewBase() ListViewBase() ListViewBase() ListViewBase()

Provides base-class initialization behavior for classes that are derived from the ListViewBase class.

protected ListViewBase()protected New()Protected Sub New()protected ListViewBase()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

CanDragItems CanDragItems CanDragItems CanDragItems

Gets or sets a value that indicates whether items in the view can be dragged as data payload.

public bool CanDragItems { get; set; }public bool CanDragItems { get; set; }Public ReadWrite Property CanDragItems As boolpublic bool CanDragItems { get; set; }
<listViewBase CanDragItems="bool" />
Value
bool bool bool

True if items in the view can be dragged as data payload; otherwise, false. The default is false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these interactions are needed. For example:

  • If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the mouse, but can't deselect an item with touch by using a swipe gesture.
  • If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with touch.
  • If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with touch.

CanDragItems can be set to false as part of visual states that are intended to prevent users from dragging items in views such as a GridView.

CanDragItems does not reflect transient states that might influence the ability to drag items, such as item population lag. The primary scenario where you might get the value of CanDragItems in code is to verify that dynamic templates or user-selectable options in your app UI have not changed the value since you last set it.

CanDragItemsProperty CanDragItemsProperty CanDragItemsProperty CanDragItemsProperty

Identifies the CanDragItems dependency property.

public static DependencyProperty CanDragItemsProperty { get; }public static DependencyProperty CanDragItemsProperty { get; }Public Static ReadOnly Property CanDragItemsProperty As DependencyPropertypublic static DependencyProperty CanDragItemsProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the CanDragItems dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CanReorderItems CanReorderItems CanReorderItems CanReorderItems

Gets or sets a value that indicates whether items in the view can be reordered through user interaction.

public bool CanReorderItems { get; set; }public bool CanReorderItems { get; set; }Public ReadWrite Property CanReorderItems As boolpublic bool CanReorderItems { get; set; }
<listViewBase CanReorderItems="bool" />
Value
bool bool bool

True if items in the view can be reordered through user interaction; otherwise, false. The default is false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

To enable users to reorder items using drag-and-drop interaction, you must set both the CanReorderItems and AllowDrop properties to true.

Built in reordering is not supported when items are grouped, or when a VariableSizedWrapGrid is used as the ItemsPanel.

Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these interactions are needed. For example:

  • If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the mouse, but can't deselect an item with touch by using a swipe gesture.
  • If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with touch.
  • If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with touch. +

Examples

Here's a GridView that contains 6 rectangles that a user can reorder by drag-and-drop.

<GridView MaxHeight="310" 
          AllowDrop="True" 
          CanReorderItems="True">
    <Rectangle Height="100" Width="100" Fill="Blue"/>
    <Rectangle Height="100" Width="100" Fill="Red"/>
    <Rectangle Height="100" Width="100" Fill="Yellow"/>
    <Rectangle Height="100" Width="100" Fill="Green"/>
    <Rectangle Height="100" Width="100" Fill="Gray"/>
    <Rectangle Height="100" Width="100" Fill="LightBlue"/>
</GridView>

CanReorderItemsProperty CanReorderItemsProperty CanReorderItemsProperty CanReorderItemsProperty

Identifies the CanReorderItems dependency property.

public static DependencyProperty CanReorderItemsProperty { get; }public static DependencyProperty CanReorderItemsProperty { get; }Public Static ReadOnly Property CanReorderItemsProperty As DependencyPropertypublic static DependencyProperty CanReorderItemsProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the CanReorderItems dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DataFetchSize DataFetchSize DataFetchSize DataFetchSize

Gets or sets the amount of data to fetch for virtualizing/prefetch operations.

public double DataFetchSize { get; set; }public double DataFetchSize { get; set; }Public ReadWrite Property DataFetchSize As doublepublic double DataFetchSize { get; set; }
<listViewBase DataFetchSize="double" />
Value
double double double

The amount of data to fetch per interval, in pages.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DataFetchSizeProperty DataFetchSizeProperty DataFetchSizeProperty DataFetchSizeProperty

Identifies the DataFetchSize dependency property.

public static DependencyProperty DataFetchSizeProperty { get; }public static DependencyProperty DataFetchSizeProperty { get; }Public Static ReadOnly Property DataFetchSizeProperty As DependencyPropertypublic static DependencyProperty DataFetchSizeProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the DataFetchSize dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Gets or sets the content for the list footer.

public object Footer { get; set; }public object Footer { get; set; }Public ReadWrite Property Footer As objectpublic object Footer { get; set; }
<listViewBase Footer="footerString"/>

Value
object object object

The content of the list footer. The default is null.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

By default, the footer is shown at the bottom for a ListView, and on the right for a GridView. If the FlowDirection property is set to FlowDirection, the footer is shown on the left for a GridView.

You can use a data template for the footer by setting the FooterTemplate property.

FooterProperty FooterProperty FooterProperty FooterProperty

Identifies the Footer dependency property.

public static DependencyProperty FooterProperty { get; }public static DependencyProperty FooterProperty { get; }Public Static ReadOnly Property FooterProperty As DependencyPropertypublic static DependencyProperty FooterProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Footer dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

FooterTemplate FooterTemplate FooterTemplate FooterTemplate

Gets or sets the DataTemplate used to display the content of the view footer.

public DataTemplate FooterTemplate { get; set; }public DataTemplate FooterTemplate { get; set; }Public ReadWrite Property FooterTemplate As DataTemplatepublic DataTemplate FooterTemplate { get; set; }
<listViewBase FooterTemplate="resourceReferenceToDataTemplate"/>
Value
DataTemplate DataTemplate DataTemplate

The template that specifies the visualization of the footer object. The default is null.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

FooterTemplateProperty FooterTemplateProperty FooterTemplateProperty FooterTemplateProperty

Identifies the FooterTemplate dependency property.

public static DependencyProperty FooterTemplateProperty { get; }public static DependencyProperty FooterTemplateProperty { get; }Public Static ReadOnly Property FooterTemplateProperty As DependencyPropertypublic static DependencyProperty FooterTemplateProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FooterTemplate dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

FooterTransitions FooterTransitions FooterTransitions FooterTransitions

Gets or sets the collection of Transition style elements that apply to the view footer.

public TransitionCollection FooterTransitions { get; set; }public TransitionCollection FooterTransitions { get; set; }Public ReadWrite Property FooterTransitions As TransitionCollectionpublic TransitionCollection FooterTransitions { get; set; }
<listViewBase>
  <listViewBase.FooterTransitions>
    <TransitionCollection>
      oneOrMoreTransitions
    </TransitionCollection>
  </listViewBase.FooterTransitions>
</listViewBase>
Value
TransitionCollection TransitionCollection TransitionCollection

The collection of Transition style elements that apply to the list footer.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Important

The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but properties that use TransitionCollection don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.

Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or transition, the animation draws the attention of the user to the change.

FooterTransitionsProperty FooterTransitionsProperty FooterTransitionsProperty FooterTransitionsProperty

Identifies the FooterTransitions dependency property.

public static DependencyProperty FooterTransitionsProperty { get; }public static DependencyProperty FooterTransitionsProperty { get; }Public Static ReadOnly Property FooterTransitionsProperty As DependencyPropertypublic static DependencyProperty FooterTransitionsProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FooterTransitions dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Header Header Header Header

Gets or sets the content for the list header.

public object Header { get; set; }public object Header { get; set; }Public ReadWrite Property Header As objectpublic object Header { get; set; }
<listViewBase Header="headerString"/>

Value
object object object

The content of the list header. The default value is null.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

By default, the header is shown at the top for a ListView, and on the left for a GridView. If the FlowDirection property is set to FlowDirection, the header is shown on the right for a GridView.

You can use a data template for the Header by setting the HeaderTemplate property.

Examples

Here's a GridView header that contains a StackPanel with text and an image. This Extensible Application Markup Language (XAML) is a simplified version of the GridView used in GroupDetail page of the Microsoft Visual Studio Grid App template.

<GridView x:Name="itemGridView"
          Margin="0,-14,0,0"
          Padding="120,0,120,50"
          ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
          ItemTemplate="{StaticResource Standard500x130ItemTemplate}">

    <GridView.Header>
        <StackPanel Width="480" Margin="0,4,14,0">
            <TextBlock Text="{Binding Subtitle}" Margin="0,0,18,20" 
                       Style="{StaticResource SubheaderTextStyle}" MaxHeight="60"/>
            <Image Source="{Binding Image}" Height="400" Margin="0,0,18,20" 
                   Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
            <TextBlock Text="{Binding Description}" Margin="0,0,18,0" 
                       Style="{StaticResource BodyTextStyle}"/>
        </StackPanel>
    </GridView.Header>
</GridView>

HeaderProperty HeaderProperty HeaderProperty HeaderProperty

Identifies the Header dependency property.

public static DependencyProperty HeaderProperty { get; }public static DependencyProperty HeaderProperty { get; }Public Static ReadOnly Property HeaderProperty As DependencyPropertypublic static DependencyProperty HeaderProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Header dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

HeaderTemplate HeaderTemplate HeaderTemplate HeaderTemplate

Gets or sets the DataTemplate used to display the content of the view header.

public DataTemplate HeaderTemplate { get; set; }public DataTemplate HeaderTemplate { get; set; }Public ReadWrite Property HeaderTemplate As DataTemplatepublic DataTemplate HeaderTemplate { get; set; }
<listViewBase HeaderTemplate="resourceReferenceToDataTemplate"/>
Value
DataTemplate DataTemplate DataTemplate

The template that specifies the visualization of the header object. The default is null.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

HeaderTemplateProperty HeaderTemplateProperty HeaderTemplateProperty HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

public static DependencyProperty HeaderTemplateProperty { get; }public static DependencyProperty HeaderTemplateProperty { get; }Public Static ReadOnly Property HeaderTemplateProperty As DependencyPropertypublic static DependencyProperty HeaderTemplateProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the HeaderTemplate dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

HeaderTransitions HeaderTransitions HeaderTransitions HeaderTransitions

Gets or sets the collection of Transition style elements that apply to the view header.

public TransitionCollection HeaderTransitions { get; set; }public TransitionCollection HeaderTransitions { get; set; }Public ReadWrite Property HeaderTransitions As TransitionCollectionpublic TransitionCollection HeaderTransitions { get; set; }
<listViewBase>
  <listViewBase.HeaderTransitions>
    <TransitionCollection>
      oneOrMoreTransitions
    </TransitionCollection>
  </listViewBase.HeaderTransitions>
</listViewBase>
Value
TransitionCollection TransitionCollection TransitionCollection

The collection of Transition style elements that apply to the list header.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Important

The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but properties that use TransitionCollection don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.

Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or transition, the animation draws the attention of the user to the change.

HeaderTransitionsProperty HeaderTransitionsProperty HeaderTransitionsProperty HeaderTransitionsProperty

Identifies the HeaderTransitions dependency property.

public static DependencyProperty HeaderTransitionsProperty { get; }public static DependencyProperty HeaderTransitionsProperty { get; }Public Static ReadOnly Property HeaderTransitionsProperty As DependencyPropertypublic static DependencyProperty HeaderTransitionsProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the HeaderTransitions dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IncrementalLoadingThreshold IncrementalLoadingThreshold IncrementalLoadingThreshold IncrementalLoadingThreshold

Gets or sets the threshold range that governs when the ListViewBase class will begin to prefetch more items.

public double IncrementalLoadingThreshold { get; set; }public double IncrementalLoadingThreshold { get; set; }Public ReadWrite Property IncrementalLoadingThreshold As doublepublic double IncrementalLoadingThreshold { get; set; }
<listViewBase IncrementalLoadingThreshold="double" />
Value
double double double

The loading threshold, in terms of pages.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The meaning of the page count given for IncrementalLoadingThreshold is that the ListViewBase does not need to request more items via LoadMoreItemsAsync() until the trigger condition (see IncrementalLoadingTrigger ) gets within the IncrementalLoadingThreshold page range. Setting a larger number (for instance 10 or more) represents a belief that the user might attempt to scroll through the list very quickly, and it is worthwhile devoting resources to loading more items as quickly as possible. Setting a smaller number (for instance 5 or less) represents a belief that the user will scroll through the list less quickly, and that the user's scroll rate will permit the items collection to catch up without being as resource intensive.

IncrementalLoadingThreshold and DataFetchSize both contribute to the possible resource load that is the result of prefetch operations.

IncrementalLoadingThresholdProperty IncrementalLoadingThresholdProperty IncrementalLoadingThresholdProperty IncrementalLoadingThresholdProperty

Identifies the IncrementalLoadingThreshold dependency property.

public static DependencyProperty IncrementalLoadingThresholdProperty { get; }public static DependencyProperty IncrementalLoadingThresholdProperty { get; }Public Static ReadOnly Property IncrementalLoadingThresholdProperty As DependencyPropertypublic static DependencyProperty IncrementalLoadingThresholdProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IncrementalLoadingThreshold dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IncrementalLoadingTrigger IncrementalLoadingTrigger IncrementalLoadingTrigger IncrementalLoadingTrigger

Gets or sets a value that indicates the conditions for prefetch operations by the ListViewBase class.

public IncrementalLoadingTrigger IncrementalLoadingTrigger { get; set; }public IncrementalLoadingTrigger IncrementalLoadingTrigger { get; set; }Public ReadWrite Property IncrementalLoadingTrigger As IncrementalLoadingTriggerpublic IncrementalLoadingTrigger IncrementalLoadingTrigger { get; set; }
<listViewBase IncrementalLoadingTrigger="None" />
-or-
<listViewBase IncrementalLoadingTrigger="Edge" />
Value
IncrementalLoadingTrigger IncrementalLoadingTrigger IncrementalLoadingTrigger

An enumeration value that indicates the conditions that trigger prefetch operations. The default is Edge.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IncrementalLoadingTriggerProperty IncrementalLoadingTriggerProperty IncrementalLoadingTriggerProperty IncrementalLoadingTriggerProperty

Identifies the IncrementalLoadingTrigger dependency property.

public static DependencyProperty IncrementalLoadingTriggerProperty { get; }public static DependencyProperty IncrementalLoadingTriggerProperty { get; }Public Static ReadOnly Property IncrementalLoadingTriggerProperty As DependencyPropertypublic static DependencyProperty IncrementalLoadingTriggerProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IncrementalLoadingTrigger dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsActiveView IsActiveView IsActiveView IsActiveView

Gets or sets a value that indicates whether the ListViewBase instance is the active view in its owning SemanticZoom.

public bool IsActiveView { get; set; }public bool IsActiveView { get; set; }Public ReadWrite Property IsActiveView As boolpublic bool IsActiveView { get; set; }
Value
bool bool bool

true if the ListViewBase is the active view; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You typically don't set this property in XAML or in app code. The property is set implicitly when the view is set as either the ZoomedInView or ZoomedOutView of a SemanticZoom control.

IsActiveViewProperty IsActiveViewProperty IsActiveViewProperty IsActiveViewProperty

Identifies the IsActiveView dependency property.

public static DependencyProperty IsActiveViewProperty { get; }public static DependencyProperty IsActiveViewProperty { get; }Public Static ReadOnly Property IsActiveViewProperty As DependencyPropertypublic static DependencyProperty IsActiveViewProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsActiveView dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsItemClickEnabled IsItemClickEnabled IsItemClickEnabled IsItemClickEnabled

Gets or sets a value that indicates whether items in the view fire an ItemClick event in response to interaction.

public bool IsItemClickEnabled { get; set; }public bool IsItemClickEnabled { get; set; }Public ReadWrite Property IsItemClickEnabled As boolpublic bool IsItemClickEnabled { get; set; }
<listViewBase IsItemClickEnabled="bool" />
Value
bool bool bool

true if interaction fires an ItemClick event; otherwise, false. The default is false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

By default, a user can select items in the view by tapping or clicking on them. You can change this behavior to make the user interaction fire a click event instead of triggering item selection.

If you set the IsItemClickEnabled property to true, you must set the SelectionMode property to ListViewSelectionMode. Handle the ItemClick event to respond to the user interaction.

IsItemClickEnabledProperty IsItemClickEnabledProperty IsItemClickEnabledProperty IsItemClickEnabledProperty

Identifies the IsItemClickEnabled dependency property.

public static DependencyProperty IsItemClickEnabledProperty { get; }public static DependencyProperty IsItemClickEnabledProperty { get; }Public Static ReadOnly Property IsItemClickEnabledProperty As DependencyPropertypublic static DependencyProperty IsItemClickEnabledProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsItemClickEnabled dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsMultiSelectCheckBoxEnabled IsMultiSelectCheckBoxEnabled IsMultiSelectCheckBoxEnabled IsMultiSelectCheckBoxEnabled

Gets or sets a value that indicates whether a check box is shown to enable multi-selection.

public bool IsMultiSelectCheckBoxEnabled { get; set; }public bool IsMultiSelectCheckBoxEnabled { get; set; }Public ReadWrite Property IsMultiSelectCheckBoxEnabled As boolpublic bool IsMultiSelectCheckBoxEnabled { get; set; }
Value
bool bool bool

true if a check box is shown to enable multi-selection; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsMultiSelectCheckBoxEnabledProperty IsMultiSelectCheckBoxEnabledProperty IsMultiSelectCheckBoxEnabledProperty IsMultiSelectCheckBoxEnabledProperty

Get the identifier for the IsMultiSelectCheckBoxEnabled dependency property.

public static DependencyProperty IsMultiSelectCheckBoxEnabledProperty { get; }public static DependencyProperty IsMultiSelectCheckBoxEnabledProperty { get; }Public Static ReadOnly Property IsMultiSelectCheckBoxEnabledProperty As DependencyPropertypublic static DependencyProperty IsMultiSelectCheckBoxEnabledProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsMultiSelectCheckBoxEnabled dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsSwipeEnabled IsSwipeEnabled IsSwipeEnabled IsSwipeEnabled

Gets or sets a value that indicates whether the view supports discrete input processing for a swipe interaction.

public bool IsSwipeEnabled { get; set; }public bool IsSwipeEnabled { get; set; }Public ReadWrite Property IsSwipeEnabled As boolpublic bool IsSwipeEnabled { get; set; }
<listViewBase IsSwipeEnabled="bool" .../>
Value
bool bool bool

true if discrete input processing for swipe interactions is enabled; otherwise, false. The default is true.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these interactions are needed. For example:

  • If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the mouse, but can't deselect an item with touch by using a swipe gesture.
  • If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with touch.
  • If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with touch.

You typically set IsSwipeEnabled to false to disable swipe animations when items in the view don't support interactions that use the swipe gesture, like deselecting, dragging, and reordering. Disabling the animation when it's not needed can improve the performance of your app.

IsSwipeEnabledProperty IsSwipeEnabledProperty IsSwipeEnabledProperty IsSwipeEnabledProperty

Identifies the IsSwipeEnabled dependency property.

public static DependencyProperty IsSwipeEnabledProperty { get; }public static DependencyProperty IsSwipeEnabledProperty { get; }Public Static ReadOnly Property IsSwipeEnabledProperty As DependencyPropertypublic static DependencyProperty IsSwipeEnabledProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsSwipeEnabled dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IsZoomedInView IsZoomedInView IsZoomedInView IsZoomedInView

Gets or sets a value that indicates whether the ListViewBase instance is the zoomed-in view in its owning SemanticZoom.

public bool IsZoomedInView { get; set; }public bool IsZoomedInView { get; set; }Public ReadWrite Property IsZoomedInView As boolpublic bool IsZoomedInView { get; set; }
Value
bool bool bool

true if the ListViewBase is the zoomed-in view; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You typically don't set this property in XAML or in app code. The property is set implicitly when the view is set as either the ZoomedInView or ZoomedOutView of a SemanticZoom control.

IsZoomedInViewProperty IsZoomedInViewProperty IsZoomedInViewProperty IsZoomedInViewProperty

Identifies the IsZoomedInView dependency property.

public static DependencyProperty IsZoomedInViewProperty { get; }public static DependencyProperty IsZoomedInViewProperty { get; }Public Static ReadOnly Property IsZoomedInViewProperty As DependencyPropertypublic static DependencyProperty IsZoomedInViewProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsZoomedInView dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ReorderMode ReorderMode ReorderMode ReorderMode

Gets or sets the reorder behavior for a ListViewBase instance. When Enabled, unsorted and ungrouped lists can be reordered by user manipulation.

public ListViewReorderMode ReorderMode { get; set; }public ListViewReorderMode ReorderMode { get; set; }Public ReadWrite Property ReorderMode As ListViewReorderModepublic ListViewReorderMode ReorderMode { get; set; }
<listViewBase ReorderMode="Enabled"/>
-or-
<listViewBase ReorderMode="Disabled"/>
Value
ListViewReorderMode ListViewReorderMode ListViewReorderMode

One of the ListViewReorderMode enumeration values. The default is Disabled.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ReorderModeProperty ReorderModeProperty ReorderModeProperty ReorderModeProperty

Identifies the ReorderMode dependency property.

public static DependencyProperty ReorderModeProperty { get; }public static DependencyProperty ReorderModeProperty { get; }Public Static ReadOnly Property ReorderModeProperty As DependencyPropertypublic static DependencyProperty ReorderModeProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ReorderMode dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SelectedItems SelectedItems SelectedItems SelectedItems

Gets the currently selected items.

public IVector<object> SelectedItems { get; }public IVector<object> SelectedItems { get; }Public ReadOnly Property SelectedItems As IVector<object>public IVector<object> SelectedItems { get; }
Value

A collection of the currently selected items. The default is an empty collection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

When SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected. When SelectionMode is Single, use the SelectedItem property to get the item that's selected.

Starting in Windows 10, you can use the SelectRange(ItemIndexRange) and DeselectRange(ItemIndexRange) methods with the SelectedRanges property to make selections using ranges of indexes. This is a more efficient way to describe item selection than using SelectedItems, which requires the actual item object to be created for each selected item.

Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the list. Use the SelectedRanges property instead.

SelectedRanges SelectedRanges SelectedRanges SelectedRanges

Gets a collection of ItemIndexRange objects that describe the currently selected items in the list.

public IVectorView<ItemIndexRange> SelectedRanges { get; }public IVectorView<ItemIndexRange> SelectedRanges { get; }Public ReadOnly Property SelectedRanges As IVectorView<ItemIndexRange>public IVectorView<ItemIndexRange> SelectedRanges { get; }
Value

The collection of ItemIndexRange objects that describe the currently selected items in the list. The default is an empty collection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Each ItemIndexRange in the SelectedRanges collection describes a contiguous block of selected items. ItemIndexRange describes the selection by index, so item objects don't need to be created. This is a more efficient way to describe item selection than using SelectedItems, which requires the actual item object to be created for each selected item.

If your datasource performs data virtualization, you can use the SelectedRanges property with the SelectRange(ItemIndexRange) and DeselectRange(ItemIndexRange) methods to modify selection of items that have not been created yet.

Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the list. Use the SelectedRanges property instead.

SelectionMode SelectionMode SelectionMode SelectionMode

Gets or sets the selection behavior for a ListViewBase instance.

public ListViewSelectionMode SelectionMode { get; set; }public ListViewSelectionMode SelectionMode { get; set; }Public ReadWrite Property SelectionMode As ListViewSelectionModepublic ListViewSelectionMode SelectionMode { get; set; }
<listViewBase SelectionMode="listViewSelectionModeMemberName" />
Value
ListViewSelectionMode ListViewSelectionMode ListViewSelectionMode

One of the ListViewSelectionMode enumeration values. The default is Single selection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

By default, a user can select a single item in a view. You can set the SelectionMode property to a ListViewSelectionMode enumeration value to enable multi-selection or to disable selection. Here are the selection mode values.

ListViewSelectionMode Item selection is disabled.
ListViewSelectionMode With no modifier keys:

  • A user can select a single item using the space bar, mouse click, or touch tap.
  • A user can deselect an item using a downward swipe gesture.
While pressing Ctrl:

  • A user can deselect the item by using the space bar, mouse click, or touch tap.
  • Using the arrow keys, a user can move focus independently of selection.
ListViewSelectionMode With no modifier keys:

  • A user can select multiple items using the space bar, mouse click, or touch tap to toggle selection on the focused item.
  • Using the arrow keys, a user can move focus independently of selection.
ListViewSelectionMode With no modifier keys:

While pressing Ctrl:

  • A user can select multiple items using the space bar, mouse click, or touch tap to toggle selection on the focused item.
  • Using the arrow keys, a user can move focus independently of selection.
While pressing Shift:

  • A user can select multiple contiguous items by clicking or tapping the first item in the selection and then the last item in the selection.
  • Using the arrow keys, a user can create a contiguous selection starting with the item selected when Shift is pressed.

Note

Touch interactions are enabled only when IsSwipeEnabled is true.

If SelectionMode is ListViewSelectionMode, and CanDragItems and CanReorderItems are false, you should set IsSwipeEnabled to false to improve app performance. See the IsSwipeEnabled property for more info.

When SelectionMode is Single, use the SelectedItem property to get the item that's selected. When SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected.

When item selection is disabled, you can make items respond to a user click like a button instead of being selected. To do this, set SelectionMode to ListViewSelectionMode, the IsItemClickEnabled property to true, and handle the ItemClick event.

For more info and examples, see How to change the interaction mode.

SelectionModeProperty SelectionModeProperty SelectionModeProperty SelectionModeProperty

Identifies the SelectionMode dependency property.

public static DependencyProperty SelectionModeProperty { get; }public static DependencyProperty SelectionModeProperty { get; }Public Static ReadOnly Property SelectionModeProperty As DependencyPropertypublic static DependencyProperty SelectionModeProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the SelectionMode dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SemanticZoomOwner SemanticZoomOwner SemanticZoomOwner SemanticZoomOwner

Gets or sets the SemanticZoom instance that hosts the ListViewBase.

public SemanticZoom SemanticZoomOwner { get; set; }public SemanticZoom SemanticZoomOwner { get; set; }Public ReadWrite Property SemanticZoomOwner As SemanticZoompublic SemanticZoom SemanticZoomOwner { get; set; }
Value
SemanticZoom SemanticZoom SemanticZoom

The SemanticZoom instance that hosts this view, or null if the view is not hosted in a SemanticZoom control.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You don't set this property in Extensible Application Markup Language (XAML) or in your app code. The property is set implicitly when the view is set as either the ZoomedInView or ZoomedOutView of a SemanticZoom control.

SemanticZoomOwnerProperty SemanticZoomOwnerProperty SemanticZoomOwnerProperty SemanticZoomOwnerProperty

Identifies the SemanticZoomOwner dependency property.

public static DependencyProperty SemanticZoomOwnerProperty { get; }public static DependencyProperty SemanticZoomOwnerProperty { get; }Public Static ReadOnly Property SemanticZoomOwnerProperty As DependencyPropertypublic static DependencyProperty SemanticZoomOwnerProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the SemanticZoomOwner dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ShowsScrollingPlaceholders ShowsScrollingPlaceholders ShowsScrollingPlaceholders ShowsScrollingPlaceholders

Gets or sets a value that indicates whether the view shows placeholder UI for items during scrolling.

public bool ShowsScrollingPlaceholders { get; set; }public bool ShowsScrollingPlaceholders { get; set; }Public ReadWrite Property ShowsScrollingPlaceholders As boolpublic bool ShowsScrollingPlaceholders { get; set; }
<listViewBase ShowsScrollingPlaceholders="bool" />
Value
bool bool bool

true if the view shows placeholder UI for items during scrolling; otherwise, false. The default is true.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ShowsScrollingPlaceholdersProperty ShowsScrollingPlaceholdersProperty ShowsScrollingPlaceholdersProperty ShowsScrollingPlaceholdersProperty

Identifies the ShowsScrollingPlaceholders dependency property.

public static DependencyProperty ShowsScrollingPlaceholdersProperty { get; }public static DependencyProperty ShowsScrollingPlaceholdersProperty { get; }Public Static ReadOnly Property ShowsScrollingPlaceholdersProperty As DependencyPropertypublic static DependencyProperty ShowsScrollingPlaceholdersProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ShowsScrollingPlaceholders dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SingleSelectionFollowsFocus SingleSelectionFollowsFocus SingleSelectionFollowsFocus SingleSelectionFollowsFocus

Gets or sets a value that indicates whether item selection changes when keyboard focus changes.

public bool SingleSelectionFollowsFocus { get; set; }public bool SingleSelectionFollowsFocus { get; set; }Public ReadWrite Property SingleSelectionFollowsFocus As boolpublic bool SingleSelectionFollowsFocus { get; set; }
<listViewBase SingleSelectionFollowsFocus="bool" />
Value
bool bool bool

true if item selection changes when keyboard focus changes; otherwise, false. The default is true.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This property is ignored if the list view's SelectionMode property is not set to Single.

By default, when a list view is configured for single selection, when the user moves keyboard focus to an item, the focused item is also selected. For example, if keyboard focus is moved from the first item to the second item, the SelectedIndex property is updated from 0 to 1.

Set this property to false to let a user move focus without the item selection following. For example, if each selection change causes significant UI updates, you might prefer to let the user move focus to a non-adjacent item and then press enter to update selection.

Version compatibility

The SingleSelectionFollowsFocus property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this page, you must design and test your app to account for this. For more info, see Version adaptive code.

To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use it without performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this property before you set it.

<ListView x:Name="listView1" Loaded="ListView_Loaded"/>
private void ListView_Loaded(object sender, RoutedEventArgs e)
{
    if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ListViewBase", "SingleSelectionFollowsFocus"))
    {
        listView1.SingleSelectionFollowsFocus = false;
    }
}

SingleSelectionFollowsFocusProperty SingleSelectionFollowsFocusProperty SingleSelectionFollowsFocusProperty SingleSelectionFollowsFocusProperty

Identifies the SingleSelectionFollowsFocus dependency property.

public static DependencyProperty SingleSelectionFollowsFocusProperty { get; }public static DependencyProperty SingleSelectionFollowsFocusProperty { get; }Public Static ReadOnly Property SingleSelectionFollowsFocusProperty As DependencyPropertypublic static DependencyProperty SingleSelectionFollowsFocusProperty { get; }
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the SingleSelectionFollowsFocus dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

CompleteViewChange() CompleteViewChange() CompleteViewChange() CompleteViewChange()

Changes related aspects of presentation when the overall view for a ISemanticZoomInformation changes.

public void CompleteViewChange()public void CompleteViewChange()Public Function CompleteViewChange() As voidpublic void CompleteViewChange()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Controls derived from ListViewBase typically have an associated ScrollViewer as part of their template. The ListViewBase implementation of CompleteViewChange() perpetuates ScrollBarVisibility for any scroll bars across the views when the views change.

CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation) CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation) CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation) CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations that are related to a view change when the ListViewBase instance is the source view and the new view is a potentially different implementing view.

public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)Public Function CompleteViewChangeFrom(source As SemanticZoomLocation, destination As SemanticZoomLocation) As voidpublic void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
Parameters
source
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the source view.

destination
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the destination view.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation) CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation) CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation) CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations that are related to a view change when the ListViewBase instance is the destination view and the source view is a potentially different implementing view.

public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)Public Function CompleteViewChangeTo(source As SemanticZoomLocation, destination As SemanticZoomLocation) As voidpublic void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
Parameters
source
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the source view.

destination
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the destination view.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DeselectRange(ItemIndexRange) DeselectRange(ItemIndexRange) DeselectRange(ItemIndexRange) DeselectRange(ItemIndexRange)

Deselects a block of items described by the ItemIndexRange.

public void DeselectRange(ItemIndexRange itemIndexRange)public void DeselectRange(ItemIndexRange itemIndexRange)Public Function DeselectRange(itemIndexRange As ItemIndexRange) As voidpublic void DeselectRange(ItemIndexRange itemIndexRange)
Parameters
itemIndexRange
ItemIndexRange ItemIndexRange ItemIndexRange

Information about the range of items, including the index of the first and last items in the range, and the number of items.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

SelectRange(ItemIndexRange) and DeselectRange(ItemIndexRange) provide a more efficient way to modify the selection than using the SelectedItems property. When you select items using index ranges, use the SelectedRanges property to get all selected ranges in the list.

When you call DeselectRange(ItemIndexRange), all items in the specified range are deselected, regardless of their original selection state. You can deselect all items in a collection by using an ItemIndexRange with a FirstIndex value of 0 and a Length value equal to the number of items in the collection.

Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the list. Use the SelectedRanges property instead.

Examples

Here's how to deselect the first 9 items in a ListView named itemListView.

if (itemListView.SelectionMode == ListViewSelectionMode.Multiple ||
    itemListView.SelectionMode == ListViewSelectionMode.Extended)
{
    itemListView.DeselectRange(new ItemIndexRange(0, 9));
}

InitializeViewChange() InitializeViewChange() InitializeViewChange() InitializeViewChange()

Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a ISemanticZoomInformation is about to change.

public void InitializeViewChange()public void InitializeViewChange()Public Function InitializeViewChange() As voidpublic void InitializeViewChange()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Controls derived from ListViewBase typically have an associated ScrollViewer as part of their template. The ListViewBase implementation of InitializeViewChange() stores ScrollBarVisibility for current scroll bars, so that values can be perpetuated across the views when the views change.

IsDragSource() IsDragSource() IsDragSource() IsDragSource()

Returns a value that indicates whether the list view is both the drag source and drop target in a drag-and-drop operation.

public bool IsDragSource()public bool IsDragSource()Public Function IsDragSource() As boolpublic bool IsDragSource()
Returns
bool bool bool

true if the list view is both the drag source and drop target; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

For more info, see Drag and drop.

Version compatibility

The IsDragSource() method is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this page, you must design and test your app to account for this. For more info, see Version adaptive code.

To avoid exceptions when your app runs on previous versions of Windows 10, do not call this method without first performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this method before you use it.

if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.ListViewBase", "IsDragSource"))
{
    bool isDragSource = listView1.IsDragSource();
}

LoadMoreItemsAsync() LoadMoreItemsAsync() LoadMoreItemsAsync() LoadMoreItemsAsync()

Initiates the asynchronous request to load more data items, in accordance with the active incremental loading settings.

public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync()public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync()Public Function LoadMoreItemsAsync() As IAsyncOperation( Of LoadMoreItemsResult )public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync()
Returns

When the operation completes, returns a LoadMoreItemsResult payload.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

MakeVisible(SemanticZoomLocation) MakeVisible(SemanticZoomLocation) MakeVisible(SemanticZoomLocation) MakeVisible(SemanticZoomLocation)

Forces content in the view to scroll until the item that's specified by SemanticZoomLocation is visible. Also focuses the item if it finds the item.

public void MakeVisible(SemanticZoomLocation item)public void MakeVisible(SemanticZoomLocation item)Public Function MakeVisible(item As SemanticZoomLocation) As voidpublic void MakeVisible(SemanticZoomLocation item)
Parameters
item
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The item in the view to scroll to.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You use the MakeVisible(SemanticZoomLocation) method to bring an item into view when the ListViewBase control is used as a view in a SemanticZoom control. To bring an item into view when the ListViewBase control is not used in a SemanticZoom, use the ScrollIntoView(Object, ScrollIntoViewAlignment) method instead.

PrepareConnectedAnimation(String, Object, String) PrepareConnectedAnimation(String, Object, String) PrepareConnectedAnimation(String, Object, String) PrepareConnectedAnimation(String, Object, String)

Prerelease. Returns a connected animation that's associated with the specified key, data item, and source element.

public ConnectedAnimation PrepareConnectedAnimation(String key, Object item, String elementName)public ConnectedAnimation PrepareConnectedAnimation(String key, Object item, String elementName)Public Function PrepareConnectedAnimation(key As String, item As Object, elementName As String) As ConnectedAnimationpublic ConnectedAnimation PrepareConnectedAnimation(String key, Object item, String elementName)
Parameters
key
System.String System.String System.String

The key for the animation.

item
System.Object System.Object System.Object

The data item that is animated out of view.

elementName
System.String System.String System.String

The name of the element in the ItemTemplate that provides the animated visual.

Returns

The animation with the specified key.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ScrollIntoView(Object) ScrollIntoView(Object) ScrollIntoView(Object) ScrollIntoView(Object)

Scrolls the list to bring the specified data item into view.

public void ScrollIntoView(Object item)public void ScrollIntoView(Object item)Public Function ScrollIntoView(item As Object) As voidpublic void ScrollIntoView(Object item)
Parameters
item
System.Object System.Object System.Object

The data item to bring into view.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You use the ScrollIntoView(Object, ScrollIntoViewAlignment) method to bring an item into view when the ListViewBase control is not used as a view in a SemanticZoom control. To bring an item into view when the ListViewBase control is used in a SemanticZoom, use the MakeVisible(SemanticZoomLocation) method instead.

When the contents of the ItemsSource collection changes, particularly if many items are added to or removed from the collection, you might need to call UpdateLayout() prior to calling ScrollIntoView(Object, ScrollIntoViewAlignment) for the specified item to scroll into the viewport.

ScrollIntoView(Object, ScrollIntoViewAlignment) ScrollIntoView(Object, ScrollIntoViewAlignment) ScrollIntoView(Object, ScrollIntoViewAlignment) ScrollIntoView(Object, ScrollIntoViewAlignment)

Scrolls the list to bring the specified data item into view with the specified alignment.

public void ScrollIntoView(Object item, ScrollIntoViewAlignment alignment)public void ScrollIntoView(Object item, ScrollIntoViewAlignment alignment)Public Function ScrollIntoView(item As Object, alignment As ScrollIntoViewAlignment) As voidpublic void ScrollIntoView(Object item, ScrollIntoViewAlignment alignment)
Parameters
item
System.Object System.Object System.Object

The data item to bring into view.

alignment
ScrollIntoViewAlignment ScrollIntoViewAlignment ScrollIntoViewAlignment

An enumeration value that specifies whether the item uses Default or Leading alignment.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You use the ScrollIntoView(Object, ScrollIntoViewAlignment) method to bring an item into view when the ListViewBase control is not used as a view in a SemanticZoom control. To bring an item into view when the ListViewBase control is used in a SemanticZoom, use the MakeVisible(SemanticZoomLocation) method instead.

When the contents of the ItemsSource collection changes, particularly if many items are added to or removed from the collection, you might need to call UpdateLayout() prior to calling ScrollIntoView(Object, ScrollIntoViewAlignment) for the specified item to scroll into the viewport.

SelectAll() SelectAll() SelectAll() SelectAll()

Selects all the items in a view.

public void SelectAll()public void SelectAll()Public Function SelectAll() As voidpublic void SelectAll()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Warning

Call the SelectAll() method only when the SelectionMode property is set to ListViewSelectionMode or ListViewSelectionMode. If you call SelectAll() when the SelectionMode is Single or None, an exception is thrown.

Starting in Windows 10, you can use the SelectRange(ItemIndexRange) and DeselectRange(ItemIndexRange) methods with the SelectedRanges property to make selections using ranges of indexes. This is a more efficient way to describe item selection than using SelectedItems, which requires the actual item object to be created for each selected item. To select all items using index ranges, use SelectRange(ItemIndexRange).

Examples

if (itemGridView->SelectionMode == ListViewSelectionMode::Multiple ||
    itemGridView->SelectionMode == ListViewSelectionMode::Extended)
{
    itemGridView->SelectAll();
}
if (itemGridView.SelectionMode == ListViewSelectionMode.Multiple ||
    itemGridView.SelectionMode == ListViewSelectionMode.Extended)
{
    itemGridView.SelectAll();
}
If itemGridView.SelectionMode = ListViewSelectionMode.Multiple OrElse
   itemGridView.SelectionMode = ListViewSelectionMode.Extended Then

   itemGridView.SelectAll()
End If

SelectRange(ItemIndexRange) SelectRange(ItemIndexRange) SelectRange(ItemIndexRange) SelectRange(ItemIndexRange)

Selects a block of items described by the ItemIndexRange.

public void SelectRange(ItemIndexRange itemIndexRange)public void SelectRange(ItemIndexRange itemIndexRange)Public Function SelectRange(itemIndexRange As ItemIndexRange) As voidpublic void SelectRange(ItemIndexRange itemIndexRange)
Parameters
itemIndexRange
ItemIndexRange ItemIndexRange ItemIndexRange

Information about the range of items, including the index of the first and last items in the range, and the number of items.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

SelectRange(ItemIndexRange) and DeselectRange(ItemIndexRange) provide a more efficient way to modify the selection than using the SelectedItems property. When you select items using index ranges, use the SelectedRanges property to get all selected ranges in the list.

When you call SelectRange(ItemIndexRange), all items in the specified range are selected, regardless of their original selection state. You can select all items in a collection by using an ItemIndexRange with a FirstIndex value of 0 and a Length value equal to the number of items in the collection.

Warning

Call the SelectRange(ItemIndexRange) method only when the SelectionMode property is set to ListViewSelectionMode or ListViewSelectionMode. If you call SelectRange(ItemIndexRange) when the SelectionMode is Single or None, an exception is thrown.

Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the list. Use the SelectedRanges property instead.

Examples

Here's how to select the first 9 items in a ListView named itemListView.

if (itemListView.SelectionMode == ListViewSelectionMode.Multiple ||
    itemListView.SelectionMode == ListViewSelectionMode.Extended)
{
    itemListView.SelectRange(new ItemIndexRange(0, 9));
}

SetDesiredContainerUpdateDuration(TimeSpan) SetDesiredContainerUpdateDuration(TimeSpan) SetDesiredContainerUpdateDuration(TimeSpan) SetDesiredContainerUpdateDuration(TimeSpan)

Sets the maximum target time between two render passes when a ListViewBase is updating its UI with data items during initial load or scrolling.

public void SetDesiredContainerUpdateDuration(TimeSpan duration)public void SetDesiredContainerUpdateDuration(TimeSpan duration)Public Function SetDesiredContainerUpdateDuration(duration As TimeSpan) As voidpublic void SetDesiredContainerUpdateDuration(TimeSpan duration)
Parameters
duration
TimeSpan TimeSpan TimeSpan

The maximum target time between two render passes.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation) StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation) StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation) StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations that are related to a view change when the ListViewBase instance is the source view and the pending destination view is a potentially different implementing view.

public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)Public Function StartViewChangeFrom(source As SemanticZoomLocation, destination As SemanticZoomLocation) As voidpublic void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
Parameters
source
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the source view.

destination
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the destination view.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation) StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation) StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation) StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations that are related to a view change when the source view is a different view and the pending destination view is the ListViewBase instance.

public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)Public Function StartViewChangeTo(source As SemanticZoomLocation, destination As SemanticZoomLocation) As voidpublic void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
Parameters
source
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the source view.

destination
SemanticZoomLocation SemanticZoomLocation SemanticZoomLocation

The view item as represented in the destination view.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String) TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String) TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String) TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String)

Prerelease. Attempts to start the animation.

public IAsyncOperation<bool> TryStartConnectedAnimationAsync(ConnectedAnimation animation, Object item, String elementName)public IAsyncOperation<bool> TryStartConnectedAnimationAsync(ConnectedAnimation animation, Object item, String elementName)Public Function TryStartConnectedAnimationAsync(animation As ConnectedAnimation, item As Object, elementName As String) As IAsyncOperation( Of bool )public IAsyncOperation<bool> TryStartConnectedAnimationAsync(ConnectedAnimation animation, Object item, String elementName)
Parameters
animation
ConnectedAnimation ConnectedAnimation ConnectedAnimation

The animation to start.

item
System.Object System.Object System.Object

The data item that is animated into view.

elementName
System.String System.String System.String

The name of the element in the ItemTemplate that provides the animated visual.

Returns

true if the animation started; false if the animation has already been started, if it is no longer active, or if the destination element is the same as the source element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Events

ChoosingGroupHeaderContainer ChoosingGroupHeaderContainer ChoosingGroupHeaderContainer ChoosingGroupHeaderContainer

Occurs when an item container is to be chosen for a data group.

public event TypedEventHandler ChoosingGroupHeaderContainerpublic event TypedEventHandler ChoosingGroupHeaderContainerPublic Event ChoosingGroupHeaderContainerpublic event TypedEventHandler ChoosingGroupHeaderContainer
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You typically handle this event to enable accessibility. The group headers do not have an accessible name set by default. This event provides access to the header instance and lets you to set the NameProperty attached property to an appropriate value.

ChoosingItemContainer ChoosingItemContainer ChoosingItemContainer ChoosingItemContainer

Occurs when an item container is to be chosen for a data item.

public event TypedEventHandler ChoosingItemContainerpublic event TypedEventHandler ChoosingItemContainerPublic Event ChoosingItemContainerpublic event TypedEventHandler ChoosingItemContainer
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This event is raised only if the list or grid's ItemsPanel is an ItemsStackPanel or ItemsWrapGrid. If you replace the ItemsPanel with another panel, the event is not raised.

ContainerContentChanging ContainerContentChanging ContainerContentChanging ContainerContentChanging

Occurs when the data item associated with a UI container changes.

public event TypedEventHandler ContainerContentChangingpublic event TypedEventHandler ContainerContentChangingPublic Event ContainerContentChangingpublic event TypedEventHandler ContainerContentChanging
<listViewBase ContainerContentChanging="eventhandler" />
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This event is raised only if the list or grid's ItemsPanel is an ItemsStackPanel or ItemsWrapGrid. If you replace the ItemsPanel with another panel, the event is not raised.

For info and examples, see the Update ListView and GridView items incrementally section of Optimize ListView and GridView.

For more examples, download the XAML GridView grouping and SemanticZoom sample.

DragItemsCompleted DragItemsCompleted DragItemsCompleted DragItemsCompleted

Occurs when a drag operation that involves one of the items in the view is ended.

public event TypedEventHandler DragItemsCompletedpublic event TypedEventHandler DragItemsCompletedPublic Event DragItemsCompletedpublic event TypedEventHandler DragItemsCompleted
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DragItemsStarting DragItemsStarting DragItemsStarting DragItemsStarting

Occurs when a drag operation that involves one of the items in the view is initiated.

public event DragItemsStartingEventHandler DragItemsStartingpublic event DragItemsStartingEventHandler DragItemsStartingPublic Event DragItemsStartingpublic event DragItemsStartingEventHandler DragItemsStarting
<listViewBase DragItemsStarting="eventhandler" />
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This event occurs when you start a drag-and-drop operation, including when you perform a reorder operation by drag-and-drop. When you perform custom actions as a result of a drag-and-drop operation, you typically listen to this event and provide more data using the Data property.

You can inspect the items being dragged by checking the Items property.

You can cancel the drag operation by setting the Cancel property to true.

ItemClick ItemClick ItemClick ItemClick

Occurs when an item in the list view receives an interaction, and the IsItemClickEnabled property is true.

public event ItemClickEventHandler ItemClickpublic event ItemClickEventHandler ItemClickPublic Event ItemClickpublic event ItemClickEventHandler ItemClick
<listViewBase ItemClick="eventhandler" />
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

If the list view is one of the views in a SemanticZoom, selection entails additional behavior that might change between the views. This behavior is built in to the ListViewBase class, not the@Windows.UI.Xaml.Controls.SemanticZoom class.