캔버스에 이미지를 표시하기 위해 아래의 코드를 사용했지만 이미지를 길게 누르면 표시된 이미지를 삭제하고 싶습니다. 나는 contextmenu를 시도하지만 작동하지 않는다. 사람은캔버스에있는 이미지의 longpress에서 이미지를 삭제하고 싶습니다.
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;
}
* "오류 메시지"는 오류 설명이 아닙니다. – IInspectable
내 응용 프로그램에서 작동합니다 –
이 코드에는 오류가 없지만 이미지를 longpress에 삭제하려고합니다 –