/// <summary>
		/// Generates the guild emblem image.
		/// </summary>
		/// <param name="guildEmblemData">The guild emblem data.</param>
		/// <param name="guildSide">The guild side.</param>
		/// <param name="width">The width.</param>
		/// <param name="height">The height.</param>
		/// <returns></returns>
		public static BitmapSource GenerateGuildEmblemImage(GuildEmblem guildEmblemData, GuildSide guildSide, int width = 216, int height = 240)
		{
			WriteableBitmap guildEmblemImage;

			try
			{
				guildEmblemImage = new WriteableBitmap(216, 240);

				var factionBackgroundImage = new WriteableBitmap(216, 216).FromResource(String.Format("Images/GuildDetails/Emblem_Background_{0}.png", guildSide));
				guildEmblemImage.Blit(new Rect(0, 0, 216, 216), factionBackgroundImage, new Rect(0, 0, 216, 216), WriteableBitmapExtensions.BlendMode.Alpha);

				var shadowImage = new WriteableBitmap(179, 210).FromResource("Images/GuildDetails/Emblem_Shadow.png");
				guildEmblemImage.Blit(new Rect(18, 27, 179, 210), shadowImage, new Rect(0, 0, 179, 210), WriteableBitmapExtensions.BlendMode.Alpha);

				var backgroundColor = GetColorFromHexString(guildEmblemData.BackgroundColor);
				var emblemBackgroundImage = new WriteableBitmap(179, 210).FromResource("Images/GuildDetails/Emblem_Background.png");
				guildEmblemImage.Blit(new Rect(18, 27, 179, 210), emblemBackgroundImage, new Rect(0, 0, 179, 210), backgroundColor, WriteableBitmapExtensions.BlendMode.Alpha);

				var borderColor = GetColorFromHexString(guildEmblemData.BorderColor);
				var borderImage = new WriteableBitmap(147, 159).FromResource(String.Format("Images/GuildDetails/Emblem_Border_{0}.png", guildEmblemData.Border));
				guildEmblemImage.Blit(new Rect(31, 40, 147, 159), borderImage, new Rect(0, 0, 147, 159), borderColor, WriteableBitmapExtensions.BlendMode.Alpha);

				var iconColor = GetColorFromHexString(guildEmblemData.IconColor);
				var iconImage = new WriteableBitmap(125, 125).FromResource(String.Format("Images/GuildDetails/Emblems/Emblem_{0}.png", guildEmblemData.Icon.ToString().PadLeft(3, '0')));
				guildEmblemImage.Blit(new Rect(33, 57, 125, 125), iconImage, new Rect(0, 0, 125, 125), iconColor, WriteableBitmapExtensions.BlendMode.Alpha);

				var hooksImage = new WriteableBitmap(179, 32).FromResource("Images/GuildDetails/Emblem_Hooks.png");
				guildEmblemImage.Blit(new Rect(18, 27, 179, 32), hooksImage, new Rect(0, 0, 179, 32), WriteableBitmapExtensions.BlendMode.Alpha);
			}
			catch (Exception ex)
			{
				guildEmblemImage = new WriteableBitmap(216, 240).FromResource(String.Format("Images/GuildDetails/Emblem_Default_{0}.png", guildSide));
			}

			var resized = guildEmblemImage.Resize(width, height, WriteableBitmapExtensions.Interpolation.Bilinear);
			return resized;
		}
		/// <summary>
		/// Gets the guild emblem image.
		/// </summary>
		/// <param name="region">The region.</param>
		/// <param name="realm">The realm.</param>
		/// <param name="name">The name.</param>
		/// <param name="guildEmblem">The guild emblem.</param>
		/// <param name="guildSide">The guild side.</param>
		/// <returns></returns>
		public static ImageSource GetGuildEmblemImage(Region region, string realm, string name, GuildEmblem guildEmblem, GuildSide guildSide)
		{
			var key = String.Format("{0}_{1}_{2}", region.ToString().ToLower(), realm.Replace(" ", "-").ToLower().Trim(), name.Replace(" ", "-").ToLower().Trim());

			if (!ImageCache.ContainsKey(key))
			{
				var guildEmblemImage = ImageHelper.GenerateGuildEmblemImage(guildEmblem, guildSide);
				ImageCache.Add(key, guildEmblemImage);
			}

			return ImageCache[key];
		}