C# 绑定Intellisense不适用于某些继承了DataContext的控件
我在XAML中将窗口的C# 绑定Intellisense不适用于某些继承了DataContext的控件,c#,wpf,autocomplete,intellisense,datacontext,C#,Wpf,Autocomplete,Intellisense,Datacontext,我在XAML中将窗口的DataContext设置为我的ViewModel 当我现在想要为某个控件上的属性创建绑定时,我通常会使用Intellisense(显示ViewModel的属性)。在下面的示例中,这适用于Grid和TabControl。然而,在TabItem上,Intellisense不再工作 绑定本身可以正常工作,只是Intellisense无法工作 下面是我的示例代码: <Window x:Class="MyApp.View.MainWindow" xmlns="
DataContext
设置为我的ViewModel
当我现在想要为某个控件上的属性创建绑定时,我通常会使用Intellisense(显示ViewModel的属性)。在下面的示例中,这适用于Grid
和TabControl
。然而,在TabItem
上,Intellisense不再工作
绑定本身可以正常工作,只是Intellisense无法工作
下面是我的示例代码:
<Window x:Class="MyApp.View.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MyApp.View"
xmlns:vm="clr-namespace:MyApp.ViewModel"
mc:Ignorable="d"
Title="My App" Height="768" Width="1024">
<Window.DataContext>
<vm:MainWindowViewModel></vm:MainWindowViewModel>
</Window.DataContext>
<Grid> <!-- Intellisense works here -->
<TabControl x:Name="MainTabControl"> <!-- Intellisense works here too -->
<TabItem Header="{Binding Heading}"> <!-- Intellisense DOES NOT work here -->
...
...