Esempio n. 1
0
 private void WriteBlocks(TimedString[] strings)
 {
     Action<string> a = s => sb.Append(s);
     for (int i = 0; i < strings.Length; i++) {
         a("<TextBlock x:Name=\"a");
         a(i.ToString());
         a("\" TextWrapping=\"Wrap\" FontSize=\"32\" Foreground=\"White\" VerticalAlignment=\"Bottom\" HorizontalAlignment=\"Center\" Visibility=\"Collapsed\" Text=\"");
         a(strings[i].Text.Replace("\"", "&quot;"));
         a("\"/>");
         sb.AppendLine();
     }
 }
Esempio n. 2
0
 private void WriteTimeline(TimedString[] strings)
 {
     Action<string> a = s => sb.Append(s);
     for (int i = 0; i < strings.Length; i++) {
         a("<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty=\"(UIElement.Visibility)\" Storyboard.TargetName=\"a");
         a(i.ToString());
         a("\">");
         sb.AppendLine();
         a("<DiscreteObjectKeyFrame KeyTime=\"");
         a(strings[i].Start.ToString());
         a("\" Value=\"{x:Static Visibility.Visible}\"/>");
         sb.AppendLine();
         a("<DiscreteObjectKeyFrame KeyTime=\"");
         a(strings[i].End.ToString());
         a("\" Value=\"{x:Static Visibility.Collapsed}\"/>");
         sb.AppendLine();
         a("</ObjectAnimationUsingKeyFrames>");
         sb.AppendLine();
     }
 }