I have bound a WPF TreeView to an ObservableCollection. When a Connection node gets expanded in the UI, I want Connection.GetDatabases() to be called, which returns an collection of Databases.
I'm using HierarchicalDataTemplate:
<HierarchicalDataTemplate DataType="{x:Type dbcore:Connection}" ItemsSource="<WHAT GOES HERE?>">
<StackPanel Orientation="Horizontal">
<Image Source="{StaticResource DataServerIcon}" Margin="5,2" />
<TextBlock Text="{Binding Converter={StaticResource connToStringConverter}}" />
</StackPanel>
</HierarchicalDataTemplate>
But because I want to use a method instead of a property, I'm not sure what to use in the ItemsSource property.