The scroll viewer lags for a second when there is lot of data in silverlight - silverlight-5.0

I have a Grid and there are 7 columns and 6 rows. And there is listbox added for each row and column combination. Each list box is having arround 5 items (as default is 5, not increase above that). Each listbox item is having complex template. If i bind whole data then it takes 4 to 5 second to load. So to make fast loading, i am binding only that listbox which is visible on screen. so now it loads fast within a second. But when i scroll down, then the another data loads. But the scroll viewer lags for a second. So how can i scroll smothely ?
Any idea ?

Related

SwiftUI Tell the # of columns assigned in an adaptive LazyVGrid?

Is there a way to tell the # of columns that are created in a SwiftUI Adaptive Grid? For example the left view with an iPhone 14 Pro has 4 buttons across, while an iPhone 12 mini on the right fits 3 buttons.
If I can tell the # of items, then I can tell if there are fewer items than can be displayed on a full screen, then create a LazyHStack for the % resulting leftover items which presents the additional items centered. The smaller iPhone with 3 buttons across shows the effect I'm trying to achieve - which I can do if I fix GridItems to 3 columns. I'd like this to be dynamic so, for example, I can tell I have 3 of 4 buttons across & can put them all in the single, centered LazyHStack of my last column.
Thanks for advice!

Flutter- How to render all items in the listview.builder at once and only once

I have a problem in flutter in listview.builder where it only renders the shown items, not all of them (even if they were not shown), and when I scroll down or up it renders the not shown items and re-renders the already rendered items.
It's not actually a problem, It's good for the phone memory to only render the shown items, but for me, it's a problem, because it's difficult for me to do some manipulations on the items.
the manipulations are like getting data from every item like the price of the item if it was higher than $100 and then printing the total amount of them on the bottom of the screen.
I can't do this one, because it doesn't show all of the items to get the data from them, and when I scroll down, it gets the data from the not shown items, but when I scroll back up, it gets the data from the already shown items again !
for Example, if the shown items have this data = 300, and the not shown items have this data = 800, at first it will get 300, and when I scroll down, it will get 1100, but when I get back up, it will get 1400
I really want to fix this problem, it's holding me back from finishing my project.
Thank you so much for your time.
I solved the problem by only putting Listview.builder in SingleChildScrollView, and that solved all the problems.

iCarousel type linear, breaks UI

When I use iCarousel type linear, and wrap is true. I am getting an UI like below:
The problem, I am facing is at the top the number 998 UI is broken, but I want visible 998 number without increasing iCarousel height. So, how can I achieve this? and one more thing I don't bother about UI might break for number 2, if I want a visible 998 number.
There are two reasons why your carousel item is cut off:
1) Your carousel view is not vertically centered in the window. If you center it, 0 will be dead centre and 998 and 2 will both be cut off, but equally
2) You need to set the item view size to exactly fit your view. You're currently using the default images that come with the example project which are 200x200 pixels in size. Presumably you will eventually replace these with your own views. When you do, make sure the size of those views is an exact division of the height of your window, so for example if your windows is 1024 pixels high, and you want to show 5 views, then they need to be 1024/5 pixels high (204.8 px). Obviously that's not a nice number, but you can make them a bit smaller so that they are a nice round number and then adding some spacing between them using the carousel delegate method.

Grid does not animate from collapsed to visible

I'm currently trying to make a grid that animates from collapsed -> visible to notify the user that the save has been completed. In Blend 4 I opened the project and created a usercontrol for the SaveNotifier so I can use it in other areas of this project and others. I created the default to be collapsed and also created another state called "Complete" which has visibility set to Visible and has a timetrigger of 3 seconds which sends it back to the default state. The transitions are set to transition over 1 second and use fluidlayout to show the animation between the states, but it does not show the animation between states. Instead it just shows it as if there was no fluidlayout or transition time.
If someone would be so kind as to let me know if there is a problem with trying to do this or even show me how to do this it would be gre
Not sure why, but when I put the grid inside of a new grid it started working. Seems as if you need to have a grid to be the full size for the animation to display.

How to display scrollbar for a list view whose contents keep changing?

I have a ListView-like control that displays a list of items of various heights. The contents of the list, and the heights of the items can change – a background thread is populating the list and calculating the layout of each item, possibly even while the user is scrolling the content.
Which brings me to my question: How do I display a useful vertical scrollbar for this view? I’ve seen cases (notably web browsers) where the slider “jumps away” from the mouse cursor while the user is dragging it, the result of the underlying content growing in height. I don’t want that.
So far
Instead of the slider representing the viewport height relative to the content height, maybe it could represent a point in a timeline instead? (The items are sorted by timestamp). This would at least prevent the scrollbar from changing as item layouts are calculated.
Get rid of the scrollbar altogether and use a forward/backward rocker switch like the one used in Picasa (the further the slider is pulled upwards or downwards, the faster the view is scrolled, until the user releases the slider). If I take this route, are there any controls you can recommend?
I am using Qt, but this applies to UI design in general.
IMO the fundamental problem with a classic scrollbar is that due to background population, the valid range is changing - and thus, the meaning of a scrollbar position changes.
If you can predict the full range of items, you can still provide a scrollbar and replace yet-unknown items with "loading...".
Otherwise, a rocker (is that an official name?) would be the next best thing to use.
However, since you have a dedicated scale (timeline), it might be better to have separate buttons that jump a dedicated time (e.g. one minute, one hour, one day, ..). For a fancier look, you could create a rocker with "hot" areas that jump for a specific time, whereas the areas inbetween are interpolated (linear or or logarithmic, depending on the scale to cover).
i.e. line this (drawing just the "backward" half):
--------------------------
|##|XXXXXXX|##|XXXXXXX|##|
--------------------------
-1h -1m -1s