2008-10-21 11 views

cevap

14

Açık .Csproj, yenisi altında olmasını istediğiniz dosyayı arayın ve bunun gibi, DependentUpon öğesi ekleyin:

<Compile Include="AlertDialog.xaml.cs"> 
    <DependentUpon>AlertDialog.xaml</DependentUpon> 
</Compile> 
+0

FileNesting uzantısı bunu otomatik olarak yapabilir: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.FileNesting – John

6

Doğrudan csproj dosyasını düzenlemeniz gerekir. MyForm.cs altında yerleştirmek istediğiniz dosyanın çocuk etiketi olarak eklemeniz gereken bir DependentUpon etiketi var.

Örnek: düzenleme modunda

<Compile Include="MyForm.MyCoolSubFile.cs"> 
    <DependentUpon>MyForm.cs</DependentUpon> 
</Compile> 
4

Evet, ama bu biraz zor - temelde proje dosyasını elle düzenlemeniz gerekiyor.

İşte projeden bir örnek olduğunu Marc Gravell ve ben her iki çalışma üzerinde:

<Compile Include="Linq\Extensions\DataProducerExt.cs" /> 
<Compile Include="Linq\Extensions\DataProducerExt.SingleReturn.cs"> 
    <DependentUpon>DataProducerExt.cs</DependentUpon> 
</Compile> 
<Compile Include="Linq\Extensions\DataProducerExt.Grouping.cs"> 
    <DependentUpon>DataProducerExt.cs</DependentUpon> 
</Compile> 
<Compile Include="Linq\Extensions\DataProducerExt.Pipeline.cs"> 
    <DependentUpon>DataProducerExt.cs</DependentUpon> 
</Compile> 
<Compile Include="Linq\Extensions\DataProducerExt.Conversion.cs"> 
    <DependentUpon>DataProducerExt.cs</DependentUpon> 
</Compile> 
<Compile Include="Linq\Extensions\DataProducerExt.Math.cs"> 
    <DependentUpon>DataProducerExt.cs</DependentUpon> 
</Compile> 

Not bağımlılıkları her birinde "DependentUpon" öğesi. Bu, VS'de DataProducerExt.cs ile ebeveyn olarak uygun şekilde görüntülenir.

İlgili konular