I have use the given below code to display the image on canvas and now I want to delete the displayed image on the long press on that image. I try the contextmenu for that but it not works. please anybody tell me how i can do it or properly used contextmenu for it
private void Stickers1_SelectionChanged(object sender, SelectionChangedEventArgs e) { var selecteditem = e.AddedItems[0] as StickersImageListModel; Stickers1.Visibility = Visibility.Collapsed; // taking image from a list StickersImageListModel of images and bind with imageitem varaible Image imageitem = new Image(); BitmapImage image = new BitmapImage(new System.Uri(selecteditem.Imageurl, UriKind.Absolute)); imageitem.Source = image; //Add the images on canvas my_canvas.Children.Add(imageitem); imageitem.AllowDrop = true; // DRag and drop the images on canvas imageitem.ManipulationMode = ManipulationModes.All; imageitem.ManipulationDelta += Drag_ManipulationDelta; CompositeTransform ct = new CompositeTransform(); imageitem.RenderTransform = ct; my_canvas.Visibility = Visibility.Visible; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)