ListViewBase ListViewBase ListViewBase Class

Provides the infrastructure for the ListView and GridView classes.

Syntax

Declaration

public class ListViewBasepublic class ListViewBasePublic Class ListViewBase

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

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.

Properties summary

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

Identifies the CanDragItems dependency property.

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

Identifies the CanReorderItems dependency property.

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

Identifies the DataFetchSize dependency property.

Gets or sets the content for the list footer.

Identifies the Footer dependency property.

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

Identifies the FooterTemplate dependency property.

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

Identifies the FooterTransitions dependency property.

Gets or sets the content for the list header.

Identifies the Header dependency property.

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

Identifies the HeaderTemplate dependency property.

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

Identifies the HeaderTransitions dependency property.

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

Identifies the IncrementalLoadingThreshold dependency property.

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

Identifies the IncrementalLoadingTrigger dependency property.

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

Identifies the IsActiveView dependency property.

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

Identifies the IsItemClickEnabled dependency property.

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

Get the identifier for the IsMultiSelectCheckBoxEnabled dependency property.

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

Identifies the IsSwipeEnabled dependency property.

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

Identifies the IsZoomedInView dependency property.

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

Identifies the ReorderMode dependency property.

Gets the currently selected items.

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

Gets or sets the selection behavior for a ListViewBase instance.

Identifies the SelectionMode dependency property.

Gets or sets the SemanticZoom instance that hosts the ListViewBase.

Identifies the SemanticZoomOwner dependency property.

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

Identifies the ShowsScrollingPlaceholders dependency property.

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

Identifies the SingleSelectionFollowsFocus dependency property.

Methods summary

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

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.

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.

Deselects a block of items described by the ItemIndexRange.

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.

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

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

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.

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

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

Selects all the items in a view.

Selects a block of items described by the ItemIndexRange.

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

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.

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.

