I'm following the example code from the ListView Getting Started section. At the end of the example, it states "set the list view as content of your page". How is this done? I tried SetContentView(listView) but get an error stating "cannot convert from RadListView to View". Here's my activity code:
public
class
RouteDetailActivity : ListActivity
{
protected
override
void
OnCreate(Bundle savedInstanceState)
{
base
.OnCreate(savedInstanceState);
var listView =
new
RadListView
{
ItemsSource =
new
ViewModel().Source,
ItemTemplate =
new
DataTemplate(() =>
{
var label =
new
Label {Margin =
new
Thickness(10)};
var content =
new
Grid();
content.Children.Add(label);
label.SetBinding(Label.TextProperty,
new
Binding(nameof(SourceItem.Name)));
return
new
ListViewTemplateCell
{
View = content
};
})
};
SetContentView(listView);
}
}