Class PullToRefreshView
Represents a customized Xamarin.Forms.View that loads when an end-user pulls the grid down to refresh data.
Inheritance
Implements
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class PullToRefreshView : Layout<View>, IDisposable
Constructors
PullToRefreshView()
Initializes a new instance of the PullToRefreshView class.
Declaration
public PullToRefreshView()
Properties
IsIndeterminate
Gets or sets a value indicating whether the indeterminate state of the pull to refresh view. The pull to refresh view will be in indeterminate state when the view is executing the PullToRefreshCommand.
Declaration
public bool IsIndeterminate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the pull to refresh view is in indeterminate state, otherwise false. The default value is false. |
Remarks
The pull to refresh view will be in indeterminate state, in the mean time pull to refresh command is executed, Refer the below code example in which the IsIndeterminate state is set as true before executing the PullToRefreshCommand and set as false, once the command is executed.
The indeterminate state of the pull to refresh view can also be tracked by the IsBusy property.
Examples
dataGrid.AllowPullToRefresh = true;
dataGrid.PullToRefreshView.PullToRefreshCommand = new Command(ExecutePullToRefreshCommand);
private async void ExecutePullToRefreshCommand()
{
dataGrid.PullToRefreshView.IsIndeterminate = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.ItemsSourceRefresh ();
dataGrid.PullToRefreshView.IsIndeterminate = false;
}
See Also
Progress
Gets or sets the progress of pulling in the pull to refresh view can be tracked using this property. Once, the pulling progress is reached 100 %, PullToRefreshCommand fires, executing the command to be performed when the grid is pulled down for refreshing.
Declaration
public int Progress { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The progress of pulling in the pull to refresh view. |
Remarks
The user can manually refresh the grid in runtime by setting the Progress to 100.
Examples
dataGrid.PullToRefreshView.Progress = 100;
PullToRefreshCommand
Gets or sets the command to be executed when performing the pulling operation to refresh the grid. This command will be fired upon performing the pulling operation for doing the refreshing operation.
Declaration
public ICommand PullToRefreshCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when PullToRefresh action is performed. |
Remarks
SfDataGrid provides an option to refresh it when performing the pulling action. PullToRefreshCommand will be fired to refresh (add, delete or modify the underlying data) the grid. A busy indicator will be displayed to denote the refreshing operation.
The pull to refresh command can also be set using PullToRefreshCommand property.
Examples
dataGrid.AllowPullToRefresh = true;
dataGrid.PullToRefreshView.PullToRefreshCommand = new Command(ExecutePullToRefreshCommand);
private async void ExecutePullToRefreshCommand()
{
this.dataGrid.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.ItemsSourceRefresh ();
this.dataGrid.IsBusy = false;
}
See Also
Methods
Dispose()
Releases all resources used by the component.
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. |
LayoutChildren(Double, Double, Double, Double)
Layout the children in the PullToRefreshView.
Declaration
protected override void LayoutChildren(double x, double y, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | x position. |
System.Double | y | y position. |
System.Double | width | width value. |
System.Double | height | height value. |