Пример #1
0
        private async void onClickSiguiente(object sender, RoutedEventArgs e)
        {
            this.nombre = nombrePlan.Text;
            this.descripcion = descripcionPlan.Text;
            this.fecha = fechaPlan.Date.Day + "/" + fechaPlan.Date.Month + "/" + fechaPlan.Date.Year;
            this.hora = configurarHora(horaPlan.Time.Hours, horaPlan.Time.Minutes);

            if (nombre.Equals("") && descripcion.Equals(""))
            {
                var dialog = new Windows.UI.Popups.MessageDialog("Por favor llene los campos");
                dialog.Commands.Add(new Windows.UI.Popups.UICommand("OK") { Id = 0 });
                var result = await dialog.ShowAsync();
            }
            else
            {
                if (photo == null)
                {
                    var packageLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;
                    var assetsFolder = await packageLocation.GetFolderAsync("Assets");
                    photo = await assetsFolder.GetFileAsync("fotoplan.jpg");

                }

                Plan plan = new Plan()
                {
                    NombrePlan = nombre,
                    DescripcionPlan = descripcion,
                    FechaPlan = fecha,
                    HoraPlan = hora,
                    ImagenPlan = photo
                };
                Frame rootFrame = Window.Current.Content as Frame;
                rootFrame.Navigate(typeof(AddMapa), plan);
            }
        }
Пример #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            plan = e.Parameter as Plan;

        }