Hi how can i bind to this observablecollection
(Mainpage.xaml.cs)
public ObservableCollection tabs = new ObservableCollection();
in xaml? I’ve tried
(Mainpage.xaml)
But without any luck
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
a common pattern would be to set a
DataContextin you loaded event, assuming you want to bind it to aTabControlcalledtabs_controlon your page:Obviously you should substitute the actually control you want to bind to.
EDIT
Base on your comments, what you could do is just setup the control to be the data context, then your XAML binding should work. so instead of above you would do this:
then in your XAMl you could do this: