Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Image myImage = new Image
- {
- Source = ImageSource.FromUri(new Uri(myObj.ImagePath1)),
- };
- listView.ItemTemplate = new DataTemplate
- (typeof(MyImageCell))
- Bindings = {
- {TextCell.TextProperty,
- new Binding("MyTitle")},
- {TextCell.DetailProperty,
- new Binding("MyAddress")},
- {ImageCell.ImageSourceProperty,
- new Binding("MyURL")},
- }
- };
- ListView lv = new ListView();
- lv.ItemTemplate = new DataTemplate(() =>
- {
- Image image = new Image();
- image.SetBinding(Image.SourceProperty, "Source");
- return new ViewCell
- {
- View = new StackLayout
- {
- Children = {
- image, new Label{ Text = "Tubo"}
- }
- }
- };
- });
- lv.ItemsSource = new Src[] { new Src(), new Src() };
- ...
- public class Src
- {
- public string Source { get; set; }
- public Src()
- {
- Source = "http://blog.rthand.com//images/Logo_vNext.png";
- }
- }
Add Comment
Please, Sign In to add comment