-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor IsRefreshing
property to separate animation and command execution responsibilities
#15732
Conversation
Hey there @japarson! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
IsRefreshing
property to separate animation and command execution responsibilities
The initial spec called for a visualization property public static readonly BindableProperty VisualizationStateProperty;
public RefreshVisualizationState VisualizationState { get; set; }
public enum RefreshVisualizationState
{
Idle,
Active
} Could we use that instead of causing breaking changes? |
/// <summary> | ||
/// Gets the command to be executed when the refresh is triggered. | ||
/// </summary> | ||
ICommand Command { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to pull ICommand
into core for this. This can instead be something like void UserRefreshing
and the commanding is all handled in controls.
Similar to IButton
maui/src/Core/src/Core/IButton.cs
Line 6 in 3b08c20
public interface IButton : IView, IPadding, IButtonStroke |
@japarson Could you rebase to fix the conflicts?. Let me know if you need help with anything. |
We will review the overall design of the |
What about NET 8? NET 9 is really far away. You should really reconsider the change for this year. |
The plan is to only document a workaround for #6456 right now. In the future, we will fix the issue as part of a larger set of improvements to the |
Description of Change
This pull request proposes a modification to the behavior of the
RefreshView
control.Currently, setting the
IsRefreshing
property to true in theRefreshView
control not only enables the loading animation but also triggers the associated command.To address this issue, the proposed change involves separating the responsibilities of the
IsRefreshing
property to achieve the desired behavior:But why is separating the responsibilities necessary?
As @janseris notes,
We could possibly rename the
IsRefreshing
property to better reflect its behavior, but this would create a breaking change. Some possibilities would be:If this change is accepted, I will also update the documentation which states:
Source: learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/refreshview?view=net-maui-7.0
Issues Fixed
Fixes #6456
Fixes #1171