Skip to content

Instantly share code, notes, and snippets.

@rafaelrmou
Created April 15, 2015 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrmou/d003f7b6c4700ef85b21 to your computer and use it in GitHub Desktop.
Save rafaelrmou/d003f7b6c4700ef85b21 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace BHS.Utils
{
public class MenuListView : ListView
{
public MenuListView()
{
List<MenuItem> data = new MenuListData();
ItemsSource = data;
VerticalOptions = LayoutOptions.FillAndExpand;
BackgroundColor = Color.Transparent;
var cell = new DataTemplate(typeof(ImageCell));
cell.SetBinding(TextCell.TextProperty, "Title");
cell.SetBinding(ImageCell.ImageSourceProperty, "IconSource");
ItemTemplate = cell;
SelectedItem = data[0];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment