protected async override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.CategoriesList);
try
{
// Initialize the SampleManager and create the Sample Categories
await SampleManager.Current.InitializeAsync(this);
_sampleCategories = SampleManager.Current.GetSamplesAsTree();
// Set up the custom ArrayAdapter for displaying the Categories.
var categoriesAdapter = new CategoriesAdapter(this, _sampleCategories);
ListView categoriesListView = FindViewById<ListView>(Resource.Id.categoriesListView);
categoriesListView.Adapter = categoriesAdapter;
categoriesListView.ItemClick += CategoriesItemClick;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}