Xamarin.Forms

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TimePickerMessage

    Show / Hide Table of Contents

    Class TimePickerMessage

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

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

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

    using Syncfusion.XForms.Chat;
    using System;
    using Xamarin.Forms;
    namespace ChatDemo
    {
        public class SfChatDemo : ContentPage
        {
            SfChat sfChat;
    
        public SfChatDemo()
        {
            sfChat = new SfChat();
            TimePickerMessage message = new TimePickerMessage();
            message.Author = new Author() { Name = "Andrea", Avatar = "Andrea.png" };
            message.SelectedTime = TimeSpan.FromSeconds(100);
            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:TimePickerMessage
                           Author="{Binding IncomingMessageAuthor,Source={x:Reference viewModel}}"
                           SelectedTime = "{Binding SelectedTime,Source={x:Reference viewModel}}" >
                   </sfchat:TimePickerMessage>
               </sfchat:SfChat.Messages>
           </sfchat:SfChat>
       </ContentPage.Content>
    </ContentPage>

    Constructors

    TimePickerMessage()

    Declaration
    public TimePickerMessage()

    Fields

    SelectedTimeProperty

    Identifies the SelectedTime Xamarin.Forms.BindableProperty.

    Declaration
    public static readonly BindableProperty SelectedTimeProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    Properties

    SelectedTime

    Gets or sets the time selected by the user.

    Declaration
    public TimeSpan SelectedTime { get; set; }
    Property Value
    Type Description
    System.TimeSpan

    Implements

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