Skip to content
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

Add HandlerProperties.DisconnectPolicy for controlling when DisconnectHandler is called #23738

Merged
merged 22 commits into from
Jul 25, 2024

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jul 20, 2024

Description of Change

public static class HandlerProperties
{
    public static readonly BindableProperty DisconnectPolicyProperty;

    public static void SetDisconnectPolicy(BindableObject target, HandlerDisconnectPolicy value);
    public static HandlerDisconnectPolicy GetDisconnectPolicy(BindableObject target);
}
public enum HandlerDisconnectPolicy
{
    Automatic, // Default
    Manual
}
public static partial class ViewExtensions
{
    public static void DisconnectHandlers(this IView view);
}

@PureWeen PureWeen changed the title Initial Commit HandlerBehavior DisconnectionPolicy Jul 22, 2024
@albyrock87
Copy link
Contributor

BindableLayout should handle automatic disconnection too.
Probably we need to do the same in collection view.

@PureWeen
Copy link
Member Author

BindableLayout should handle automatic disconnection too. Probably we need to do the same in collection view.

Yea that's definitely the next stage

Once I get all these tests passing and the new APIs merged I'll started iterating on the cases a bit more

src/Core/src/Primitives/HandlerDisconnectPolicy.cs Outdated Show resolved Hide resolved
src/Core/src/ViewExtensions.cs Outdated Show resolved Hide resolved
src/Core/src/ViewExtensions.cs Show resolved Hide resolved
src/Core/src/Core/IHandlerBehaviors.cs Outdated Show resolved Hide resolved
src/Controls/src/Core/Handlers/HandlerBehavior.cs Outdated Show resolved Hide resolved
@PureWeen PureWeen marked this pull request as draft July 23, 2024 19:49
@PureWeen PureWeen marked this pull request as ready for review July 23, 2024 21:17
mattleibow
mattleibow previously approved these changes Jul 23, 2024
@PureWeen PureWeen changed the title HandlerBehavior DisconnectionPolicy HandlerProperties DisconnectionPolicy Jul 23, 2024
@mattleibow mattleibow changed the title HandlerProperties DisconnectionPolicy Add HandlerProperties.DisconnectPolicy for controlling when DisconnectHandler is called Jul 23, 2024
mattleibow
mattleibow previously approved these changes Jul 23, 2024
@PureWeen
Copy link
Member Author

/rebase

@PureWeen
Copy link
Member Author

  • failing tests on android are unrelated

@PureWeen PureWeen merged commit f44bdc4 into net9.0 Jul 25, 2024
109 of 112 checks passed
@PureWeen PureWeen deleted the fix_16332 branch July 25, 2024 20:51
@danies8
Copy link

danies8 commented Jul 29, 2024

@mattleibow @PureWeen
What about net 8 ?

@RuddyOne
Copy link

RuddyOne commented Sep 9, 2024

Is this not coming to .NET 8?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants