private async void t_Tap(object sender, System.Windows.Input.GestureEventArgs e) { HubTileBase t = sender as HubTileBase; if (Config.AudioSupport && t.Tag == null) { t.Tag = DateTime.Now; await SpeakOutLoud(sender); e.Handled = true; return; } else { int iCin = (int)t.CommandParameter; var SelectedCinema = App.Cinemas[iCin]; CinemaDetails.SelectedCinema = SelectedCinema; NavigationService.Navigate(new Uri("/CinemaDetails.xaml", UriKind.Relative)); } }
private async Task SpeakOutLoud(object sender) { StringBuilder sb = new StringBuilder(); if (sender is ButtonBase) { ButtonBase buttonbase = (sender as ButtonBase); Grid g = buttonbase.Content as Grid; GetTextContent(sb, g); } else if (sender is HubTileBase) { HubTileBase t = sender as HubTileBase; sb.AppendLine(t.Name); //GetTextContent(sb, t.Name as Grid); //GetTextContent(sb, t.BackContent as Grid); } if (sb.Length > 0) { await SpeechSynthesisService.SpeakOutLoud(sb.ToString()); } }
/// <summary> /// Initializes a new instance of the HubTileBaseAutomationPeer class. /// </summary> /// <param name="owner">The owner.</param> public HubTileBaseAutomationPeer(HubTileBase owner) : base(owner) { }