Class TimePickerMessage
Represents a class which contains the functionalities for the time picker message in SfChat.
Inherited Members
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 |
---|
Xamarin.Forms.BindableProperty |
Properties
SelectedTime
Gets or sets the time selected by the user.
Declaration
public TimeSpan SelectedTime { get; set; }
Property Value
Type |
---|
System.TimeSpan |