menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DatePickerMessage - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DatePickerMessage

    Represents a class which contains the functionalities for the DatePicker message in SfChat.

    Inheritance
    System.Object
    MessageBase
    TextMessage
    DatePickerMessage
    Implements
    IDatePickerMessage
    ITextMessage
    IMessage
    Inherited Members
    MessageBase.Author
    MessageBase.AuthorProperty
    MessageBase.Data
    MessageBase.DataProperty
    MessageBase.DateTime
    MessageBase.DateTimeProperty
    MessageBase.Dispose()
    MessageBase.HideAfterSelection
    MessageBase.HideAfterSelectionProperty
    MessageBase.IsMessageContentHiddenAfterSelection
    MessageBase.IsSuggestionViewHiddenAfterSelection
    MessageBase.Suggestions
    MessageBase.SuggestionsProperty
    TextMessage.Text
    TextMessage.TextProperty
    Namespace: Syncfusion.XForms.Chat
    Assembly: Syncfusion.SfChat.XForms.dll
    Syntax
    public class DatePickerMessage : TextMessage, IDatePickerMessage, ITextMessage, IMessage
    Examples

    The following code example demonstrates how to add DatePicker message in SfChat control.

    using Syncfusion.XForms.Chat;
    using Xamarin.Forms;
    

    namespace ChatDemo { public class SfChatDemo : ContentPage { SfChat sfChat;

        public SfChatDemo()
        {
            sfChat = new SfChat();
            DatePickerMessage message = new DatePickerMessage();
            message.Author = new Author() { Name = "Nancy", Avatar ="Nancy.png" };
            message.SelectedDate = DateTime.Now;
            sfChat.Messages.Add(message);
    
            this.Content = sfChat;
        }
    }
    

    }

    <? xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns = "http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:d="http://xamarin.com/schemas/2014/forms/design"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:sfchat="clr-namespace:Syncfusion.XForms.Chat;assembly=Syncfusion.SfChat.XForms"
                 xmlns:local="clr-namespace:Chat"
                 mc:Ignorable="d"
                 x:Class="Chat.SfChatDemo">
        <ContentPage.BindingContext>
            <local:ViewModel x:Name="viewModel" />
        </ContentPage.BindingContext>
        <ContentPage.Content>
            <sfchat:SfChat x:Name="Sfchat">
                <sfchat:SfChat.Messages>
                    <sfchat:DatePickerMessage
                        SelectedDate = "{Binding Date,Source={x:Reference viewModel}}" 
                        Author = "{Binding IncomingMessageAuthor,Source={x:Reference viewModel}}">
                    </sfchat:DatePickerMessage>
                </sfchat:SfChat.Messages>
            </sfchat:SfChat>
        </ContentPage.Content>
    </ContentPage>

    Constructors

    DatePickerMessage()

    Declaration
    public DatePickerMessage()

    Fields

    SelectedDateProperty

    Identifies the SelectedDate Xamarin.Forms.BindableProperty.

    Declaration
    public static readonly BindableProperty SelectedDateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    Properties

    SelectedDate

    Gets or sets the date selected by the user.

    Declaration
    public DateTime SelectedDate { get; set; }
    Property Value
    Type
    System.DateTime

    Implements

    IDatePickerMessage
    ITextMessage
    IMessage
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved