New to Telerik UI for .NET MAUI? Start a free 30-day trial

Templates

If the default templates of the control do not suit your needs, you can easily define custom ones.

The available templates for customizing are:

  • PlaceholderTemplate(ControlTemplate)—Defines the template visualized for the placeholder.
  • DisplayTemplate(ControlTemplate)—Defines the template visualized when the picked date/time is displayed.
  • HeaderTemplate(ControlTemplate)—Defines what will be displayed inside the dialog (popup) header.
  • FooterTemplate(ControlTemplate)—Defines what will be displayed inside the dialog (popup) footer.

PlaceholderTemplate

<ControlTemplate x:Key="placeholderTemplate">
    <Button Text="Pick a time interval" 
            FontAttributes="Bold" 
            TextColor="White"
            BackgroundColor="#70B8FF" 
            HeightRequest="50" 
            Command="{TemplateBinding ToggleCommand}" />
</ControlTemplate>

DisplayTemplate

<ControlTemplate x:Key="displayTemplate">
    <Button Text="{TemplateBinding DisplayString}" 
            TextColor="White" 
            BackgroundColor="#70B8FF"
            HeightRequest="50"
            Command="{TemplateBinding ToggleCommand}" />
</ControlTemplate>

HeaderTemplate

<ControlTemplate x:Key="headerTemplate">
    <Grid>
        <Label Text="Select Duration"
               Padding="20"
               TextColor="White"
               VerticalTextAlignment="Center"
               HorizontalTextAlignment="Center"
               BackgroundColor="#70B8FF"/>
    </Grid>
</ControlTemplate>

FooterTemplate

<ControlTemplate x:Key="footerTemplate">
    <StackLayout Orientation="Horizontal" Spacing="0" HorizontalOptions="FillAndExpand" BackgroundColor="#70B8FF">
        <telerik:RadButton Text="&#xE80A;"
                           FontFamily="TelerikFontExamples"
                           WidthRequest="75"
                           TextColor="White"
                           BackgroundColor="Transparent"
                           BorderWidth="0"
                           Command="{TemplateBinding CancelCommand}" />
        <telerik:RadButton Text="&#xE809;"
                           FontFamily="TelerikFontExamples"
                           WidthRequest="75"
                           TextColor="White"
                           BackgroundColor="Transparent"
                           BorderWidth="0"
                           Command="{TemplateBinding AcceptCommand}" />
    </StackLayout>
</ControlTemplate>

and the TimeSpan Picker definition:

<telerik:RadTimeSpanPicker PlaceholderTemplate="{StaticResource placeholderTemplate}"
                           DisplayTemplate="{StaticResource displayTemplate}">
    <telerik:RadTimeSpanPicker.PopupSettings>
        <telerik:PickerPopupSettings HeaderTemplate="{StaticResource headerTemplate}"
                                     FooterTemplate="{StaticResource footerTemplate}"/>
    </telerik:RadTimeSpanPicker.PopupSettings>
    <telerik:RadTimeSpanPicker.DropDownSettings>
        <telerik:PickerDropDownSettings FooterTemplate="{StaticResource footerTemplate}"/>
    </telerik:RadTimeSpanPicker.DropDownSettings>
</telerik:RadTimeSpanPicker>

See Also

In this article
Not finding the help you need?