Back to Devexpress

AppointmentControl.EditTemplate Property

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

latest3.8 KB
Original Source

AppointmentControl.EditTemplate Property

Gets or sets the inplace editor data template for the AppointmentControl descendants. This is a dependency property.

Namespace : DevExpress.Xpf.Scheduling.Visual

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public DataTemplate EditTemplate { get; set; }
vb
Public Property EditTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A DataTemplate object that is the data template displayed as an inplace editor.

|

Remarks

Use this property to specify a data template to visualize an inplace appointment editor in AppointmentControl descendants - DayAppointmentControl, TimelineAppointmentControl, MonthAppointmentControl.

Example

View Example

xaml
<Window.Resources>
    <DataTemplate x:Key="myEditor">
        <dxsch:AppointmentInplaceEditorControl Content="{Binding}">
            <dxsch:AppointmentInplaceEditorControl.ContentTemplate>
                <DataTemplate>
                    <dxe:TextEdit
                        HorizontalContentAlignment="Center"
                        Background="AliceBlue"
                        Name="PART_Editor"
                        SelectAllOnGotFocus="False"
                        Text="{Binding Subject, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        TextWrapping="Wrap" />
                </DataTemplate>
            </dxsch:AppointmentInplaceEditorControl.ContentTemplate>
        </dxsch:AppointmentInplaceEditorControl>
    </DataTemplate>
    <Style TargetType="dxschv:DayAppointmentControl">
        <Setter Property="EditTemplate" Value="{StaticResource myEditor}" />
    </Style>
</Window.Resources>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the EditTemplate property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-implement-custom-inplace-appointment-editor/CS/CustomInplaceEditorExample/MainWindow.xaml#L36

xml
<Style TargetType="dxschv:DayAppointmentControl">
    <Setter Property="EditTemplate" Value="{StaticResource myEditor}" />
</Style>

See Also

AppointmentControl Class

AppointmentControl Members

DevExpress.Xpf.Scheduling.Visual Namespace