0

I'm developing a Windows desktop app in VB.NET Visual Studio 2010.

I'm trying to implement data binding for a collection of objects and it seems I need some XAML to do this:

How to: Make Data Available for Binding in XAML http://msdn.microsoft.com/en-us/library/ms748857(v=vs.100).aspx

My question is: where do I put the xaml mentioned in this article? I think it goes in the my form's resx file, but I'm not sure. Is so, why can I open the resx files for some of my forms in Visual Studio, but not all of them? I can open the file for frmMain.resx but not frmTest.resx--i have no idea why. I deleted and recredted frmtest but still, their is no View Code option when I right-click on it, but there is for frmMain.

Also, IF i'm suppose to put it in frmTest.resx, does it matter where I put it? Maybe just before ?

Sorry for the lowly noob nature of this question but I've never had to deal with this issue before.

EDIT It seems there may be two kinds of forms in Visual Studio "Windows Form" and "WPF Form"? Can I only do this kind of custom data binding with a different form type?

4

1 回答 1

0

您必须创建一个 WPF 应用程序才能使用 XAML。XAML 在 WPF 中用于设计表单以及执行与 web 中的 html 相同的绑定。即使在您共享的链接中,也请查看主题的根源,它显示的是数据绑定 (WPF)。

所以,我相信你需要动手使用 WPF 和 XAML 来进行绑定。

下面的链接显示了如何在 Visual Studio 2010 中创建 WPF 应用程序。 http://wpftutorial.net/HelloWPF.html

希望这可以帮助。

于 2012-09-21T09:28:29.650 回答