Exemplo n.º 1
0
 void MenuContent_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
 {
     if (e.FinalVelocities.LinearVelocity.Y < -500)
     {
         Main_ChangeCity_Up.Begin();
     }
 }
Exemplo n.º 2
0
        void MenuContent_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            Grid grid = sender as Grid;
            CompositeTransform transform = grid.RenderTransform as CompositeTransform;

            if (e.DeltaManipulation.Translation.Y < 0)
            {
                transform.TranslateY += e.DeltaManipulation.Translation.Y;
            }
            if (transform.TranslateY < 400)
            {
                Main_ChangeCity_Up.Begin();
            }
        }
Exemplo n.º 3
0
 protected override void OnBackKeyPress(CancelEventArgs e)
 {
     if (isChangeCityVisible)
     {
         Main_ChangeCity_Up.Begin();
         isChangeCityVisible = !isChangeCityVisible;
         e.Cancel            = true;
     }
     if (e.Cancel == false)
     {
         Exit();
     }
     base.OnBackKeyPress(e);
 }
Exemplo n.º 4
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            AMapConfig.Key = "2b5d786b9df88425dd1aa3b863a5a1a2";

            Messenger.Default.Register <string>(this, "Navigate",
                                                uri =>
            {
                if (uri != null)
                {
                    NavigationService.Navigate(new Uri(uri, UriKind.Relative));
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "NavigateToJobNewsDetail",
                                                uri =>
            {
                if (uri != null)
                {
                    NavigationService.Navigate(new Uri(uri, UriKind.Relative));
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "NavigateToOtherPage",
                                                uri =>
            {
                if (uri != null)
                {
                    NavigationService.Navigate(new Uri(uri, UriKind.Relative));
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "ChangeCityComplete",
                                                (s) =>
            {
                Main_ChangeCity_Up.Begin();
                isChangeCityVisible = !isChangeCityVisible;
            }
                                                );
            Messenger.Default.Register <string>(this, "JobLoadCompleted",
                                                (empty) =>
            {
                DispatcherHelper.CheckBeginInvokeOnUI(() =>
                {
                    tb_jobEmpty.Visibility = System.Windows.Visibility.Collapsed;
                    pb_loadJob.Visibility  = System.Windows.Visibility.Collapsed;
                });
            }
                                                );
            Messenger.Default.Register <string>(this, "JobEmpty",
                                                (empty) =>
            {
                DispatcherHelper.CheckBeginInvokeOnUI(() =>
                {
                    tb_jobEmpty.Visibility = System.Windows.Visibility.Visible;
                    pb_loadJob.Visibility  = System.Windows.Visibility.Collapsed;
                });
            }
                                                );

            Messenger.Default.Register <int>(this, "JobLoadCompleted",
                                             (count) =>
            {
                // this.jobListBox.ScrollIntoView
                //  this.jobListBox.mainPanel.ScrollIntoView(jobListBox.mainPanel.Items[count - 1]);
                //  this.jobListBox.UpdateLayout();
                //  this.jobListBox.mainPanel.UpdateLayout();
                jobListBox.IsLoading = false;
            }
                                             );
            Messenger.Default.Register <string>(this, "JobRefreshCompleted",
                                                (empty) =>
            {
                jobListBox.IsRefreshing = false;
            }
                                                );
        }