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

How hide gently while appearing #6

Open
lorenzocostalunga opened this issue Jun 27, 2016 · 3 comments
Open

How hide gently while appearing #6

lorenzocostalunga opened this issue Jun 27, 2016 · 3 comments

Comments

@lorenzocostalunga
Copy link

I'm looking for a way to hide gently the popup while opening ...
Please help me

    public void HideNow()
    {
        tmrWait.Stop();
        isAppearing = false;

        tmrWait.Interval = Delay;

        realAnimationDuration = 1;

        tmrAnimation.Interval = AnimationInterval;
        tmrAnimation.Start();
        sw.Restart();
    }

Sorry for my bad english.

@ricardopolo
Copy link
Member

What issue are you having? Do you have an exception or something?
Try to be more specific please 😄

@lorenzocostalunga
Copy link
Author

I've done it.
I added a new method:

    //lorenzo
    public void HideNow(int newInterval, int newAnimationDuration)
    {
        tmrWait.Interval = newInterval == 0 ? 1 : newInterval;

        if (!isAppearing)
            realAnimationDuration = newAnimationDuration;

        AnimationDuration = newAnimationDuration;

        tmrAnimation.Start();
    }
    //lorenzo

This is the code that I used for testing:

    PopupNotifier popup = new PopupNotifier();

    private async void button2_Click(object sender, EventArgs e)
    {
        popup = new PopupNotifier();

        popup.TitleText = "Title";
        popup.ContentText = "Content";
        popup.ShowCloseButton = true;
        popup.ShowOptionsButton = false;
        popup.ShowGrip = true;

        popup.Delay = 4000;

        popup.AnimationInterval = 10;
        popup.AnimationDuration = 3000;
        popup.Scroll = true;

        popup.Image = Properties.Resources._157_GetPermission_48x48_72;

        popup.Popup();

        await Task.Delay(1500); // test job

        //popup.Hide();
        popup.HideNow(10, 300);
    }

Now the pop-up disappears with animation

Is there a way to set the duration of the animation for the disappearance?

Thank you

@ricardopolo
Copy link
Member

I'm afraid there is not way, but I'm not completely sure about it.

If you create that code in the project, offering this feature, and adds a Pull Request, I am happy to approve it!

Thanks for your comments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants