I have a listbox that contains a bulk of items that can vary from 100-250 items depending on the navigation(items are not static,its dynamic).I am using an ObservableCollection to store the items.In the UI front there is an image in each item provided to add that item to cart which changes its color from transparent to green if clicked.there is another page where we can see the selected items.If I am deleting any item from the selected items and coming back to the previous page where I have the list of items,I don't see any changes in the UI front.i.e, the cart color is still green,it should change back from green to transparent.
How I can deal with this?
Loading

Raghunandan Ghagharvale8 reputationPosted Jan 6, 2015, 11:30 PM EST
Sweta Sinha53 reputationPosted Jan 7, 2015, 2:20 AM EST
Raghunandan Ghagharvale8 reputationPosted Jan 7, 2015, 2:32 AM EST
Sweta Sinha53 reputationPosted Jan 7, 2015, 2:35 AM EST
The code snippet:-
partListPhoneControl.myCart.MouseLeftButtonUp += (sender, e) =>
{
Image img = (Image)sender;
Object obj = img.Tag;
int val = (int)obj;
if (myCollection[val].isAddedToCart() == true)
{
partListPhoneControl.myCart.Source = new BitmapImage(new Uri("/images/shopping_cart_selected.png", UriKind.Relative));
}
else
{
partListPhoneControl.myCart.Source = new BitmapImage(new Uri("/images/shopping_cart_default.png", UriKind.Relative));
}
}
Raghunandan Ghagharvale8 reputationPosted Jan 7, 2015, 2:43 AM EST
could you elaborate more on your problem from technical points with some relavent classes
?
Sweta Sinha53 reputationPosted Jan 7, 2015, 2:47 AM EST
Raghunandan Ghagharvale8 reputationPosted Jan 7, 2015, 3:35 AM EST
when you go back the the page the mouseup event is not fired so the call to the handler is not called and hence the color would not change
Sweta Sinha53 reputationPosted Jan 7, 2015, 6:43 PM EST