Hi Amr,
We would like to let you know that, for the custom message template of SfChat, we can load the incoming and outgoing messages based on message author in OnSelectTemplate method SfChat MessageTemplate selector as like below code snippets:
Code Snippets:
|
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
{
var val = item as TextMessage;
if (item as TextMessage != null )
{
if (val.Author == viewModel1.CurrentUser)
{
return Outgoing_Template;
}
else if (val.Author != viewModel1.CurrentUser)
return Incoming_Template;
}
return base.OnSelectTemplate(item, container);
} |
We have prepared a simple sample with custom message template and attached it in below sample link for you reference.
Please let us know if you need any other further assistance.
Regards,
Suja