async Task Cargar() { await App.metodos.ActualizarNuevoJuego(); configuracion = await App.metodos.CargarConfiguracion(); TiempoLimite = configuracion.TiempoLimite; factor = configuracion.TiempoLimite / 60; puntos = tiempo = mistakes = 0; segundos = minutos = horas = 0; int discoveredStates = await App.metodos.ContarEstadosDescubiertos(); txbUserName.Text = configuracion.Nombre; txtResults.Text = String.Format(@"{0} / {1}", discoveredStates, totalStates); txbTimer.Text = ConvertToTime(tiempo); share = new Share(AppInfo.Name, String.Format("My score in #AhorcadoDeEstados for #WindowsPhone is {0} pts and {1} victories. Can you beat me? Download it now!", configuracion.Puntos, configuracion.Victorias), AppInfo.Link); string url = "ms-appx:///Imagenes/ahorcado0.png"; BitmapImage img = new BitmapImage(new Uri(url)); imgAhorcado.Source = img; ActivarDetalle(false); txbResult.Text = ""; if (discoveredStates < totalStates) { estado = await App.metodos.ObtenerEstadoAleatorio(); if (!estado.Status) { txbResult.Text = "** NEW **"; txbResult.Foreground = new SolidColorBrush(Colors.Yellow); } txbEstado.Text = ConvertTo_(estado.Nombre); answer = estado.Nombre.ToUpper(); chars = 0; spaces = CountSpaceChars(answer); DibujarBotones(); MostrarControles(true); MostrarTaps(true); ControlarTiempo(); } else { txbResult.Text = "VICTORY!! :)"; txbEstado.FontSize = 19; txbEstado.Text = "Congratulations! You completed the game! Thanks for playing! Now you know the 32 Mexican federal entities. Share your progress with your friends."; MostrarTaps(false); MostrarControles(false); MostrarMapa(); } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { Configuracion configuracion = await App.metodos.CargarConfiguracion(); share = new Share(AppInfo.Name, String.Format("My score in #AhorcadoDeEstados for #WindowsPhone is {0} points and {1} victories. Can you beat me? Download it now!", configuracion.Puntos, configuracion.Victorias), AppInfo.Link); txtCorrect.Text = configuracion.Victorias.ToString(); txtGames.Text = (configuracion.Victorias + configuracion.Derrotas).ToString(); txtPlayer.Text = configuracion.Nombre; txtPoints.Text = configuracion.Puntos.ToString(); txtWrong.Text = configuracion.Derrotas.ToString(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { share = new Share(AppInfo.Name, AppInfo.Motto, AppInfo.Link); }