private void generarAlerta(string mensaje)
        {
            NotificationConfig config = new NotificationConfig();

            config.Title     = Core.Constantes.Generales.nickNameDeLaApp;
            config.Html      = mensaje;
            config.Height    = 75;
            config.Width     = 300;
            config.HideDelay = 10000;
            config.BodyStyle = "padding:10px";
            config.Icon      = Icon.UserAlert;
            config.PinEvent  = "mouseover";

            SlideIn show = new SlideIn();

            show.Anchor = AnchorPoint.Right;

            SlideOut hide = new SlideOut();

            show.Anchor = AnchorPoint.Right;

            config.ShowFx = show;
            config.HideFx = hide;
            X.Msg.Notify(config).Show();
        }
        public static async Task SlideOut(this VisualElement element, SlideOut direction = Editors.SlideOut.ToTop, uint linearLength = 250, uint springLength = 50, int springiness = 20)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element), "must not be null");
            }
            var destX   = 0;
            var destY   = 0;
            var springX = 0;
            var springY = 0;

            switch (direction)
            {
            case Editors.SlideOut.ToLeft:
                destX   = -1000;
                springX = springiness;
                destY   = 0;
                springY = 0;
                break;

            case Editors.SlideOut.ToTop:
                destX   = 0;
                springX = 0;
                destY   = -1000;
                springY = springiness;
                break;

            case Editors.SlideOut.ToRight:
                destX   = 1000;
                springX = -springiness;
                destY   = 0;
                springY = 0;
                break;

            case Editors.SlideOut.ToBottom:
                destX   = 0;
                springX = 0;
                destY   = 1000;
                springY = springiness;
                break;
            }


            await element.TranslateTo(springX, springY, springLength, Easing.CubicOut);

            await element.TranslateTo(0, 0, springLength, Easing.CubicIn);

            await element.TranslateTo(destX, destY, linearLength, Easing.Linear);
        }
Пример #3
0
        public void TransitionAnimationSlideOut()
        {
            tlog.Debug(tag, $"TransitionAnimationSlideOut START");

            var testingTarget = new SlideOut(3000);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <SlideOut>(testingTarget, "should be an instance of SlideOut class!");

            var style = testingTarget.DefaultImageStyle;

            Assert.IsTrue(Window.Instance.GetWindowSize().Width == style.Size.Width);
            Assert.IsTrue(Window.Instance.GetWindowSize().Height == style.Size.Height);

            Assert.IsTrue(0 == testingTarget.AnimationDataList[0].StartTime);
            Assert.IsTrue(3000 == testingTarget.AnimationDataList[0].EndTime);
            Assert.IsTrue("PositionX" == testingTarget.AnimationDataList[0].Property);
            Assert.IsTrue(Window.Instance.GetWindowSize().Width.ToString() == testingTarget.AnimationDataList[0].DestinationValue);

            testingTarget.Dispose();
            tlog.Debug(tag, $"TransitionAnimationSlideOut END (OK)");
        }