Esempio n. 1
0
        public static LoadedImageSurface GetImageSurface(string assetName, Size imageSize)
        {
            Uri getImageUri()
            {
                if (SharedHelpers.IsInFrameworkPackage())
                {
                    return(new Uri("ms-resource://" + MUXCONTROLS_PACKAGE_NAME + "/Files/Microsoft.UI.Xaml/Assets/" + assetName + ".png"));
                }
                else
                {
                    return(new Uri("ms-resource:///Files/Microsoft.UI.Xaml/Assets/" + assetName + ".png"));
                }
            }

            return(LoadedImageSurface.StartLoadFromUri(getImageUri(), imageSize));
        }
Esempio n. 2
0
        private static ResourceMap GetPackageResourceMap()
        {
            if (SharedHelpers.IsInFrameworkPackage())
            {
                string packageName = MUXCONTROLS_PACKAGE_NAME;
                if (ResourceManager.Current.AllResourceMaps.TryGetValue(packageName, out var value))
                {
                    return(value);
                }

                return(null);
            }
            else
            {
                return(ResourceManager.Current.MainResourceMap);
            }
        }