microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.83k stars 372 forks source link

feat: PullToRefresh #1666

Closed lukedukeus closed 8 months ago

lukedukeus commented 8 months ago

🙋 Feature Request

It would be cool to have a container thay you could swipe down on to invoke a refresh method.

🤔 Expected Behavior

pull-to-refresh More Details

😯 Current Behavior

N/A

💁 Possible Solution

I would expect the usage to be something like:

<FluentPullToRefresh OnRefresh="OnRefresh" Refreshing="refreshing">
    <FluentNavMenu Title="Weather">
        @foreach (var day in forecast)
        {
            <WeatherTile Forecast="@day" />
        }
    </FluentNavMenu>
</FluentPullToRefresh>

@code
{
    private List<WeatherForcast> forecast = new List<WeatherForcast>();

    private bool refreshing = false;

    private void OnRefresh()
    {
        refreshing = true;

        forecast = await weatherService.GetForecast();

        refreshing = false;
    }
}

🔦 Context

I am trying to add a pull to refresh container as it how most users expect to be able to refresh section of data

💻 Examples

See expected behavior

vnbaaij commented 8 months ago

Moving this to the discussion area to see if there is interest in such functionality