C# 如何将visual studio设置为自动生成控制代码
我有问题。在此链接中: [^] 我们可以看到代码是自动生成的。但当我以相同的方式拖放某个实体时,visual studio只生成以下内容:C# 如何将visual studio设置为自动生成控制代码,c#,wpf,entity-framework,C#,Wpf,Entity Framework,我有问题。在此链接中: [^] 我们可以看到代码是自动生成的。但当我以相同的方式拖放某个实体时,visual studio只生成以下内容: using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Sh
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Testowy
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
System.Windows.Data.CollectionViewSource taktTimerEntitiesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("taktTimerEntitiesViewSource")));
// Load data by setting the CollectionViewSource.Source property:
// taktTimerEntitiesViewSource.Source = [generic data source]
}
}
}
使用System.Windows.Documents;
使用System.Windows.Input;
使用System.Windows.Media;
使用System.Windows.Media.Imaging;
使用System.Windows.Navigation;
使用System.Windows.Shapes;
名称空间Testowy
{
///
///MainWindow.xaml的交互逻辑
///
公共部分类主窗口:窗口
{
公共主窗口()
{
初始化组件();
}
已加载私有无效窗口(对象发送器、路由目标)
{
System.Windows.Data.CollectionViewSource TaktItemEntitiesViewSource=((System.Windows.Data.CollectionViewSource)(this.FindResource(“TaktItemEntitiesViewSource”)));
//通过设置CollectionViewSource加载数据。源属性:
//TaktTimeEntitiesViewSource.Source=[通用数据源]
}
}
}
我有visual studio 2012。我在VisualStudio2010Express中尝试了同样的方法,但情况是一样的。有人能帮忙吗?你确定要检查一下课堂的其他部分了吗。NET中的控件通常分为两个文件。看看InitializeComponent()方法的内部,它是WPF。InitializeComponent是自动生成的。好的,我现在就知道了。让我们看一段31分钟的视频,看看你的意思有点过分。您希望了解为什么它没有像在视频中那样在代码隐藏中围绕您的实体创建查询代码。是的,在创建列表框的第一分钟内,将实体拖放到此列表框和窗口中。cs visual studio自动生成代码(GetCustomerQuery),但我的visual studio仅生成上述代码。