Beispiel #1
0
        private async Task <IInputStream> GetContent(string path)
        {
            try
            {
                if (Renderer.GetCorrectBaseUrl() == null)
                {
                    throw new Exception("Base URL was not set, could not load local content");
                }

                StorageFile f = await StorageFile.GetFileFromApplicationUriAsync(new Uri(string.Concat(Renderer.GetCorrectBaseUrl(), path)));

                IRandomAccessStream stream = await f.OpenAsync(FileAccessMode.Read);

                return(stream);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }