private void Click_Perfil(object sender, RoutedEventArgs e) { NavigationInfo a = new NavigationInfo(); a.language = idioma; a.source = PerfilImagen.Source; a.name = name; a.playing = playing; this.Frame.Navigate(typeof(DesplegablePerfil), a); }
} //VULTRA ATRAS------------------------------------------------------------------------------------ //BOTON FIGHT ==> COMBATE UI private void Fight_Click(object sender, RoutedEventArgs e) { NavigationInfo a = new NavigationInfo(); a.language = idioma; a.source = Perfil.Source; a.name = name; a.playing = playing; this.Frame.Navigate(typeof(CombateUI), a); //DesplegablePerfil }
private void Button_Click(object sender, RoutedEventArgs e) { NavigationInfo a = new NavigationInfo(); a.language = idioma; a.name = name; a.playing = playing; volumeAux = SliderVolume.Value; //Nos guardamos el volumen this.Frame.Navigate(typeof(MenuPrincipal), a); }
private void Click_Salir(object sender, RoutedEventArgs e) { if (this.Frame.CanGoBack) { NavigationInfo a = new NavigationInfo(); a.language = idioma; a.name = name; a.playing = playing; this.Frame.Navigate(typeof(MenuPrincipal), a); } }
private void EditarImagen_Click(object sender, RoutedEventArgs e) { cambiarNombre = false; newName = ""; GuardarCambios(); NavigationInfo a = new NavigationInfo(); a.language = idioma; a.source = IMAGEN.Source; a.name = lastName; this.Frame.Navigate(typeof(SeleccionarImagenPerfil), a); }
protected override void OnNavigatedTo(NavigationEventArgs e) //EN CASO DE QUE PASES PARAMETROS { NavigationInfo a = e.Parameter as NavigationInfo; if (a == null) { a = new NavigationInfo(); a.language = "Español"; } if (!string.IsNullOrWhiteSpace(a.language)) { idioma = a.language; if (a.language == "Español") { Titulo.Text = "Tienda"; BotonCajas.Content = "Cajas"; BotonPersonajes.Content = "Personajes"; BotonSkins.Content = "Skins"; TextCajaPequeña.Text = "Caja Pequeña - 0.99$"; TextCajaMediana.Text = "Caja Mediana - 3.99$"; TextCajaGrande.Text = "Caja Grande - 10.99$"; } if (a.language == "Ingles") { Titulo.Text = "Shop"; BotonCajas.Content = "Boxes"; BotonPersonajes.Content = "Characters"; BotonSkins.Content = "Skins"; TextCajaPequeña.Text = "Small Box - 0.99$"; TextCajaMediana.Text = "Medium Box - 3.99$"; TextCajaGrande.Text = "Big box - 10.99$"; } if (a.language == "Frances") { Titulo.Text = "Boutique"; BotonCajas.Content = "Des boites"; BotonPersonajes.Content = "Personnages"; BotonSkins.Content = "Skins"; TextCajaPequeña.Text = "Petite boîte - 0.99$"; TextCajaMediana.Text = "Boîte moyenne - 3.99$"; TextCajaGrande.Text = "Grosse boite - 10.99$"; } } if (a.name != null) { name = a.name; } playing = a.playing; }
protected override void OnNavigatedTo(NavigationEventArgs e) //EN CASO DE QUE PASES PARAMETROS { if (volumeAux != 0) //Si previamente hemos modificado el volumen , se nos queda guardado { ElementSoundPlayer.Volume = volumeAux / 100; SliderVolume.Value = volumeAux; } //ApplicationLanguages.PrimaryLanguageOverride = "fr"; NavigationInfo a = e.Parameter as NavigationInfo; if (a != null && !string.IsNullOrWhiteSpace(a.language)) { idioma = a.language; if (a.language == "Español") { idioma = "Español"; Titulo.Text = "Ajustes"; vGen.Text = "Volumen General"; musica.Text = "Música"; graficos.Text = "Gráficos"; eSonido.Text = "Efectos de Sonido"; } else if (a.language == "Ingles") { idioma = "Ingles"; Titulo.Text = "Options"; vGen.Text = "General Volume"; musica.Text = "Music"; graficos.Text = "Graphics"; eSonido.Text = "Sound Effects"; } else if (a.language == "Frances") { idioma = "Frances"; Titulo.Text = "Paramètres"; vGen.Text = "Volume général"; musica.Text = "Musique"; graficos.Text = "Graphique"; eSonido.Text = "Effets sonores"; } } if (a.name != null) { name = a.name; } playing = a.playing; }
// Handles system-level BackRequested events and page-level back button Click events private bool On_BackRequested() { if (this.Frame.CanGoBack) { NavigationInfo a = new NavigationInfo(); a.language = idioma; a.source = Perfil.Source; a.name = name; a.playing = playing; // this.Frame.GoBack(); this.Frame.Navigate(typeof(MenuPrincipal), a); return(true); } return(false); }
protected override void OnNavigatedTo(NavigationEventArgs e) //EN CASO DE QUE PASES PARAMETROS { //ApplicationLanguages.PrimaryLanguageOverride = "fr"; NavigationInfo a = e.Parameter as NavigationInfo; if (a == null) { a = new NavigationInfo(); a.language = "Español"; } if (!string.IsNullOrWhiteSpace(a.language)) { idioma = a.language; if (a.language == "Español") { Titulo.Text = "Selección de Personajes"; TextFuerza.Text = "Fuerza"; TextMovilidad.Text = "Movilidad"; TextVida.Text = "Vida"; Fight.Content = "Luchar"; } if (a.language == "Ingles") { Titulo.Text = "Characters Selection"; TextFuerza.Text = "Strenght"; TextMovilidad.Text = "Mobility"; TextVida.Text = "Health"; Fight.Content = "Fight"; } if (a.language == "Frances") { Titulo.Text = "Image de Profil"; TextFuerza.Text = "Obliger"; TextMovilidad.Text = "Mobilité"; TextVida.Text = "Santé"; Fight.Content = "Lutte"; } } if (a.name != null) { name = a.name; } if (a.playing != null) { playing = a.playing; } }
private void Back_Click(object sender, RoutedEventArgs e) { //MediaElement PlayMusic = new MediaElement(); //StorageFolder Folder = Windows.ApplicationModel.Package.Current.InstalledLocation; //Folder = await Folder.GetFolderAsync("MyFolder"); //StorageFile sf = await Folder.GetFileAsync("MyFile.mp3"); //PlayMusic.SetSource(await sf.OpenAsync(FileAccessMode.Read), sf.ContentType); PlayMusic.Play(); NavigationInfo a = new NavigationInfo(); a.language = idioma; a.source = IMAGEN.Source; a.name = lastName; a.playing = playing; this.Frame.Navigate(typeof(MenuPrincipal), a); //On_BackRequested(); }
protected async override void OnNavigatedTo(NavigationEventArgs e) //EN CASO DE QUE PASES PARAMETROS { //ApplicationLanguages.PrimaryLanguageOverride = "fr"; NavigationInfo a = e.Parameter as NavigationInfo; if (a == null) { a = new NavigationInfo(); a.language = "Español"; } if (a.source != null) { PerfilImagen.Source = a.source; } if (!string.IsNullOrWhiteSpace(a.language)) { idioma = a.language; } if (a.name != null) { name = a.name; NOMBRE.Text = name; } if (a.playing != null) { playing = a.playing; } Windows.Storage.StorageFolder folder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync(@"Assets"); Windows.Storage.StorageFile file = await folder.GetFileAsync("Hahne_-_8bit_Dancer.mp3"); player.AutoPlay = false; player.Source = MediaSource.CreateFromStorageFile(file); player.Volume = 0.5; if (!a.playing) { player.Play(); playing = true; } else { player.Source = null; } }
protected override void OnNavigatedTo(NavigationEventArgs e) //EN CASO DE QUE PASES PARAMETROS { //ApplicationLanguages.PrimaryLanguageOverride = "fr"; NavigationInfo a = e.Parameter as NavigationInfo; if (a == null) { a = new NavigationInfo(); a.language = "Español"; } if (!string.IsNullOrWhiteSpace(a.language)) { idioma = a.language; if (a.language == "Español") { Titulo.Text = "Imagen de Perfil"; } if (a.language == "Ingles") { Titulo.Text = "Profile Image"; } if (a.language == "Frances") { Titulo.Text = "Image de Profil"; } } if (a.source != null) //CARGAR LA IMAGEN DEL PARAMETRO { BitmapImage bitimg = a.source as BitmapImage; ImagenSeleccionada.Source = bitimg; } if (a.name != null) { name = a.name; } }
private void Grid_KeyDown(object sender, KeyRoutedEventArgs e) { DependencyObject candidate = null; switch (e.OriginalKey) { case VirtualKey.Right: case VirtualKey.GamepadDPadRight: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Right); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Left); } (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; case VirtualKey.Left: case VirtualKey.GamepadDPadLeft: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Left); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Right); } (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; case VirtualKey.Up: case VirtualKey.GamepadDPadUp: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Up); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Down); } (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; case VirtualKey.GamepadMenu: NavigationInfo a = new NavigationInfo(); a.language = idioma; a.name = name; this.Frame.Navigate(typeof(MenuPrincipal), a); break; case VirtualKey.Down: case VirtualKey.GamepadDPadDown: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Down); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Up); } //Casteamos el Objeto que guarda el cambio de foco a un control para establecer eso como foco en focusmanager (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; //Si`por ejemplo quiero hacerlo para quedesde jugar vaya a salir igualo la variable Candidate al boton en cuestion } }
protected override void OnNavigatedTo(NavigationEventArgs e) //EN CASO DE QUE PASES PARAMETROS { //ApplicationLanguages.PrimaryLanguageOverride = "fr"; NavigationInfo a = e.Parameter as NavigationInfo; if (a == null) { a = new NavigationInfo(); a.language = "Español"; } if (!string.IsNullOrWhiteSpace(a.language)) { idioma = a.language; if (a.language == "Español") { Titulo.Text = "Perfil"; EditarImagen.Content = "Editar Perfil"; CambiarNombre.Content = "Cambiar Nombre"; TextLogrosDesbloqueados.Text = "Logros Desbloqueados:"; TextLogrosDesbloqueados2.Text = "Logros Desbloqueados:"; TextPartidasGanadas.Text = "Partidas Ganadas:"; TextMisionCompleta.Text = "Misión Completada"; TextMisionCorrespondiente.Text = "Misión Correspondiente"; TextMisionCorrespondiente2.Text = "Misión Correspondiente"; TextMisionCorrespondiente3.Text = "Misión Correspondiente"; TextDesadiosPendientes.Text = "Desafíos Pendientes"; } if (a.language == "Ingles") { Titulo.Text = "Profile"; EditarImagen.Content = "Edit Profile"; CambiarNombre.Content = "Rename"; TextLogrosDesbloqueados.Text = "Achievements Unlocked:"; TextLogrosDesbloqueados2.Text = "Achievements Unlocked:"; TextPartidasGanadas.Text = "Total Wins:"; TextMisionCompleta.Text = "Mission Complete"; TextMisionCorrespondiente.Text = "Corresponding Mission"; TextMisionCorrespondiente2.Text = "Corresponding Mission"; TextMisionCorrespondiente3.Text = "Corresponding Mission"; TextDesadiosPendientes.Text = "Challenges Pending"; } if (a.language == "Frances") { Titulo.Text = "Profil"; EditarImagen.Content = "Editer le profil"; CambiarNombre.Content = "Rebaptiser"; TextLogrosDesbloqueados.Text = "Succès débloqués:"; TextLogrosDesbloqueados2.Text = "Succès débloqués:"; TextPartidasGanadas.Text = "Jeux gagnés:"; TextMisionCompleta.Text = "Mission complète"; TextMisionCorrespondiente.Text = "Mission correspondante"; TextMisionCorrespondiente2.Text = "Mission correspondante"; TextMisionCorrespondiente3.Text = "Mission correspondante"; TextDesadiosPendientes.Text = "Défis en attente"; } } if (a.name != null) { lastName = a.name; NombrePlayer.Text = lastName; } if (a.source != null) //CARGAR LA IMAGEN DEL PARAMETRO { BitmapImage bitimg = a.source as BitmapImage; IMAGEN.Source = bitimg; } playing = a.playing; }
private void Grid_KeyDown(object sender, KeyRoutedEventArgs e) { if (cambiarNombre) { char c = (char)e.Key; //CONTROL PARA QUE SOLO VALGAN LETRAS, NUMEROS ETC if (c >= 65 && c <= 90 || c >= 97 && (int)c <= 122 /*|| (int)c >= 48 && (int)c <= 57*/) //65-90 97-122 48-57 { newName = newName + c; NombrePlayer.Text = newName; } } DependencyObject candidate = null; switch (e.Key) { case VirtualKey.Escape: newName = ""; NombrePlayer.Text = ""; GuardarCambios(); break; case VirtualKey.Enter: GuardarCambios(); break; case VirtualKey.Right: case VirtualKey.GamepadDPadRight: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Right); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Left); } (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; case VirtualKey.Left: case VirtualKey.GamepadDPadLeft: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Left); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Right); } (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; case VirtualKey.Up: case VirtualKey.GamepadDPadUp: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Up); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Down); } (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; case VirtualKey.GamepadMenu: NavigationInfo a = new NavigationInfo(); a.language = idioma; a.name = lastName; this.Frame.Navigate(typeof(MenuPrincipal), a); break; case VirtualKey.Down: case VirtualKey.GamepadDPadDown: // el candidato es el primer objeto al navegar hacia abajo en la lista candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Down); // movemos el foco al siguiente objeto if (candidate == null) { candidate = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Up); } //Casteamos el Objeto que guarda el cambio de foco a un control para establecer eso como foco en focusmanager (candidate as Control).Focus(FocusState.Keyboard); e.Handled = true; break; //Si`por ejemplo quiero hacerlo para quedesde jugar vaya a salir igualo la variable Candidate al boton en cuestion } }