Czoko_Smieciarka/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/ImageContainer.cs

41 lines
1.0 KiB
C#
Raw Normal View History

2019-04-21 02:43:36 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
namespace CzokoŚmieciarka.WPFv2.Models
{
public sealed class ImageContainer
{
private static ImageContainer _Instance = null;
private Dictionary<string, Image> Images;
public static ImageContainer Instance {
get {
if (_Instance == null)
{
_Instance = new ImageContainer();
}
return _Instance;
}
}
public ImageContainer()
{
Images = new Dictionary<string, Image>();
Images.Add("Road", new Image { Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) });
}
public Image GetImage(string s)
{
return Images[s];
}
}
}