Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a file under a file in Solution Explorer [duplicate]

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).

like image 889
sircodesalot Avatar asked Dec 16 '22 10:12

sircodesalot


1 Answers

In the project file (.csproj) edit it like

<Content Include="Default.js">
    <DependentUpon>Default.aspx</DependentUpon>
</Content>

E.g. use the DependentUpon element to nest the file.

See http://davefancher.com/2012/02/23/nesting-files-in-visual-studio/

like image 157
larsw Avatar answered Jan 08 '23 08:01

larsw