Application.GetContentStream returns null for content Uri

China☆狼群 提交于 2019-12-06 07:56:54

It means probably that it does not find the file. Is the path correct?.

Return Value

Type: System.Windows.Resources.StreamResourceInfo

A StreamResourceInfo that contains a content data file that is located at the specified Uri. If a loose resource is not found, null is returned.

You must set file's Build Action as Content, and Copy To Output Directory to Copy Always or Copy if newer.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!