rotorgames / Rg.Plugins.Popup

Xamarin Forms popup plugin
MIT License
1.15k stars 337 forks source link

Breakpoints in custom Animation are not hit #680

Closed Pantheas closed 3 years ago

Pantheas commented 3 years ago

Hi,

I'm facing the problem mentioned in this issue with your default animations.

As a work-around, I created a custom animation and instead of using the content parameter, I wanted to try using page.Content. However, I cannot see what value page.Content has at time when the animation gets invoked because my break points are not hit.

public class PopupMoveAnimation :
    MoveAnimation
{
    public override void Preparing(
        View content,
        PopupPage page)
    {
        base.Preparing(
            page.Content,
            page);
    }

    public override void Disposing(
        View content,
        PopupPage page)
    {
        base.Disposing(
            page.Content,
            page);
    }

    public override async Task Appearing(
        View content,
        PopupPage page)
    {
        await base.Appearing(
            page.Content,
            page);
    }

    public override async Task Disappearing(
        View content,
        PopupPage page)
    {
        await base.Disappearing(
            page.Content,
            page);
    }
}
<rgpages:PopupPage.Animation>
    <local:PopupMoveAnimation
        PositionIn="Left"
        PositionOut="Left"
        DurationIn="300"
        DurationOut="300"
        EasingIn="SinOut"
        EasingOut="SinIn"
        HasBackgroundAnimation="True" />
</rgpages:PopupPage.Animation> 

Is there anything I'm doing wrong? How can I fix it?

Thanks in advance and kind regards!

LuckyDucko commented 3 years ago

@Pantheas the breakpoint not getting hit can be a frustrating one

Could you try and make your animation within rg repo, putting your animation in the example rg project. Also, are you using Mac or PC, And finally, are your breakpoints hollow red, or solid red when running the project in debug mode

Pantheas commented 3 years ago

Nevermind, mistake was on my side by not setting IsAnimationEnabled=true... Sorry, sometimes I'm an idiot haha

LuckyDucko commented 3 years ago

@Pantheas don't worry, I can't count the number of times I have made the same type of mistake.