Skip to content

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

Merged
PureWeen merged 22 commits into
net9.0from
fix_16332
Jul 25, 2024
Merged

Add HandlerProperties.DisconnectPolicy for controlling when DisconnectHandler is called#23738
PureWeen merged 22 commits into
net9.0from
fix_16332

Conversation

@PureWeen

@PureWeen PureWeen commented Jul 20, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

@PureWeen

Copy link
Copy Markdown
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

@PureWeen PureWeen marked this pull request as ready for review July 23, 2024 17:49
@PureWeen PureWeen requested a review from a team as a code owner July 23, 2024 17:49
@PureWeen PureWeen requested review from jsuarezruiz and rmarinho July 23, 2024 17:49
Comment thread src/Core/src/Primitives/HandlerDisconnectPolicy.cs Outdated
Comment thread src/Core/src/ViewExtensions.cs Outdated
Comment thread src/Core/src/ViewExtensions.cs
Comment thread src/Core/src/Core/IHandlerBehaviors.cs Outdated
Comment thread src/Controls/src/Core/Handlers/HandlerBehavior.cs Outdated
Comment thread src/Controls/src/Core/Page/NavigatedFromEventArgs.cs Outdated
@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
Comment thread src/Core/src/ViewExtensions.cs
@PureWeen

Copy link
Copy Markdown
Member Author

/rebase

@PureWeen

Copy link
Copy Markdown
Member Author
  • failing tests on android are unrelated

@PureWeen PureWeen merged commit f44bdc4 into net9.0 Jul 25, 2024
@PureWeen PureWeen deleted the fix_16332 branch July 25, 2024 20:51
@danies8

danies8 commented Jul 29, 2024

Copy link
Copy Markdown

@mattleibow @PureWeen
What about net 8 ?

@RuddyOne

RuddyOne commented Sep 9, 2024

Copy link
Copy Markdown

Is this not coming to .NET 8?

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2024
@samhouts samhouts added the fixed-in-net8.0-nightly This may be available in a nightly release! label Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

fixed-in-net8.0-nightly This may be available in a nightly release! 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