Wp7 clear canvas value
I am using canvas to add image programatically.
for example:
Image image1=new image1();
Image image2=new image1();
var left = new BitmapImage();
left.UriSource = new Uri("images/box.png", UriKind.Relative);
image1.Source = left;
image2.Source = left;
ContentPanelCanvas.Children.Add(image1);
ContentPanelCanvas.Children.Add(image2);
First time enter the loop Add Image to canvas. second time i want to clear canvas.
and again add different images same canvas.
Is this possible wp7.
tel开发者_开发问答l some idea to do this.
thanks
Yes, it is possible:
ContentPanelCanvas.Children.Clear();
This will empty the canvas.
Why not simply change the Source
property of the images you already added?
精彩评论