Exemplo n.º 1
0
        // Internal

        internal void RemovePopupFromStack(IPopupPage page)
        {
            if (_popupStack.Contains(page))
            {
                _popupStack.Remove(page);
            }
        }
Exemplo n.º 2
0
        public DayButton(ClickableTableCell _tc, int d, int m, int y, IPopupPage p, About pg)
        {
            // Přiřazení proměnných
            day   = d;
            month = m;
            year  = y;
            page  = p;
            tc    = _tc;


            // Event kliknutí
            tc.Click += lb_Click;

            tc.VerticalAlign   = VerticalAlign.Top;
            tc.HorizontalAlign = HorizontalAlign.Right;
            tc.RowSpan         = 1;
            tc.Wrap            = false;

            cisloLabel          = new Label();
            cisloLabel.CssClass = "cisloLabel";
            cisloLabel.Text     = day.ToString();



            bunkaLabel          = new Label();
            bunkaLabel.CssClass = "bunkaLabel";


            tc.Controls.Add(cisloLabel);
            tc.Controls.Add(new LiteralControl("<br /><br />"));
            tc.Controls.Add(bunkaLabel);
            tc.ID = d + m + y + "cb";



            tc.ID = d + m + y + "cb";
            AsyncPostBackTrigger trg = new AsyncPostBackTrigger();

            trg.ControlID = tc.ID;
            trg.EventName = "Click";
            pg.updPan.Triggers.Add(trg);
        }
Exemplo n.º 3
0
        public Task PushAsync(IPopupPage page, bool animate = true)
        {
            lock (_locker)
            {
                if (_popupStack.Contains(page))
                {
                    throw new InvalidOperationException("The page has been pushed already. Pop or remove the page before to push it again");
                }

                Pushing?.Invoke(this, new PopupNavigationEventArgs(page, animate));

                _popupStack.Add(page);

                var task = InvokeThreadSafe(async() =>
                {
                    animate = CanBeAnimated(animate);

                    if (animate)
                    {
                        page.PreparingAnimation();
                        await AddAsync(page);
                        await page.AppearingAnimation();
                    }
                    else
                    {
                        await AddAsync(page);
                    }

                    page.AppearingTransactionTask = null;

                    Pushed?.Invoke(this, new PopupNavigationEventArgs(page, animate));
                });

                page.AppearingTransactionTask = task;

                return(task);
            }
        }
 public PopupNavigationEventArgs(IPopupPage page, bool isAnimated)
 {
     Page       = page;
     IsAnimated = isAnimated;
 }
 public static Task PushPopupAsync(this INavigation sender, IPopupPage page, bool animate = true)
 {
     return(PopupNavigation.Instance.PushAsync(page, animate));
 }
 public static Task RemovePopupPageAsync(this INavigation sender, IPopupPage page, bool animate = true)
 {
     return(PopupNavigation.Instance.RemovePageAsync(page, animate));
 }
Exemplo n.º 7
0
        async Task RemoveAsync(IPopupPage page)
        {
            await PopupPlatform.RemoveAsync(page);

            _popupStack.Remove(page);
        }
Exemplo n.º 8
0
        // Private

        async Task AddAsync(IPopupPage page)
        {
            _popupStack.Add(page);
            await PopupPlatform.AddAsync(page);
        }
Exemplo n.º 9
0
        public Task RemovePageAsync(IPopupPage page, bool animate = true)
        {
            lock (_locker)
            {
                if (page == null)
                {
                    throw new NullReferenceException("Page can not be null");
                }

                if (!_popupStack.Contains(page))
                {
                    throw new InvalidOperationException("The page has not been pushed yet or has been removed already");
                }

                if (page.DisappearingTransactionTask != null)
                {
                    return(page.DisappearingTransactionTask);
                }

                var task = InvokeThreadSafe(async() =>
                {
                    if (page.AppearingTransactionTask != null)
                    {
                        await page.AppearingTransactionTask;
                    }

                    lock (_locker)
                    {
                        if (!_popupStack.Contains(page))
                        {
                            return;
                        }
                    }

                    Popping?.Invoke(this, new PopupNavigationEventArgs(page, animate));

                    animate = CanBeAnimated(animate);

                    if (animate)
                    {
                        await page.DisappearingAnimation();
                    }

                    await RemoveAsync(page);

                    if (animate)
                    {
                        page.DisposingAnimation();
                    }

                    lock (_locker)
                    {
                        _popupStack.Remove(page);
                        page.DisappearingTransactionTask = null;

                        Popped?.Invoke(this, new PopupNavigationEventArgs(page, animate));
                    }
                });

                page.DisappearingTransactionTask = task;

                return(task);
            }
        }
Exemplo n.º 10
0
 public Schedule(Table usedTable, IPopupPage up, About mpg)
 {
     ScheduleTable = usedTable;
     usedPage      = up;
     mPage         = mpg;
 }