Question

I need to add 3 listpickers to UI aligned horizontally , whenever the user clicks an add button. I Have used listpicker in XAML, But I have no clue of adding them dynamically.I am using windows phone toolkit listpicker.How do I do it with C#..

//I would need something like..

 ListPicker txtBlk = new ListPicker();

1.I am unable to access windows phone toolkit's listpicker from C#.I have added reference to toolkit in XAML page.I m unable to set something like using Microsoft.Phone.Controls.Toolkit in my cs page.

2.Regarding item template.Can I create a static Resource for full mode template and item template in XAML and add it to listpicker from c#.

Was it helpful?

Solution

  1. Well, you got the namespace wrong:

    using Microsoft.Phone.Controls;

  2. If you give it a name, you can retrieve it easily with the following line:

    Application.Current.Resources["ResourceName"] as DataTemplate;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top