如果在 XAML 中定义 ItemsControl/ItemsSource="{Binding AvailableContracts}" 时,Visual Studio 会足够聪明,可以在 DataContext 绑定到的 ModelView 上找到属性 AvailableContracts,反映它,然后当我类型:
<TextBlock Text="{Binding Path=
它会在我的 ContractModelView中弹出对我可用的可绑定属性的智能感知,因为 AvailableContracts 是一个列表集合。
我不明白为什么 Visual Studio 不能遵循这条逻辑路径并为我提供所需的智能感知。谁能解释这里的断开连接是什么?或者肯定有某种方法可以“给它一些帮助”,以便它可以提供智能感知。任何第三方工具可以做到这一点?也许在VS2010中?我听说 MEF 将在 VS2010 中使智能感知更好,希望如此。
在编写我的 XAML 视图时缺少数据绑定智能感知就像记事本一样。:-(
<UserControl
x:Class="TestMvvmWpf8898.Views.CustomerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<StackPanel>
<TextBlock Text="{Binding Path=FullName}"/>
<ItemsControl ItemsSource="{Binding Path=AvailableContracts}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=NEED_INTELLISENSE_HERE
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</UserControl>