Back to Devexpress

MonthCellControl Class

wpf-devexpress-dot-xpf-dot-scheduling-dot-visual-d2622ddb.md

latest3.1 KB
Original Source

MonthCellControl Class

Visualizes a Month View cell.

Namespace : DevExpress.Xpf.Scheduling.Visual

Assembly : DevExpress.Xpf.Scheduling.v25.2.dll

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public class MonthCellControl :
    CellControl
vb
Public Class MonthCellControl
    Inherits CellControl

Remarks

The control uses the MonthCellDatePresenter to display a date within the cell. The control’s public properties allow you to specify date formats and change the border color and thickness used to indicate the current date.

Example

This example defines a custom MonthCellControl style which sets the MonthCellDatePresenter‘s font size, specify formats to display a date in a MonthView cell and changes the color used to highlight the current date.

xaml
<Style x:Key="MonthCellControlStyle" TargetType="dxschv:MonthCellControl">
    <Setter Property="ContentTemplate">
        <Setter.Value>
            <DataTemplate>
                <dxschv:MonthCellDatePresenter
                    Margin="3"
                    FontSize="10"
                    WordWrap="True"/>
            </DataTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="DayStringFormat" Value="Day StringFormat: {0: d}" />
    <Setter Property="FirstDayOfMonthStringFormat" Value="First Day Of Month StringFormat: {0: d MMM}" />
    <Setter Property="FirstDayOfYearStringFormat" Value="First Day Of Year StringFormat: {0: d MMM, yy}" />
    <Setter Property="TodayBorderBackground" Value="Yellow" />
    <Setter Property="TodayBorderThickness" Value="10" />
</Style>

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement ContentPresenter DevExpress.Xpf.Scheduling.Visual.ChromePresenterBase CellControl MonthCellControl

See Also

MonthCellControl Members

DevExpress.Xpf.Scheduling.Visual Namespace