41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
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];
|
|
}
|
|
}
|
|
}
|