void Stickers1_SelectionChanged(object sender, SelectionChangedEventArgs e) { var selecteditem = e.AddedItems[0] as StickersImageListModel; { Stickers1.Visibility = Visibility.Collapsed; Image imageitem = new Image(); BitmapImage image = new BitmapImage(new System.Uri(selecteditem.Imageurl, UriKind.Absolute)); imageitem.Source = image; my_canvas.Children.Add(imageitem); imageitem.AllowDrop = true; } my_canvas.Visibility = Visibility.Visible; }
class StickersDisplayed { public int id { get; set; } public string Imageurl { get; set; } } private void my_canvas_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { if ((e.Position.X > Canvas.GetLeft(_img) && e.Position.X < Canvas.GetLeft(_img) + _img.Width) || (e.Position.Y > Canvas.GetTop(_img) && e.Position.Y < Canvas.GetTop(_img) + _img.Height)) { { Canvas.SetLeft(_img, e.Position.X); Canvas.SetTop(_img, e.Position.Y); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)