1
Vote

resourceLoader not initialised for Windows Store Project

description

Hi,

For a project "Windows Store Project" (without XAML), Windows.UI.Xaml.Application return null.

So "resourceLoader" never initialed.

You can add :

if ( Windows.UI.Xaml.Application.Current.Current. == null)
{
return resourceLoader = new ResourceLoader("AppResources");
}
public partial class AppResources
    {
        
        private static ResourceLoader resourceLoader;
        
        static AppResources()
        {
            string executingAssemblyName;
            executingAssemblyName = Windows.UI.Xaml.Application.Current.GetType().AssemblyQualifiedName;
            string[] executingAssemblySplit;
            executingAssemblySplit = executingAssemblyName.Split(',');
            executingAssemblyName = executingAssemblySplit[1];
            string currentAssemblyName;
            currentAssemblyName = typeof(AppResources).AssemblyQualifiedName;
            string[] currentAssemblySplit;
            currentAssemblySplit = currentAssemblyName.Split(',');
            currentAssemblyName = currentAssemblySplit[1];
            if (executingAssemblyName.Equals(currentAssemblyName))
            {
                resourceLoader = new ResourceLoader("AppResources");
            }
            else
            {
                resourceLoader = new ResourceLoader(currentAssemblyName + "/AppResources");
            }
        }
/// Generated resource Helper
}
no When the Resources.cs is generated, th

comments