So I have a Listbox:
<ListBox Grid.Row="0" Grid.Column="1" Grid.RowSpan="2"> //<----Item's Data Source Method Call Here?
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Orientation="Horizontal"
IsItemsHost="true" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Orientation="Vertical">
<Label Content="{Binding Address1}"></Label>
<Label Content="{Binding Address2}"></Label>
<Label Content="{Binding Town}"></Label>
<Label Content="{Binding Postcode}"></Label>
<Label Content="{Binding Country}"></Label>
<CheckBox Content="{Binding Include}"></CheckBox>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
What I would like to do is set the item's data source to a list of addresses all of which have the same postal code. So I need a list of the current addresses in an Observable Collection with the same postcode. To generate such a list of addresses would only take a call to a method which accepts the current postcode as a an argument but I don't know how to call a method that requires an argument from a static datasource.
Can anyone help?