// Llena vista con datos.
        private void llenarVentana(string buscar)
        {
            xmlReader xml = new xmlReader(Application.GetResourceStream(new Uri("lugares.xml", System.UriKind.Relative)));

            List <Tienda> listaTienea = xml.retornarHtml(buscar);
            int           contador    = 1;

            foreach (Tienda tienda in listaTienea)
            {
                TextBlock txtNombreLocal = new TextBlock();
                txtNombreLocal.Text       = tienda.Nombre;
                txtNombreLocal.FontSize   = 36;
                txtNombreLocal.Foreground = new SolidColorBrush(Color.FromArgb(255, 243, 230, 184));
                txtNombreLocal.FontWeight = FontWeights.Bold;

                TextBlock txtDescripcionLocal = new TextBlock();
                txtDescripcionLocal.Text       = tienda.Dirección;
                txtDescripcionLocal.Foreground = new SolidColorBrush(Color.FromArgb(255, 243, 230, 184));

                TextBlock txtComunaLocal = new TextBlock();
                txtComunaLocal.Text       = tienda.Comuna;
                txtComunaLocal.Foreground = new SolidColorBrush(Color.FromArgb(255, 243, 230, 184));

                panelCentral.Children.Add(txtNombreLocal);
                panelCentral.Children.Add(txtDescripcionLocal);
                panelCentral.Children.Add(txtComunaLocal);

                contador++;
            }
        }
Esempio n. 2
0
        void Buscar_Loaded(object sender, RoutedEventArgs e)
        {
            xmlReader xml = new xmlReader(Application.GetResourceStream(new Uri("lugares.xml", System.UriKind.Relative)));

            List <string> comunas = xml.listaComunasLocales();

            listaLugarVista.ItemsSource = comunas;
        }
        private void cargarPushPin()
        {
            xmlReader      xml             = new xmlReader(Application.GetResourceStream(new Uri("lugares.xml", System.UriKind.Relative)));
            List <Pushpin> listaPushPinxml = xml.listarPushPin();

            foreach (Pushpin push in listaPushPinxml)
            {
                push.Tap += push_Tap;
                mapa.Children.Add(push);
            }
        }