开发者

Embeding XAML resource in a C++/CLI assembly

I'm trying to embed a XAML file as a resource of my C++/CLI project (Using DevStudio 2005). I found few ways to do it but none of them is working properly.

Method 1. Embed it as a native resource I used the .rc file to include the .xaml. I can easily load it using the native Win32 calls. Problem: the project is not recompiled if I change the xaml file.

Method 2. Embed it using the linker I used the linker option "Embed Managed Resourcfe File" and added my xaml file there. I can easily use GetManifestResourceStream() after to load it. Problem: the project is not recom开发者_如何转开发piled if I change the xaml file.

Method 3. Embed it using "Add Existing Item" I tried to add the xaml file using "Project->Add->Existing Item" and then open my xaml file. Problem: When I popup the xaml file properties, I cannot find any "Build Tool" to compile/embed it. Can I get it from somewhere? Is there a command line I can use as a custom build step?

Method 4. Embed it using a .resx file I tried several things but I never managed to load it at runtime using GetResourceStream(). For this one I would need a step-by-step procedure.

Can someone please tell me which method I should be using?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