Пример #1
0
        public void MenuOptions_Loaded(object sender, RoutedEventArgs e)
        {
            NextTitle.Text = TitleText;
            NextTitle.BeginAnimation(TextBlock.OpacityProperty, new DoubleAnimation(1.0, TimeSpan.FromSeconds(0.1)));

            for (Int32 i = 0; i < OptionNames.Count; i++)
            {
                TextBlock textBlock = new TextBlock()
                {
                    Text = OptionNames[i], Foreground = Brushes.White, FontSize = 18, Opacity = 0.0, Margin = new Thickness(12, 4, 0, 0)
                };

                DoubleAnimation appear = new DoubleAnimation(0.8, TimeSpan.FromSeconds(0.1));
                appear.BeginTime = TimeSpan.FromSeconds(i * 0.1);

                if (i == OptionNames.Count - 1)
                {
                    appear.Completed += (s, args) => {
                        _selector.Opacity = 1.0;
                        Shown?.Invoke(this, new EventArgs());
                    };
                }

                textBlock.BeginAnimation(TextBlock.OpacityProperty, appear);

                NextOptions.Children.Add(textBlock);
            }

            _selector.Opacity = 0.0;
            MenuOptions_Transitioned(this, new EventArgs());
        }
Пример #2
0
 public string Format(string format)
 {
     return(format.Replace("<nowtitle>", NowTitle.HtmlCleanup())
            .Replace("<nowdescription>", NowDescription.HtmlCleanup())
            .Replace("<nowstart>", NowStart)
            .Replace("<nowend>", NowEnd)
            .Replace("<nexttitle>", NextTitle.HtmlCleanup())
            .Replace("<nextdescription>", NowDescription.HtmlCleanup())
            .Replace("<nextstart>", NextStart)
            .Replace("<nextend>", NextEnd)
            .Replace("<newline>", Environment.NewLine));
 }