iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello Crosslight Support,
I have a question about images in a list view cell. I have a simple list and I use one of the predefined templates to display a list item with an image and two texts. Initially displaying the list works fine.
The displayed image and the texts of the list items are set via data binding. In the view model of the list view I have a timer and under certain conditions I want to change some images of the list items matching these conditions. To do this I call the setter of the image property, set a new image and do a property changed, but the images don't change within the list view. Normally, after doing property change there is call of the getter of the belonging property. This is not the case.
So, isn't it possible to update the image of a list view item or am I doing something wrong.
As always, thanks for your support.
Thomas
I created a project by using Master Detail project template; and add following code in order to simulate the scenario: to change some images of the list items using timer.
IViewService viewService = this.GetService<IViewService>(); if (viewService != null) { viewService.RunOnBackgroundThread(() => { Item firstItem = this.Items.FirstOrDefault(); firstItem.ThumbnailImage = null; }, 5000); }
The above code will set the ThumbnailImage to null for the first item of ListView after 5 second.
In order to update the image, simply call OnDataChanged(object) method after set the changes.
if (viewService != null) { viewService.RunOnBackgroundThread(() => { Item firstItem = this.Items.FirstOrDefault(); firstItem.ThumbnailImage = null; this.OnDataChanged(firstItem); }, }
Note: the above changes are made in the constructor of ItemListViewModel of Core project in the project created by using Master Detail project template.
Hello Yudi,
I wonder how you test these samples. I did the same thing you described in your last post. I tested on two devices (Samsung Galaxy Phone and Tablet). On each device I get the same results. Start the sample app, wait for 5, 10, 15 seconds and nothing happens. No image changes in the list. Then I rotated the devices from portrait to landscape. With the rotation there seems to be a refresh and there you go. The image changes.
Similar results on iOS.
Please, check this again.
Thanks,
Any news here?
Sorry for the delay in sending this.
I uploaded my sample project in OneDrive. Please have the sample downloaded in here; and have it evaluated on your end and let us know whether it helps or not. For your information, I'm using Crosslight 2 Update 4.
tested on Android device. Works.
Glad to hear that the sample helps.
Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname