Example #1
0
        /// The methods provided in this section are simply used to allow
        /// NavigationHelper to respond to the page's navigation methods.
        ///
        /// Page specific logic should be placed in event handlers for the
        /// <see cref="GridCS.Common.NavigationHelper.LoadState"/>
        /// and <see cref="GridCS.Common.NavigationHelper.SaveState"/>.
        /// The navigation parameter is available in the LoadState method
        /// in addition to page state preserved during an earlier session.

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            navigationHelper.OnNavigatedTo(e);

            // Hide the on-canvas Back Button if we're on a phone or there's a shell drawn Back
            if (SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility == AppViewBackButtonVisibility.Visible ||
                Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                backButton.Visibility = Visibility.Collapsed;
            }

            var customerID = (long)e.Parameter;

            var custViewModel = CustomersViewModel.GetDefault();

            pageTitle.Text = custViewModel.GetItem(customerID).Name;

            if (viewModel != null && (customerID == viewModel.CustomerId) && (timestamp >= viewModel.Timestamp))
            {
                return;
            }

            viewModel = ProjectsViewModel.GetForCustomerId(customerID);
            ProjectsList.ItemsSource = viewModel.GetAllItems();

            timestamp = DateTime.Now;
        }
Example #2
0
 private void LoadData()
 {
     viewModel = CustomersViewModel.GetDefault();
     CustomersList.ItemsSource = viewModel.GetAllItems();
 }