Exemplo n.º 1
0
        /// <summary>
        /// </summary>
        private void ShowPreview(JToken mapset)
        {
            MapBanner.Alpha = 0;

            MapBanner.ClearAnimations();
            Title.ClearAnimations();
            Artist.ClearAnimations();
            Creator.ClearAnimations();
            DownloadButton.ClearAnimations();
            CancelButton.ClearAnimations();
            ViewMapsetPageButton.ClearAnimations();

            Title.Alpha                = 0;
            Artist.Alpha               = 0;
            Creator.Alpha              = 0;
            DownloadButton.Alpha       = 0;
            CancelButton.Alpha         = 0;
            ViewMapsetPageButton.Alpha = 0;

            Title.Text = mapset["title"].ToString();
            Title.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));

            Artist.Text = mapset["artist"].ToString();
            Artist.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));

            Creator.Text = "Created By: " + mapset["creator_username"];
            Creator.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));

            DownloadButton.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));
            CancelButton.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));
            ViewMapsetPageButton.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));

            Task.Run(async() =>
            {
                MapBanner.Image = await ImageDownloader.DownloadMapsetBanner((int)mapset["id"]);
                MapBanner.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300));
            });
        }
Exemplo n.º 2
0
        /// <summary>
        /// </summary>
        private void HidePreview()
        {
            MapBanner.ClearAnimations();
            MapBanner.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, MapBanner.Alpha, 0, 300));

            Title.ClearAnimations();
            Title.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Title.Alpha, 0, 300));

            Artist.ClearAnimations();
            Artist.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Artist.Alpha, 0, 300));

            Creator.ClearAnimations();
            Creator.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Creator.Alpha, 0, 300));

            DownloadButton.ClearAnimations();
            DownloadButton.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, DownloadButton.Alpha, 0, 300));

            CancelButton.ClearAnimations();
            CancelButton.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, CancelButton.Alpha, 0, 300));

            ViewMapsetPageButton.ClearAnimations();
            ViewMapsetPageButton.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, ViewMapsetPageButton.Alpha, 0, 300));
        }