aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/debug_w_pmr/objects.mk
blob: dbda2a50b774509e38dc61f1c4e5b5a80d03769b (plain)
1
2
3
4
5
6
7
8
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace Tango.SharedUI.Helpers
{
    /// <summary>
    /// Contains application resource helper methods.
    /// </summary>
    public static class ResourceHelper
    {
        /// <summary>
        /// Gets the application start path.
        /// </summary>
        /// <returns></returns>
        public static String GetApplicationStartPath()
        {
            return AppDomain.CurrentDomain.BaseDirectory;
        }

        /// <summary>
        /// Gets an image from the application resources.
        /// </summary>
        /// <param name="imagePath">The image relative path.</param>
        /// <returns></returns>
        public static BitmapSource GetImageFromResources(String imagePath)
        {
            return new BitmapImage(new Uri(String.Format("pack://application:,,,/{0};component/{1}", Assembly.GetCallingAssembly(), imagePath), UriKind.Absolute));
        }
    }
}