Example #1
0
        public void ChangePage(string newPageName, ChangePageDirection direction)
        {
            var newPage = _pages[newPageName].GetConstructor(Type.EmptyTypes).Invoke(new object[] { }) as UserControl;

            if (CurrentPage != null && AnimationManager != null)
            {
                switch (direction)
                {
                case ChangePageDirection.Forward:
                    AnimationManager.AnimateForwardPage(newPage, CurrentPage);
                    break;

                case ChangePageDirection.Backward:
                    AnimationManager.AnimateBackwardPage(newPage, CurrentPage);
                    break;
                }
            }

            CurrentPage = newPage;
        }
 public PageChangedEvent(ChangePageDirection direction)
 {
     Direction = direction;
 }
 public static void PublishPageChangedEvent(this IEventBus eventBus, ChangePageDirection direction)
 {
     eventBus.Publish(new PageChangedEvent(direction));
 }
 public ChangePageEventArgs(Control newPage, Control oldPage, ChangePageDirection direction)
 {
     NewPage   = newPage;
     OldPage   = oldPage;
     Direction = direction;
 }