/// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Classes.Entidade ent = e.Parameter as Classes.Entidade;
            this.ent          = ent;
            NomeEnt.Text      = ent.Nome;
            MoradaEnt.Text    = ent.Morada;
            CodPostalEnt.Text = ent.Codigo_Postal;

            TeleEnt.Text  = ent.Telefone.ToString();
            EmailEnt.Text = ent.Email;

            if (ent.Fax.ToString() == "0")
            {
                FaxEnt.Text       = "Não Disponível";
                FaxEnt.Foreground = new SolidColorBrush(Colors.Gray);
            }
            else
            {
                FaxEnt.Text = ent.Fax.ToString();
            }

            ImageEnt.Source = new BitmapImage(new Uri(ConfigData.Iconpath + ent.Anexo, UriKind.Absolute));
            Translate();
            MapFrame.Navigate(typeof(Pages.Contactos), ent);
        }
Example #2
0
        private void NavView_Navigate(NavigationViewItem item)
        {
            switch (item.Tag)
            {
            //Test Interweb
            case "network":
                MapFrame.Navigate(typeof(NetworkCheck));
                break;

            //select API or Reference
            case "API":
                MapFrame.Navigate(typeof(DrawMap));
                break;

            //select algorithm
            case "algo":
                MapFrame.Navigate(typeof(Algorithm));
                break;

            //Get Input
            case "Locations":
                MapFrame.Navigate(typeof(SelectLocations));
                break;

            //figure it out
            case "calc":
                MapFrame.Navigate(typeof(GetRoute));
                break;
            }
        }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            MainPage.instance.change_title("Esquadra mais próxima");
            DatabaseHelperClass dbtemas = new DatabaseHelperClass();
            ObservableCollection <Classes.Entidade> EntList = dbtemas.ReadEntidade();

            this.EntList = EntList;
            CalcDist();
            closest_police();
            NomeEnt.Text      = closest.Nome;
            MoradaEnt.Text    = closest.Morada;
            CodPostalEnt.Text = closest.Codigo_Postal;

            TeleEnt.Text  = closest.Telefone.ToString();
            EmailEnt.Text = closest.Email;

            if (closest.Fax.ToString() == "0")
            {
                FaxEnt.Text       = "Não Disponível";
                FaxEnt.Foreground = new SolidColorBrush(Colors.Gray);
            }
            else
            {
                FaxEnt.Text = closest.Fax.ToString();
            }

            ImageEnt.Source = new BitmapImage(new Uri(ConfigData.Iconpath + closest.Anexo, UriKind.Absolute));
            MapFrame.Navigate(typeof(Pages.Contactos), closest);
            Translate();
        }
Example #4
0
 private void Options_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
 {
     if (args.IsSettingsInvoked)
     {
         MapFrame.Navigate(typeof(Settings));
     }
     else
     {
         // find NavigationViewItem with Content that equals InvokedItem
         var item = sender.MenuItems.OfType <NavigationViewItem>().First(x => (string)x.Content == (string)args.InvokedItem);
         NavView_Navigate(item as NavigationViewItem);
     }
 }