I’m new to Windows Phone 7 development.
In my First Application I want to Create two listboxes with checkboxes inside them in different pages and to fill the first listbox with some Data. When I select some records in first listbox, that particular records have to be added in another listbox. I done listbox selection and also pass the selecteditem via parameter to another page, when I tried to assign that list to listbox.ItemSource it throws ArgumentNullException.
Please help me to solve this problem.
Thanks.
Firstly, as you are pointing out, ArgumentNullException is being thrown. So basically when you are doing the assignment to ItemsSource you are providing a null. In other terms, the object you think you have received from the object page is null.
Secondly, it is hard to help you debug the problem if you are not providing any source code. But, generally speaking are you able to test with dummy data and from code-behind (i.e. not from the XAML) when you are in the 2nd page that the listbox there gets populated? So, for the time being ignore the passing of data. Just ensure that when the 2nd page is loaded, the listbox is populated with dummy data that you have created in the code-behind of that page. If that works then your problem is simpler.
Hopefully, this helps.
//– Adding sample Code — //
Firstpage.xaml
Firstpage.xaml.cs
…
Secondpage.xaml
Secondpage.xaml.cs
So, as you can read from the i have a dummy list in Firstpage and when i click on any of the items it takes me to another page where there is another list which have been populated with data generated from my initial selection. As you see i am passing the selection as a querystring parameter just like i explained in my comments of this answer.
Hopefully this solves your problem and i look forward to you accepting this solution as an answer to your problem.