C# System.Windows.Application.GetResourceStream返回null

C# System.Windows.Application.GetResourceStream返回null,c#,wpf,resources,C#,Wpf,Resources,如果调试内容为Catalog.xaml的WPF应用程序,则无法获取其资源流-GetResourceStream返回null: var uri=新uri/程序集;component/Catalog.xaml,UriKind.Relative; var foo=System.Windows.Application.GetResourceStreamuri; foo是空的。我做错了什么?我认为对于类型内容,您只需要项目名称: var uri = new Uri(**"Catalog.xaml"**

如果调试内容为Catalog.xaml的WPF应用程序,则无法获取其资源流-GetResourceStream返回null:

var uri=新uri/程序集;component/Catalog.xaml,UriKind.Relative; var foo=System.Windows.Application.GetResourceStreamuri;


foo是空的。我做错了什么?

我认为对于类型内容,您只需要项目名称:

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

我相信对于类型内容,您只需要项目名称:

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

程序集是您的程序集名称吗?程序集是您的程序集名称吗?