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