Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6913413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:12:58+00:00 2026-05-27T09:12:58+00:00

I changed the control template of my ListView to look like this: <Border BorderBrush={TemplateBinding

  • 0

I changed the control template of my ListView to look like this:

<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
    <ScrollViewer Background="{TemplateBinding Background}"
                      VerticalScrollBarVisibility="Auto"
                      Padding="{TemplateBinding Padding}" Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}"
                  VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"
                  ScrollViewer.IsDeferredScrollingEnabled="True">
        <StackPanel>
            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
            <Border x:Name="FillerView" BorderThickness="0"/>
        </StackPanel>

    </ScrollViewer>
</Border>

The reason for this is, that I want the alternating coloration of the ListView to continue. This is done via trigger for the FillerView Border. If I remove the Stackpanel and the border Fillerview from this template my ListView is virtualizing normally and very fast. If I have it in there it is incredibly slow.

Can anyone tell my why the virtualizing does not work when I use the template above? Oh and I can not move the Border FillerView out of the Scrollviewer because I want the bottom scrollbar to be below the filler.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:12:58+00:00Added an answer on May 27, 2026 at 9:12 am

    Virtualizing doesn’t work because virtualization requires that the ItemsPanel of the ItemsPresenter is measured with an actual available size. In your case you have a StackPanel as the Content of the ScrollViewer and that will be the IScrollInfo for the ScrollViewer. Now because StackPanel measures its children with infinity in the direction of the arrangement that means it will measure your ItemsPresenter with an infinite height so it would not be possible for the ItemsPanel (which would be the child of the ItemsPresenter) to know the actual available height so it could not virtualize.

    I’m not sure what you mean about the alternating coloration of the listview. If you’re talking about alternating background of the items within the listview then normally one would use the AlternationConverter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've defined a control Template for a progressbar to make it look like a
I have a custom control that is derived from ListView . This list view
OK, so, I have a ListView-derived control that changes Grouping and ItemsSource on the
I would like to create a custom WPF control that inherits from comboBox. So
I implemented the template.master technique described by Brad Wilson in this posting but I
The control resets to the standard ListView in the designer when I declare a
Ive already been through about 30 different posts and changed how I handle this
I have a page where I want to display images in a control Template.
I have a control template defined, call it myVal, that is used for validation
I have a Control Template for Progress Bar in my Resource Dictionary. Complete code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.