Exemplo n.º 1
0
        public void ReceiveMessage(object Message)
        {
            if (Message != null)
            {
                ViewMessage ReceivedMessage = (ViewMessage)Message;

                switch (ReceivedMessage.CurrentAction)
                {
                case ViewAction.ChangeScreen:

                    ViewType FromType = (ViewType)ReceivedMessage.MessageObject;
                    ViewType ToType   = (ViewType)ReceivedMessage.AnotherMessageObject;

                    if (FromType == ViewType.StartingView)
                    {
                        CurrentMenuBarView.UnBlockHome();
                        ((Storyboard)this.FindResource("OnLoaded1")).Begin(this);

                        App.MsgManager.PublishMessageByType <ViewMessage>
                        (
                            new ViewMessage()
                        {
                            CurrentAction = ViewAction.StartMainAnimation
                        }
                        );
                    }

                    switch (FromType)
                    {
                    case ViewType.StartingView:
                    case ViewType.DocsView:
                    case ViewType.FriendsView:
                    case ViewType.AreaView:
                    case ViewType.MainView:

                        if (!TransitionContainer.Items.Contains(ViewsList.Where(V => V.ViewT == ToType).FirstOrDefault().View))
                        {
                            TransitionContainer.Items.Add(ViewsList.Where(V => V.ViewT == ToType).FirstOrDefault().View);
                            TransitionContainer.ApplyTransition(ViewsList.Where(V => V.ViewT == FromType).FirstOrDefault().View, ViewsList.Where(V => V.ViewT == ToType).FirstOrDefault().View);
                            TransitionContainer.Items.Remove(ViewsList.Where(V => V.ViewT == FromType).FirstOrDefault().View);
                        }

                        break;

                    case ViewType.Any:

                        if (!TransitionContainer.Items.Contains(ViewsList.Where(V => V.ViewT == ToType).FirstOrDefault().View))
                        {
                            TransitionContainer.Items.Add(ViewsList.Where(V => V.ViewT == ToType).FirstOrDefault().View);
                            TransitionContainer.ApplyTransition(TransitionContainer.Items.GetItemAt(0) as FrameworkElement, ViewsList.Where(V => V.ViewT == ToType).FirstOrDefault().View);
                            TransitionContainer.Items.Remove(TransitionContainer.Items.GetItemAt(0) as FrameworkElement);
                        }
                        break;
                    }

                    break;
                }
            }
        }
Exemplo n.º 2
0
        public void ReceiveMessage(object Message)
        {
            if (Message != null)
            {
                ViewMessage ReceivedMessage = (ViewMessage)Message;

                switch (ReceivedMessage.CurrentAction)
                {
                case ViewAction.ToFriendDetailedView:
                    TransitionContainer.ApplyTransition(this.FriendsListVw, this.DetailedListVw);
                    break;

                case ViewAction.ToFriendListView:
                    TransitionContainer.ApplyTransition(this.DetailedListVw, this.FriendsListVw);
                    break;
                }
            }
        }
        public void ReceiveMessage(object Message)
        {
            if (Message != null)
            {
                ViewMessage ReceivedMessage = (ViewMessage)Message;

                switch (ReceivedMessage.CurrentAction)
                {
                case ViewAction.ToSecondStartingView:
                    TransitionContainer.ApplyTransition(this.FView, this.SView);
                    break;

                case ViewAction.ToThirdStartingView:
                    TransitionContainer.ApplyTransition(this.SView, this.ThrView);
                    break;
                }
            }
        }
Exemplo n.º 4
0
        public void ReceiveMessage(object Message)
        {
            if (Message != null)
            {
                ViewMessage ReceivedMessage = (ViewMessage)Message;

                switch (ReceivedMessage.CurrentAction)
                {
                case ViewAction.ToOneAreaView:
                    TransitionContainer.ApplyTransition(this.AllAreaVw, this.AllAreaVw);
                    break;

                case ViewAction.ToAllAreaView:
                    TransitionContainer.ApplyTransition(this.OneAreaVw, this.AllAreaVw);
                    break;
                }
            }
        }