1

I have a list of strings that initializes in the constructor:

public List<String> m_Distances = new List<String>();
public List<String> Distances
{
    get
    {
        return m_Distances;
    }
}

and also in the constructor:

listPickerDistance.ItemsSource = Distances;

Now in my XAML:

                <TextBlock Text="Distance" x:Name="textBlockDistance"/>
                <toolkit:ListPicker ItemsSource="{Binding}" x:Name="listPickerDistance">
                    <toolkit:ListPickerItem>
                        <DataTemplate>
                            <TextBlock Text="{Binding Distances, ElementName=listPickerDistanceSearch}"/>
                        </DataTemplate>
                    </toolkit:ListPickerItem>
                </toolkit:ListPicker>

Can you please help me bind the list to the listpicker? Should be easy.. isn't it?

4

1 回答 1

4

这是所有的了:

public List<String> m_Distances = new List<String>();
public List<String> Distances
{
    get
    {
        return m_Distances;
    }
}

listPickerDistance.ItemsSource = Distances;

<toolkit:ListPicker x:Name="listPickerDistance">

</toolkit:ListPicker>
于 2013-07-30T19:55:41.410 回答