- Home
- Forum
- Xamarin.Forms
- Pull To Refresh in SfChat
Pull To Refresh in SfChat
Hi,
How can you use "Pull to Refresh" functionality in a SfChat window?
Thanks, Vassili
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
CS
Chandrasekar Sampathkumar
Syncfusion Team
March 18, 2021 09:20 AM UTC
Hi Vassili,
Thank you for using Syncfusion products.
We would like to let you know that, SfPullToRefresh controls provides support for loading any custom control as pullable content. To host SfChat inside the SfPullToRefresh, follow the below steps.
- Add the required assembly references to the pcl and renderer projects as discussed in the Assembly deployment section of SfChat and SfPullToRefresh.
- Import SfPullToRefresh and SfChat control namespace as follows.
|
xmlns:sfChat="clr-namespace:Syncfusion.XForms.Chat;assembly=Syncfusion.SfChat.XForms"
xmlns:syncfusion="clr-namespace:Syncfusion.SfPullToRefresh.XForms;assembly=Syncfusion.SfPullToRefresh.XForms" |
- Define SfChat as PullableContent of the SfPullToRefresh.
- Handle the pull to refresh events for refreshing the data.
- Customize the required properties of SfChat and SfPullToRefresh based on your requirement.
We have prepared simple sample based on your requirement and you can download the same using the following link,
Sample Link: Sample
Please let us know if you would require any further assistance.
Regards,
Chandrasekar Sampathkumar
VA
Vassili
March 18, 2021 10:43 AM UTC
Hello,
Thanks a lot for the quick response. In my case the SfChat is already used as a content for SfPopupLayout.Content in order to the pop ups to be enabled.
Question: do I still need to have SfChat as a PullableContent, or SfPopupLayout that contains SfChat? How would you change your sample to include both, the pop ups and the pull to refresh?
Thanks, Vassili
CS
Chandrasekar Sampathkumar
Syncfusion Team
March 19, 2021 08:51 AM UTC
Hi Vassili,
Thank you for the update.
You can achieve your requirement by using SfPopupLayout as PullableContent of SfPullToRefresh. Please refer the following code snippets for more reference,
Xaml: Adding SfPopupLayout as PullableContent of SfPullToRefresh
|
<ContentPage.Content>
<syncfusion:SfPullToRefresh x:Name="pullToRefresh" … >
<syncfusion:SfPullToRefresh.PullableContent>
<sfPopup:SfPopupLayout x:Name="popupLayout">
<sfPopup:SfPopupLayout.PopupView>
<sfPopup:PopupView>
<sfPopup:PopupView.ContentTemplate>
<DataTemplate>
…
</DataTemplate>
</sfPopup:PopupView.ContentTemplate>
</sfPopup:PopupView>
</sfPopup:SfPopupLayout.PopupView>
<sfPopup:SfPopupLayout.Content>
<sfChat:SfChat x:Name="sfChat" … />
</sfPopup:SfPopupLayout.Content>
</sfPopup:SfPopupLayout>
</syncfusion:SfPullToRefresh.PullableContent>
</syncfusion:SfPullToRefresh>
</ContentPage.Content> |
We have prepared simple sample based on your requirement and you can download the same using the following link,
Sample Link: Sample
Please let us know if you would require any further assistance.
Regards,
Chandrasekar Sampathkumar
Marked as answer
VA
Vassili
March 19, 2021 09:26 AM UTC
Hi Chandrasekar,
Thanks a lot for the sample!
All the best, Vassili
CS
Chandrasekar Sampathkumar
Syncfusion Team
March 19, 2021 09:46 AM UTC
Hi Vassili,
Thanks for the update.
We are glad that the solution helps. Please let us know if you need any further update. As always we are happy to help you out.
Regards,
Chandrasekar Sampathkumar
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
- Marked answer
-
VA Vassili
- Mar 17, 2021 09:36 PM UTC
- Mar 19, 2021 09:46 AM UTC