示例#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();
                }
            });
        }
示例#2
0
        public LoginPage()
        {
            this.InitializeComponent();
            this.KeyDown += LoginPage_KeyDown;

            LoginVM          = new LoginViewModel();
            this.DataContext = LoginVM;

            if (ApiInformationHelper.HasStatusBar())
            {
                StatusBar.GetForCurrentView().BackgroundColor   = (App.Current.Resources["MyerListBlueLight"] as SolidColorBrush).Color;
                StatusBar.GetForCurrentView().BackgroundOpacity = 0.01;
                StatusBar.GetForCurrentView().ForegroundColor   = Colors.White;
            }

            Messenger.Default.Register <GenericMessage <string> >(this, "toast", act =>
            {
                var msg = act.Content;
                ToastControl.ShowMessage(msg);
            });
        }