view MetroWpf/FxRates.UI/Helpers/IconHelper.cs @ 48:d617b54e1f47

WPF 4 version
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 07 Apr 2012 11:54:25 +0100
parents a8b50a087544
children
line wrap: on
line source

using System;
using System.Windows.Media.Imaging;

namespace FxRates.UI.Helpers
{
  class IconHelper
  {
    public static BitmapImage GetCcyIcon(string isocode) 
    {
      string uri;
      BitmapImage image;
      try
      {
        uri = string.Format("../Images/{0}.png", isocode);
        image = new BitmapImage(new Uri(uri, UriKind.Relative));
      }
      catch
      {
        uri = string.Format("../Images/{0}.png", "UNK");
        image = new BitmapImage(new Uri(uri, UriKind.Relative));
      }

      return image;
    }
  }
}