Esempio n. 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();
                }
            });
        }
Esempio n. 2
0
 private void MaskBorder_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (_isDrawerSlided)
     {
         _isDrawerSlided = false;
         HamburgerBtn.PlayHamOutStory();
         SlideOutStory.Begin();
     }
 }
Esempio n. 3
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     if (_isDrawerSlided)
     {
         SlideOutStory.Begin();
         HamburgerBtn.PlayHamOutStory();
         _isDrawerSlided = false;
     }
 }
Esempio n. 4
0
 private void HandleBackLogic()
 {
     if (_isAddingPaneShowed)
     {
         RemoveStory.Begin();
         _isAddingPaneShowed = false;
     }
     if (_isDrawerSlided)
     {
         SlideOutStory.Begin();
         HamburgerBtn.PlayHamOutStory();
         _isDrawerSlided = false;
     }
 }