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 8649897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:40:26+00:00 2026-06-12T13:40:26+00:00

Suppose I have a variable number of static image resources that I would like

  • 0

Suppose I have a variable number of static image resources that I would like to show rapidly.

So I have an INotifyPropertyChanged class with

for (blah)
    bitMaps.Add(new BitmapImage(new Uri(blah + i + ".png")));

in a list and a property to get the images

public ImageSource Image
{
    get
    {
        return bitMaps[Index];
    }
}

along with

public int Index
{
    set
    {
        _Index = value;
        OnPropertyChanged("Image");
    }
}

so that I can change the displayed image by changing Index.

I then have a bound Image tag <Image Source="{Binding Image}" Stretch="None" /> to display it.

But despite seemingly loading the bitmap images initially, the transitions when changing Index still flickers on the first time leading me to thing that the BitmapImage are lazy loading. Is there a better/more performant way of doing this? Or how can I pre-load the images properly?

Update: I ended up just creating a user control with all the Image tags created and invisible…

  • 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-06-12T13:40:28+00:00Added an answer on June 12, 2026 at 1:40 pm

    You will always get that flicker when modifying the source of the Image. If you want to have the images preloaded, then you can put them in the Visual Tree. My first recommendation is using a FlipView like this:

    <FlipView ItemSource="{Binding Bitmaps}" SelectedIndex="{Binding Index}">
        <FlipView.ItemTemplate>
            <DataTemplate>
                <Image Source="{Binding}" />
            </DataTemplate>
        </FlipView.ItemTemplate>
    </FlipView>
    

    When you change the index, the FlipView will show the next/previous image, which is already preloaded.

    If you have hundreds of images, then write your own custom control that cycles through images.

    But either way, if you change the source of an image, there will be a gap between discarding the old bitmap and rendering the new bitmap.

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

Sidebar

Related Questions

Suppose that I have an integer variable in a class, and this variable may
Suppose I have two classes that both contain a static variable, XmlTag. The second
Let's suppose I have n arrays, where n is a variable (some number greater
Suppose I have a static variable declared inside a function in C. If I
Suppose I have a program that initializes a global variable for use by threads,
Suppose I have a class Foo , with a private variable bar_ containing some
Suppose I have the number 13.57916667 in a variable $hours. This is a calculated
Suppose I have a class with a constructor (or other function) that takes a
Suppose I have some text files (f1.txt, f2.txt, ...) that looks something like @article
i would like given an array in javascript and a number variable to create

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.