I'm trying to binding a SL BusyIndicator to a collection of busy messages. When the collection has items, the indicator will display the messages. When the collection of messages is empty the indicator will hide.
First off the indicator is not displaying my messages, all I see is a blank indicator box, with an indeterminate progress bar:
<UserControl.Resources>
...
<anotherAssembly:CollectionToBoolConverter x:Key="CollectionToBoolConverter" />
<DataTemplate x:Key="LoadingMessageDataTemplate">
<ItemsControl x:Name="itemsControl" ItemsSource="{Binding AllocationLoadingMessages}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
...
</UserControl.Resources>
...
<controlToolkit:BusyIndicator
IsBusy="{Binding AllocationLoadingMessages, Converter={StaticResource CollectionToBoolConverter}}"
BusyContent="{Binding AllocationLoadingMessages}"
BusyContentTemplate="{StaticResource LoadingMessageDataTemplate}"/>
///content
</controlToolkit:BusyIndicator>
...
ViewModel:
private ObservableCollection<string> _allocationLoadingMessages = new ObservableCollection<string>();
public ObservableCollection<string> AllocationLoadingMessages
{
get { return _allocationLoadingMessages; }
set
{
SetValue(ref _allocationLoadingMessages, value, "AllocationLoadingMessages");
}
}
So how do I get a simple list of messages in my Indiciator?
Thanks,
Mark