vs2022 wpf 无法识别 xaml 中定义的控件名称

在 .csproj 如果没有如下节点,则定义一个,编译如果说重复,删除或注释即可恢复正常:
<ItemGroup>
 <Compile Include="MainWindow.xaml.cs">
  <DependentUpon>MainWindow.xaml</DependentUpon>
 </Compile>
</ItemGroup>

 

posted on 2025-05-16 11:53  空明流光  阅读(64)  评论(0)    收藏  举报

导航