Beispiel #1
0
        public MainPage()
        {
            this.InitializeComponent();

            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.ToastToken, msg =>
            {
                ToastControl.ShowMessage(msg.Content);
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.CloseHam, msg =>
            {
                if (_isDrawerSlided)
                {
                    SlideOutStory.Begin();
                    HamburgerBtn.PlayHamOutStory();
                    _isDrawerSlided = false;
                }
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.RemoveScheduleUI, msg =>
            {
                RemoveStory.Begin();
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.ShowModifyUI, msg =>
            {
                AddingPane.Visibility = Visibility.Visible;
                AddStory.Begin();
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.ChangeCommandBarToDelete, msg =>
            {
                SwitchCommandBarToDelete.Begin();
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.ChangeCommandBarToDefault, msg =>
            {
                SwitchCommandBarToDefault.Begin();
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.GoToSort, act =>
            {
                DisplayedListView.CanDragItems    = true;
                DisplayedListView.CanReorderItems = true;
                DisplayedListView.AllowDrop       = true;
            });
            Messenger.Default.Register <GenericMessage <string> >(this, MessengerTokens.LeaveSort, act =>
            {
                DisplayedListView.CanDragItems    = false;
                DisplayedListView.CanReorderItems = false;
                DisplayedListView.AllowDrop       = true;
            });
            RemoveStory.Completed += ((senderc, ec) =>
            {
                _isAddingPaneShowed = false;
            });

            this.KeyDown += ((sender, e) =>
            {
                if (_isAddingPaneShowed && e.Key == Windows.System.VirtualKey.Enter && e.KeyStatus.RepeatCount == 1)
                {
                    Messenger.Default.Send(new GenericMessage <string>(""), MessengerTokens.EnterToAdd);
                    RemoveStory.Begin();
                }
            });
        }
Beispiel #2
0
 private void HandleBackLogic()
 {
     if (_isAddingPaneShowed)
     {
         RemoveStory.Begin();
         _isAddingPaneShowed = false;
     }
     if (_isDrawerSlided)
     {
         SlideOutStory.Begin();
         HamburgerBtn.PlayHamOutStory();
         _isDrawerSlided = false;
     }
 }