Version

GroupsSource Property

Gets or sets a collection used to generate the content of the XamOutlookBar. This is a dependency property.
Syntax
'Declaration
 
Public Property GroupsSource As IEnumerable
public IEnumerable GroupsSource {get; set;}
Remarks

The developer can use only one of Groups or GroupsSource properties to add groups to the control. This allows the Groups collection to be populated via a binding on the GroupsSource property. When GroupsSource is in use, setting this property to null will remove the collection and restore use to Groups (which will be an empty collection).

Example
Public Class Car
    Public Name As String
    Public Year As Integer
    Public Color As String
End Class
public class Car
{
   public string Name {get; set;}
   public int Year {get; set;}
   public string Color{get; set;}
}
<Window x:Class="XOBbinding.Window1"
    
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    
Title="Window1" Height="293" Width="465"
    
xmlns:igOB="clr-namespace:Infragistics.Windows.OutlookBar;assembly=Infragistics3.Wpf.OutlookBar.v8.2"
    
xmlns:local="clr-namespace:XOBbinding"
    
xmlns:coll="clr-namespace:System.Collections;assembly=mscorlib"
        
>
    
<Window.Resources>
        
        
<!-- The list of used cars -->
        
<coll:ArrayList x:Key="UsedCars">
            
<local:Car Name="Ford" Year="2001" Color="DarkBlue"/>
            
<local:Car Name="Renault" Year="1997" Color="Gray"/>
            
<local:Car Name="Audi" Year="2002" Color="Black"/>
        
</coll:ArrayList>
        
       
<!-- The OutlookBarGroup style-->
        
<Style TargetType="{x:Type igOB:OutlookBarGroup}" >
            
<Setter Property="Header" Value="{Binding Path=Name}"/>
            
<Setter Property="Content" Value="{Binding}"/>
            
<Setter Property="ContentTemplate">
                
<Setter.Value>
                    
<DataTemplate>
                        
<StackPanel Background="{Binding Path=Color}" 
                                    
TextBlock.Foreground="AntiqueWhite">
                            
<TextBlock Text="{Binding Path=Birth}" />
                            
<TextBlock Text="{Binding Path=Color}" />
                        
</StackPanel>
                    
</DataTemplate>
                
</Setter.Value>
            
</Setter>
        
</Style>

        
<DataTemplate DataType="{x:Type local:Car}">
            
<TextBlock Text="{Binding Path=Name}"/>
        
</DataTemplate>
        
    
</Window.Resources>

    
<StackPanel Orientation="Horizontal">
        
<!--XamOutlookBar shows the list of used cars-->
        
<igOB:XamOutlookBar Name="xamOutlookBar1" Width="144" 
                            
DataContext="{StaticResource UsedCars}"
                            
GroupsSource="{Binding}"
            
/>
        
<TextBlock Text="Used Cars"/>
    
</StackPanel>
    
</Window>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also