バージョン 24.2 (最新)

GroupsSource プロパティ

XamOutlookBar のコンテンツを作成するコレクションを取得または設定します。これは依存プロパティです。
シンタックス
public IEnumerable GroupsSource {get; set;}
解説

コントロールにグループを追加するのに、開発者は Groups または GroupsSource プロパティから 1 つだけ使用できます。これによって、Groups コレクションは GroupsSource プロパティのバインディングで移植されます。GroupsSource を使用している間は、このプロパティを Null に設定することによって、コレクションを削除し、Groups の使用に戻します(空コレクション)。

使用例
Public Class Car
    Public Name As String
    Public Year As Integer
    Public Color As String
End Class
'宣言
 
Public Property GroupsSource As IEnumerable
 
public class Car
{
   public string Name {get; set;}
   public int Year {get; set;}
   public string Color{get; set;}
}
'宣言
 
Public Property GroupsSource As IEnumerable
 
<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>
'宣言
 
Public Property GroupsSource As IEnumerable
 
参照