在解决方案资源管理器中的文件下添加文件 [英] Add a file under a file in Solution Explorer
问题描述
因此,在某些情况下,例如在构建WPF窗口/用户控件时,并非某些文件类型(例如.xaml
和.cs
)会合并为一个文件(.cs
文件位于
So in some cases, like when building WPF windows/user-controls and what not certain file types like .xaml
and .cs
get combined into "one" file (the .cs
file is placed underneath the .xaml
).
问题是我知道这个人意外地解除了两个文件的绑定,我想知道是否有一种方法可以帮助他将它们重新放回一起(或者是否有一种方法可以将诸如一般而言.)
The problem is that I know this guy that accidentally unbound the two files from each other, and I'm wondering if there is a way to help him put them back together again (or if there is a way to join files like this in general).
推荐答案
在项目文件(.csproj)中进行编辑
In the project file (.csproj) edit it like
<Content Include="Default.js">
<DependentUpon>Default.aspx</DependentUpon>
</Content>
例如使用DependentUpon元素来嵌套文件.
E.g. use the DependentUpon element to nest the file.
请参阅 http://davefancher.com/2012/02/23/nesting-files-in -visual-studio/
这篇关于在解决方案资源管理器中的文件下添加文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!