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
Sweta SinhaPosted Jan 7, 2015, 11:43 PM
Raghunandan GhagharvalePosted Jan 7, 2015, 8:35 AM
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 SinhaPosted Jan 7, 2015, 7:47 AM
Raghunandan GhagharvalePosted Jan 7, 2015, 7:43 AM
could you elaborate more on your problem from technical points with some relavent classes
?
Sweta SinhaPosted Jan 7, 2015, 7:35 AM
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 GhagharvalePosted Jan 7, 2015, 7:32 AM
Sweta SinhaPosted Jan 7, 2015, 7:20 AM
Raghunandan GhagharvalePosted Jan 7, 2015, 4:30 AM