如何在 Visual Studio 2008 中从 XAML 生成类?

发布于 2024-09-07 07:40:31 字数 264 浏览 0 评论 0原文

如何在 Visual Studio 2008 中从 XAML 生成类?

我有一个 Silverlight 项目。 XAML 是用 Expression Blend 编写的。有人告诉我,我可以使用 Visual Studio 使用 Page.xaml 文件中的网格类(整个解决方案加载到 Visual Studio 中)在 Visual Studio 2008 中生成与以下几个类相对应的 .CS (C#) 文件XAML。这是怎么做到的?是否有某个地方的巫师可以为我做这件事?我必须手动完成此操作吗?

How do you generate classes from XAML in Visual Studio 2008?

I have a Silverlight project. The XAML has been written in Expression Blend. I am told that I can use Visual Studio to use the grid classes in the Page.xaml file (the whole solution is loaded into Visual Studio) to generate the .CS (C#) files in Visual Studio 2008 that correspond to the several classes in the XAML. How is this done? Is there a wizzard somewhere that will do this for me? Do I have to do this by hand?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的憧憬 2024-09-14 07:40:31

我对您的描述有点困惑,因为在表达式混合中创建 XAML 通常会同时创建代码隐藏 (.cs) 文件。设计人员实际上必须付出额外的努力才能创建未连接到代码隐藏文件的 XAML 文件。

最好检查您是否还没有文件背后的代码,并可能根据您发现的内容更改您的问题。

听起来他们实际上希望您将[数据?]网格添加到现有布局中。如果是这样,那就是从 VS 中的工具箱拖放到 VS 2008 中的 XAML 视图中。VS 2008 不支持图形编辑。

如果您能澄清您的问题,我会尽力澄清我的答案:)

I am bit confused by your description, as creating XAML in Expression blend normally creates the code-behind (.cs) files at the same time. The designers would actually have to go to extra trouble to create XAML files not connected to code-behind files.

Best check that you don't already have the code behind files and possibly change your question based on what you find.

It sounds like they actually wanted you to add [data?]grids to an existing layout. If so, that is a drag-drop from the toolbox in VS into the XAML view in VS 2008. VS 2008 does not support graphic editing.

If you can clarify your question I will try to clarify my answer to suit :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文