Version

CalendarItemGroupPanel Class

Custom element used to create and position CalendarItemGroup instances for a XamMonthCalendar
Syntax
'Declaration
 
Public Class CalendarItemGroupPanel 
   Inherits System.Windows.FrameworkElement
public class CalendarItemGroupPanel : System.Windows.FrameworkElement 
Remarks

The CalendarItemGroupPanel is designed to be used within the template of a XamMonthCalendar. When used in the XamMonthCalendar template, this class will automatically generate and arrange CalendarItemGroup instances based on the XamMonthCalendar.CalendarDimensions. When the XamMonthCalendar.AutoAdjustCalendarDimensions is true, the panel will generate more CalendarItemGroups if they can fit up to the MaxGroups, which defaults to 12. You may also retemplate the XamMonthCalendar such that it directly contains CalendarItemGroup instances and set their ReferenceGroupOffset.

By default, the GroupWidth and GroupHeight properties are set to double.NaN. When either is left set to the default, the panel will calculate the size required for a group to display its contents and arrange all the groups using that size.

Example
The following sample demonstrates how to use the properties of the CalendarItemGroupPanel within a custom template for a XamMonthCalendar.

<UserControl x:Class="Xaml.UserControl1"
    
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    
xmlns:sys="clr-namespace:System;assembly=mscorlib"
    
xmlns:igEditors="http://infragistics.com/Editors"
    
xmlns:igThemes="http://infragistics.com/Themes">
    
<UserControl.Resources>
        
<ControlTemplate TargetType="{x:Type igEditors:XamMonthCalendar}" x:Key="customCalendarTemplate">
            
<Border BorderBrush="{TemplateBinding Border.BorderBrush}" 
                  
BorderThickness="{TemplateBinding Border.BorderThickness}" 
                  
Background="{TemplateBinding Panel.Background}" 
                  
SnapsToDevicePixels="True" 
                  
Padding="{TemplateBinding Padding}">
                
<DockPanel SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                    
<!-- Today button -->
                    
<Button DockPanel.Dock="Bottom"
                        
Style="{DynamicResource {x:Static igEditors:XamMonthCalendar.TodayButtonStyleKey}}"  
                        
Visibility="{TemplateBinding TodayButtonVisibility}" />

                    
<!-- Groups -->
                    
<igEditors:CalendarItemGroupPanel 
                        
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                        
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
                        
MaxGroups="6"
                        
GroupWidth="300"
                        
GroupHeight="300"
                        
/>
                
</DockPanel>
            
</Border>
        
</ControlTemplate>
    
</UserControl.Resources>
    
<igEditors:XamMonthCalendar
        
x:Name="xamMonthCalendar1"
        
Template="{StaticResource customCalendarTemplate}" />
</UserControl>
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