Guest User

Untitled

a guest
Jan 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Image myImage = new Image
  2. {
  3. Source = ImageSource.FromUri(new Uri(myObj.ImagePath1)),
  4. };
  5.  
  6. listView.ItemTemplate = new DataTemplate
  7. (typeof(MyImageCell))
  8. Bindings = {
  9. {TextCell.TextProperty,
  10. new Binding("MyTitle")},
  11. {TextCell.DetailProperty,
  12. new Binding("MyAddress")},
  13. {ImageCell.ImageSourceProperty,
  14. new Binding("MyURL")},
  15. }
  16. };
  17.  
  18. ListView lv = new ListView();
  19. lv.ItemTemplate = new DataTemplate(() =>
  20. {
  21. Image image = new Image();
  22. image.SetBinding(Image.SourceProperty, "Source");
  23.  
  24. return new ViewCell
  25. {
  26. View = new StackLayout
  27. {
  28. Children = {
  29. image, new Label{ Text = "Tubo"}
  30. }
  31. }
  32. };
  33. });
  34. lv.ItemsSource = new Src[] { new Src(), new Src() };
  35. ...
  36.  
  37. public class Src
  38. {
  39. public string Source { get; set; }
  40.  
  41. public Src()
  42. {
  43. Source = "http://blog.rthand.com//images/Logo_vNext.png";
  44. }
  45. }
Add Comment
Please, Sign In to add comment