Search code examples
visual-studiolistviewwindows-8listboxmicrosoft-metro

Difference between ListView and ListBox in Visual Studio


What is the difference between "ListView" and "ListBox" in a "Windows 8" app.


Solution

  • The ListBox is an older control primarily for compatibility with other xaml frameworks. The ListView has build-in functionality for touch etc. Use the ListView unless you have a specific need for the ListBox

    See here for more detail.

    Specific events available only for ListView:

    DragItemsStarting

    ItemClick

    Methods:

    CompleteViewChange

    CompeteViewChangeFrom

    CompleteViewChangeTo

    InitializeViewChange

    LoadMoreItemsAsync

    MakeVisible

    ScrollIntoView(Object, ScrollIntoViewAlignment)

    StartViewChangeFrom

    StartViewChangeTo

    Properties:

    CanDragItems

    CanDragItemsProperty

    CanReorderItems

    CanReorderItemsProperty

    DataFetchSize

    DataFetchSizeProperty

    Header

    HeaderProperty

    HeadTemplate

    HeaderTemplateProperty

    HeadTransitions

    HeadTransitionsProperty

    IncrementalLoadingThreshold

    IncrementalLoadingThresholdProperty

    IncrementalLoadingTrigger

    IncrementalLoadingTriggerProperty

    IsActiveView

    IsActiveViewProperty

    IsItemClickEnabled

    IsItemClickEnabledProperty

    IsSwipeEnabled

    IsSwipeEnabledProperty

    IsZoomedInView

    IsZoomedInViewProperty