Binding data to DataTemplate Binding Context

lucky007lucky007 USMember ✭✭

i'm getting list of records from my service.
i'm binding this to a model class.
ex;
public class SampleModel
{
public Class1 class1{get; set;}
}
i'm using view model to fetch and bind data
public class ViewModel
{
List SampleModel model {get; set;}

public void Getmodel()
{
model=SomeService.GetList();
}
}

now I want to bind a single record to my datatemplate

ViewModel obj=new ViewModel();
ex: this.BindingContext=obj.model.FirstOrDefault();

how can I bind data using this view model?

Sign In or Register to comment.