Search code examples
wpfxaml

How to set ItemsSource in XAML?


I have set ItemsSource of a ListBox as follows :

<ListBox ItemsSource="{Binding abc}" />

What I want

<ListBox>
    <listBox.ItemsSource>
        ?????????????
    <listBox.ItemsSource>
</ListBox>

Solution

  • <ListBox>
        <listBox.ItemsSource>
            <Binding Path = "abs" />
        <listBox.ItemsSource>
    </ListBox>