开发者

System.Windows.Application.GetResourceStream returns null

开发者 https://www.devze.com 2022-12-17 23:37 出处:网络
If I debug a WPF-application with Catalog.xaml as Content, I can\'t get the resource stream o开发者_StackOverflowf it - GetResourceStream returns null:

If I debug a WPF-application with Catalog.xaml as Content, I can't get the resource stream o开发者_StackOverflowf it - GetResourceStream returns null:

var uri = new Uri("/Assembly;component/Catalog.xaml", UriKind.Relative);

var foo = System.Windows.Application.GetResourceStream(uri);

foo is null. What am I doing wrong?


I believe for type Content you only need the item name:

var uri = new Uri(**"Catalog.xaml"**, UriKind.Relative);
var foo = System.Windows.Application.GetResourceStream(uri);
0

精彩评论

暂无评论...
验证码 换一张
取 消