Class SfPullToRefresh
A refresh control that allows you to interact and refresh the view loaded in it. Allows you to refresh the view upon performing the pull-to-refresh action.
Inheritance
Implements
Namespace: Syncfusion.SfPullToRefresh.XForms
Assembly: Syncfusion.SfPullToRefresh.XForms.dll
Syntax
public class SfPullToRefresh : Layout<View>, IDisposable, IParentThemeElement, IThemeElement
Constructors
SfPullToRefresh()
Initializes a new instance of the SfPullToRefresh class.
Declaration
public SfPullToRefresh()
Fields
CanRestrictChildTouchProperty
Identifies the CanRestrictChildTouch bindable property.
Declaration
public static readonly BindableProperty CanRestrictChildTouchProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
IsRefreshingProperty
Identifies the IsRefreshing bindable property.
Declaration
public static readonly BindableProperty IsRefreshingProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
ProgressBackgroundColorProperty
Identifies the ProgressBackgroundColor bindable property.
Declaration
public static readonly BindableProperty ProgressBackgroundColorProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
ProgressStrokeColorProperty
Identifies the ProgressStrokeColor bindable property.
Declaration
public static readonly BindableProperty ProgressStrokeColorProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
ProgressStrokeWidthProperty
Identifies the ProgressStrokeWidth bindable property.
Declaration
public static readonly BindableProperty ProgressStrokeWidthProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
PullableContentProperty
Identifies the PullableContent bindable property.
Declaration
public static readonly BindableProperty PullableContentProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
PullingThersholdProperty
Identifies the PullingThershold bindable property.
Declaration
public static readonly BindableProperty PullingThersholdProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
PullingThresholdProperty
Identifies the PullingThreshold bindable property.
Declaration
public static readonly BindableProperty PullingThresholdProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
PullingViewTemplateProperty
Identifies the PullingViewTemplate bindable property.
Declaration
public static readonly BindableProperty PullingViewTemplateProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
RefreshCommandParameterProperty
Identifies the RefreshCommandParameter bindable property.
Declaration
public static readonly BindableProperty RefreshCommandParameterProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
RefreshCommandProperty
Identifies the RefreshCommand bindable property.
Declaration
public static readonly BindableProperty RefreshCommandProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
RefreshContentHeightProperty
Identifies the RefreshContentHeight bindable property.
Declaration
public static readonly BindableProperty RefreshContentHeightProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
RefreshContentThresholdProperty
Identifies the RefreshContentThreshold bindable property.
Declaration
public static readonly BindableProperty RefreshContentThresholdProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
RefreshContentWidthProperty
Identifies the RefreshContentWidth bindable property.
Declaration
public static readonly BindableProperty RefreshContentWidthProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
RefreshingViewTemplateProperty
Identifies the RefreshingViewTemplate bindable property.
Declaration
public static readonly BindableProperty RefreshingViewTemplateProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
TransitionModeProperty
Identifies the TransitionModeProperty bindable property.
Declaration
public static readonly BindableProperty TransitionModeProperty
Field Value
| Type |
|---|
| Xamarin.Forms.BindableProperty |
Properties
CanRestrictChildTouch
Gets or sets a value indicating whether restrict child touch or not.
Declaration
public bool CanRestrictChildTouch { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsRefreshing
Gets or sets a value indicating whether to enable or disable the pulling or not.
Declaration
public bool IsRefreshing { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Examples
pullToRefresh.IsRefreshing = true;
ProgressBackgroundColor
Gets or sets the progress background color of SfPullToRefresh.
Declaration
public Color ProgressBackgroundColor { get; set; }
Property Value
| Type |
|---|
| Xamarin.Forms.Color |
Examples
pullToRefresh.ProgressBackgroundColor = Color.Yellow;
ProgressStrokeColor
Gets or sets the progress stroke color of SfPullToRefresh.
Declaration
public Color ProgressStrokeColor { get; set; }
Property Value
| Type |
|---|
| Xamarin.Forms.Color |
Examples
pullToRefresh.ProgressStrokeColor = Color.Red;
ProgressStrokeWidth
Gets or sets the progress indicator stroke width.
Declaration
public double ProgressStrokeWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
Examples
pullToRefresh.ProgressStrokeWidth = 5d;
PullableContent
Gets or sets the pullable content of SfPullToRefresh.
Declaration
public View PullableContent { get; set; }
Property Value
| Type |
|---|
| Xamarin.Forms.View |
Examples
<syncfusion:SfPullToRefresh x:Name="pullToRefresh"
PullingThreshold="120"
RefreshContentHeight="30"
RefreshContentThreshold="30"
RefreshContentWidth="30">
<syncfusion:SfPullToRefresh.PullableContent>
<Label x:Name="Monthlabel"
TextColor="White"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Start" />
</syncfusion:SfPullToRefresh.PullableContent>
PullingThershold
Gets or sets the value for the refresh content threshold. This indicates the maximum pulling position of progress indicator in view.
Declaration
public double PullingThershold { get; set; }
Property Value
| Type |
|---|
| System.Double |
Examples
pullToRefresh.PullingThreshold = 200d;
PullingThreshold
Gets or sets the value for the refresh content threshold. This indicates the maximum pulling position of progress indicator in view.
Declaration
public double PullingThreshold { get; set; }
Property Value
| Type |
|---|
| System.Double |
Examples
pullToRefresh.PullingThreshold = 200d;
PullingViewTemplate
Gets or sets the template that is used to display the custom view inside SfProgressCircleView when pulling action is performed.
Declaration
public DataTemplate PullingViewTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.DataTemplate | The template that displays the contents of a PullingViewTemplate. |
Remarks
Only HorizontalOptions.FillAndExpand will be considered when the template is layout. Other HorizontalOptions and VerticalOptions will not be considered when the template is layout. Height has set to PullingViewTemplate view ,Should assign the same height value of the template to the PullingThershold in order to bring the full template to view when pulling.
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<sfPullToRefresh:SfPullToRefresh>
<sfPullToRefresh:SfPullToRefresh.PullingViewTemplate>
<DataTemplate>
<Label Text = "{Binding Index}"
HorizontalTextAlignment = "Center"
VerticalTextAlignment = "Center"
/>
</DataTemplate>
<sfPullToRefresh:SfPullToRefresh.PullingViewTemplate/>
<sfPullToRefresh:SfPullToRefresh/>
RefreshCommand
Gets or sets the refresh command.
Declaration
public ICommand RefreshCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
Remarks
The command's CanExecute() will be triggered when pulling action is performed. If false is returned from CanExecute() then pulling is stopped, the command will not be executed and refreshing does not happen.
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<syncfusion:SfPullToRefresh x:Name="pullToRefresh"
IsRefreshing="{Binding IsRefreshing}"
PullingThreshold="100"
RefreshContentHeight="30"
RefreshContentThreshold="30"
RefreshContentWidth="30"
RefreshCommand="{Binding RefreshCommand}">
RefreshCommandParameter
Gets or sets the parameter for the RefreshCommand.
Declaration
public object RefreshCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<StackLayout x:Name="stack">
<Button x:Name="button" Text="Pull" Clicked="button_Clicked" HeightRequest="100"></Button>
<syncfusion:SfPullToRefresh x:Name="pullToRefresh"
IsRefreshing="{Binding IsRefreshing}"
PullingThreshold="100"
RefreshContentHeight="30"
RefreshContentThreshold="30"
RefreshContentWidth="30"
RefreshCommandParameter="{x:Reference button}"/>
</syncfusion:SfPullToRefresh>
</StackLayout>
RefreshContentHeight
Gets or sets the value for the refresh content height.
Declaration
public double RefreshContentHeight { get; set; }
Property Value
| Type |
|---|
| System.Double |
Examples
pullToRefresh.RefreshContentHeight = 50d;
RefreshContentThreshold
Gets or sets the refresh content threshold value that indicates progress indicator starting position in view.
Declaration
public double RefreshContentThreshold { get; set; }
Property Value
| Type |
|---|
| System.Double |
Examples
pullToRefresh.RefreshContentThreshold = 50d;
RefreshContentWidth
Gets or sets the value for the refresh content width.
Declaration
public double RefreshContentWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
Examples
pullToRefresh.RefreshContentWidth = 50d;
RefreshingViewTemplate
Gets or sets the template that is used to display the custom view inside SfProgressCircleView when refreshing action is performed.
Declaration
public DataTemplate RefreshingViewTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.DataTemplate | The template that displays the contents of a RefreshingViewTemplate. |
Remarks
Only HorizontalOptions.FillAndExpand will be considered when the template is layout. Other HorizontalOptions and VerticalOptions will not be considered when the template is layout. Height has set to PullingViewTemplate view ,Should assign the same height value of the template to the PullingThershold in order to bring the full template to view when pulling.
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<sfPullToRefresh:SfPullToRefresh>
<sfPullToRefresh:SfPullToRefresh.RefreshingViewTemplate>
<DataTemplate>
<Label Text = "{Binding Index}"
HorizontalTextAlignment = "Center"
VerticalTextAlignment = "Center"
/>
</DataTemplate>
<sfPullToRefresh:SfPullToRefresh.RefreshingViewTemplate/>
<sfPullToRefresh:SfPullToRefresh/>
SfProgressCircleView
Gets SfProgressCircleView in SfPullToRefresh.
Declaration
public SfProgressCircleView SfProgressCircleView { get; }
Property Value
| Type |
|---|
| Syncfusion.SfPullToRefresh.XForms.SfProgressCircleView |
TransitionMode
Gets or sets the transition mode of SfPullToRefresh.
Declaration
public TransitionType TransitionMode { get; set; }
Property Value
| Type |
|---|
| TransitionType |
Examples
pullToRefresh.TransitionMode = TransitionType.SlideOnTop;
Methods
add_Pulling(PullingEventHandler)
Declaration
public void add_Pulling(PullingEventHandler value)
Parameters
| Type | Name | Description |
|---|---|---|
| PullingEventHandler | value |
add_Refreshed(RefreshedEventHandler)
Declaration
public void add_Refreshed(RefreshedEventHandler value)
Parameters
| Type | Name | Description |
|---|---|---|
| RefreshedEventHandler | value |
add_Refreshing(RefreshingEventHandler)
Declaration
public void add_Refreshing(RefreshingEventHandler value)
Parameters
| Type | Name | Description |
|---|---|---|
| RefreshingEventHandler | value |
Dispose()
Performs final clean up before released from memory.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | if true - release both managed and unmanaged resources; if false - release only unmanaged resources. |
EndRefreshing()
Ends refreshing the pullable content stopping the refreshing animation.
Declaration
public void EndRefreshing()
LayoutChildren(Double, Double, Double, Double)
Positions and sizes the children of SfDataGrid.
Declaration
protected override void LayoutChildren(double x, double y, double width, double height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | A value that represents the x coordinate of the child. |
| System.Double | y | A value that represents the y coordinate of the child. |
| System.Double | width | A value that represents the width of the child. |
| System.Double | height | A value that represents the height of the child. |
remove_Pulling(PullingEventHandler)
Declaration
public void remove_Pulling(PullingEventHandler value)
Parameters
| Type | Name | Description |
|---|---|---|
| PullingEventHandler | value |
remove_Refreshed(RefreshedEventHandler)
Declaration
public void remove_Refreshed(RefreshedEventHandler value)
Parameters
| Type | Name | Description |
|---|---|---|
| RefreshedEventHandler | value |
remove_Refreshing(RefreshingEventHandler)
Declaration
public void remove_Refreshing(RefreshingEventHandler value)
Parameters
| Type | Name | Description |
|---|---|---|
| RefreshingEventHandler | value |
StartRefreshing()
Starts refreshing the pullable content displaying the refreshing animation.
Declaration
public void StartRefreshing()
Events
Pulling
Occurs when the pulling operation is done.
Declaration
public event PullingEventHandler Pulling
Event Type
| Type |
|---|
| PullingEventHandler |
Refreshed
Occurs when completing the refreshing.
Declaration
public event RefreshedEventHandler Refreshed
Event Type
| Type |
|---|
| RefreshedEventHandler |
Refreshing
Occurs when starting the refreshing operation.
Declaration
public event RefreshingEventHandler Refreshing
Event Type
| Type |
|---|
| RefreshingEventHandler |