Advertisement
Guest User

Untitled

a guest
May 25th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Xamarin.Forms;
  7.  
  8. namespace BHS.Utils
  9. {
  10. public class MenuListView : ListView
  11. {
  12. public MenuListView()
  13. {
  14. List<MenuItem> data = new MenuListData();
  15.  
  16. ItemsSource = data;
  17. VerticalOptions = LayoutOptions.FillAndExpand;
  18. BackgroundColor = Color.Transparent;
  19.  
  20.  
  21.  
  22. var cell = new DataTemplate(typeof(ImageCell));
  23. cell.SetBinding(TextCell.TextProperty, "Title");
  24. cell.SetBinding(ImageCell.ImageSourceProperty, "IconSource");
  25.  
  26. ItemTemplate = cell;
  27. SelectedItem = data[0];
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement