private static void ShowImageWhenReady(GameReference k, Image Image, TextBox Text, AnimatedOpacity AnimatedImage) { if (k.Source == null) { var s = new BitmapImage(); //Text.Text = "loading..."; s.DownloadCompleted += delegate { //Text.Text = "done!"; //Image.Opacity = 1; AnimatedImage.Opacity = 1; }; s.BeginInit(); s.UriSource = new Uri(k.Image); s.EndInit(); Image.Source = s; Text.Foreground = Brushes.Yellow; } else { //Text.Text = "done!!"; Image.Source = k.Source.ToSource(); //Image.Opacity = 1; AnimatedImage.Opacity = 1; } }
public static string GetWebTitle(this GameReference e) { return(e.Title.ToLower().Replace(" ", "-")); }