Events summary

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

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

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

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

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

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

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 bool
    <listViewBase CanDragItems="bool" />
    

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

  • 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 bool
    <listViewBase CanReorderItems="bool" />
    

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

  • 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 double
    <listViewBase DataFetchSize="double" />
    

    Property Value

    • double
      double
      double

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

  • 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 DependencyProperty

    Property Value

  • 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 DependencyProperty

    Property Value

  • 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 DataTemplate
    <listViewBase FooterTemplate="resourceReferenceToDataTemplate"/>
    

    Property Value

  • 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 DependencyProperty

    Property Value

  • 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 TransitionCollection
    <listViewBase>
      <listViewBase.FooterTransitions>
        <TransitionCollection>
          oneOrMoreTransitions
        </TransitionCollection>
      </listViewBase.FooterTransitions>
    </listViewBase>
    

    Property Value

    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 DependencyProperty

    Property Value

  • 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 object
    <listViewBase Header="headerString"/>
    
    

    Property Value

    • object
      object
      object

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

    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 DependencyProperty

    Property Value

  • 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 DataTemplate
    <listViewBase HeaderTemplate="resourceReferenceToDataTemplate"/>
    

    Property Value

  • 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 DependencyProperty

    Property Value

  • 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 TransitionCollection
    <listViewBase>
      <listViewBase.HeaderTransitions>
        <TransitionCollection>
          oneOrMoreTransitions
        </TransitionCollection>
      </listViewBase.HeaderTransitions>
    </listViewBase>
    

    Property Value

    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 DependencyProperty

    Property Value

  • 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 double
    <listViewBase IncrementalLoadingThreshold="double" />
    

    Property Value

    • double
      double
      double

      The loading threshold, in terms of pages.

    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 DependencyProperty

    Property Value

  • 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 IncrementalLoadingTrigger
    <listViewBase IncrementalLoadingTrigger="None" />
    -or-
    <listViewBase IncrementalLoadingTrigger="Edge" />
    

    Property Value

  • 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 DependencyProperty

    Property Value

  • 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 bool

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

  • 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 bool
    <listViewBase IsItemClickEnabled="bool" />
    

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

  • 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 bool

    Property Value

    • bool
      bool
      bool

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

  • 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 DependencyProperty

    Property Value

  • 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 bool
    <listViewBase IsSwipeEnabled="bool" .../>
    

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

  • 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 bool

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

  • 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 ListViewReorderMode
    <listViewBase ReorderMode="Enabled"/>
    -or-
    <listViewBase ReorderMode="Disabled"/>
    

    Property Value

  • 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 DependencyProperty

    Property Value

  • 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>

    Property Value

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

    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(Windows.UI.Xaml.Data.ItemIndexRange) and DeselectRange(Windows.UI.Xaml.Data.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>

    Property Value

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

    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(Windows.UI.Xaml.Data.ItemIndexRange) and DeselectRange(Windows.UI.Xaml.Data.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 ListViewSelectionMode
    <listViewBase SelectionMode="listViewSelectionModeMemberName" />
    

    Property Value

    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 DependencyProperty

    Property Value

  • 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 SemanticZoom

    Property Value

    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 DependencyProperty

    Property Value

  • 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 bool
    <listViewBase ShowsScrollingPlaceholders="bool" />
    

    Property Value

    • bool
      bool
      bool

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

  • 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 DependencyProperty

    Property Value

  • 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 bool
    <listViewBase SingleSelectionFollowsFocus="bool" />
    

    Property Value

    • bool
      bool
      bool

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

    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 DependencyProperty

    Property Value

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 void

    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(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    CompleteViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    CompleteViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    CompleteViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)public void CompleteViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)Public Function CompleteViewChangeFrom(source As Windows.UI.Xaml.Controls.SemanticZoomLocation,destination As Windows.UI.Xaml.Controls.SemanticZoomLocation) As void

    Parameters

  • CompleteViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    CompleteViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    CompleteViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    CompleteViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)public void CompleteViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)Public Function CompleteViewChangeTo(source As Windows.UI.Xaml.Controls.SemanticZoomLocation,destination As Windows.UI.Xaml.Controls.SemanticZoomLocation) As void

    Parameters

  • DeselectRange(Windows.UI.Xaml.Data.ItemIndexRange)
    DeselectRange(Windows.UI.Xaml.Data.ItemIndexRange)
    DeselectRange(Windows.UI.Xaml.Data.ItemIndexRange)
    DeselectRange(Windows.UI.Xaml.Data.ItemIndexRange)

    Deselects a block of items described by the ItemIndexRange.

    public void DeselectRange(Windows.UI.Xaml.Data.ItemIndexRange itemIndexRange)public void DeselectRange(Windows.UI.Xaml.Data.ItemIndexRange itemIndexRange)Public Function DeselectRange(itemIndexRange As Windows.UI.Xaml.Data.ItemIndexRange) As void

    Parameters

    Remarks

    SelectRange(Windows.UI.Xaml.Data.ItemIndexRange) and DeselectRange(Windows.UI.Xaml.Data.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(Windows.UI.Xaml.Data.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 void

    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 bool

    Returns

    • bool
      bool
      bool

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

    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 )

    Returns

  • MakeVisible(Windows.UI.Xaml.Controls.SemanticZoomLocation)
    MakeVisible(Windows.UI.Xaml.Controls.SemanticZoomLocation)
    MakeVisible(Windows.UI.Xaml.Controls.SemanticZoomLocation)
    MakeVisible(Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.SemanticZoomLocation item)public void MakeVisible(Windows.UI.Xaml.Controls.SemanticZoomLocation item)Public Function MakeVisible(item As Windows.UI.Xaml.Controls.SemanticZoomLocation) As void

    Parameters

    Remarks

    You use the MakeVisible(Windows.UI.Xaml.Controls.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(System.Object,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment) method instead.

  • ScrollIntoView(System.Object)
    ScrollIntoView(System.Object)
    ScrollIntoView(System.Object)
    ScrollIntoView(System.Object)

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

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

    Parameters

    • item
      System.Object
      System.Object
      System.Object

      The data item to bring into view.

    Remarks

    You use the ScrollIntoView(System.Object,Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.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(System.Object,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment) for the specified item to scroll into the viewport.

  • ScrollIntoView(System.Object,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment)
    ScrollIntoView(System.Object,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment)
    ScrollIntoView(System.Object,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment)
    ScrollIntoView(System.Object,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment)

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

    public void ScrollIntoView(System.Object item,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment alignment)public void ScrollIntoView(System.Object item,Windows.UI.Xaml.Controls.ScrollIntoViewAlignment alignment)Public Function ScrollIntoView(item As System.Object,alignment As Windows.UI.Xaml.Controls.ScrollIntoViewAlignment) As void

    Parameters

    Remarks

    You use the ScrollIntoView(System.Object,Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.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(System.Object,Windows.UI.Xaml.Controls.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 void

    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(Windows.UI.Xaml.Data.ItemIndexRange) and DeselectRange(Windows.UI.Xaml.Data.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(Windows.UI.Xaml.Data.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(Windows.UI.Xaml.Data.ItemIndexRange)
    SelectRange(Windows.UI.Xaml.Data.ItemIndexRange)
    SelectRange(Windows.UI.Xaml.Data.ItemIndexRange)
    SelectRange(Windows.UI.Xaml.Data.ItemIndexRange)

    Selects a block of items described by the ItemIndexRange.

    public void SelectRange(Windows.UI.Xaml.Data.ItemIndexRange itemIndexRange)public void SelectRange(Windows.UI.Xaml.Data.ItemIndexRange itemIndexRange)Public Function SelectRange(itemIndexRange As Windows.UI.Xaml.Data.ItemIndexRange) As void

    Parameters

    Remarks

    SelectRange(Windows.UI.Xaml.Data.ItemIndexRange) and DeselectRange(Windows.UI.Xaml.Data.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(Windows.UI.Xaml.Data.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(Windows.UI.Xaml.Data.ItemIndexRange) method only when the SelectionMode property is set to ListViewSelectionMode or ListViewSelectionMode. If you call SelectRange(Windows.UI.Xaml.Data.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(Windows.Foundation.TimeSpan)
    SetDesiredContainerUpdateDuration(Windows.Foundation.TimeSpan)
    SetDesiredContainerUpdateDuration(Windows.Foundation.TimeSpan)
    SetDesiredContainerUpdateDuration(Windows.Foundation.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(Windows.Foundation.TimeSpan duration)public void SetDesiredContainerUpdateDuration(Windows.Foundation.TimeSpan duration)Public Function SetDesiredContainerUpdateDuration(duration As Windows.Foundation.TimeSpan) As void

    Parameters

  • StartViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    StartViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    StartViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    StartViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)public void StartViewChangeFrom(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)Public Function StartViewChangeFrom(source As Windows.UI.Xaml.Controls.SemanticZoomLocation,destination As Windows.UI.Xaml.Controls.SemanticZoomLocation) As void

    Parameters

  • StartViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    StartViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    StartViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.SemanticZoomLocation)
    StartViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation,Windows.UI.Xaml.Controls.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(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)public void StartViewChangeTo(Windows.UI.Xaml.Controls.SemanticZoomLocation source,Windows.UI.Xaml.Controls.SemanticZoomLocation destination)Public Function StartViewChangeTo(source As Windows.UI.Xaml.Controls.SemanticZoomLocation,destination As Windows.UI.Xaml.Controls.SemanticZoomLocation) As void

    Parameters

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 ChoosingGroupHeaderContainer

    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 ChoosingItemContainer

    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 ContainerContentChanging
    <listViewBase ContainerContentChanging="eventhandler" />
    

    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 DragItemsCompleted
  • 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 DragItemsStarting
    <listViewBase DragItemsStarting="eventhandler" />
    

    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 ItemClick
    <listViewBase ItemClick="eventhandler" />
    

    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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ComposableAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll