在VS开发过程中,常常有多个文件是相似或者因为partial 将一个文件拆分成多个,但在实际中文件过多,名称相似,不利于阅读。
通过编辑项目文件(如*.csproj) 中的文件依赖关系。
如在项目开发过程中,建立了WPF的图标文件(Canvas)
<ItemGroup> <Page Include="Icons\Icons.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> <Page Include="Icons\Icons.Edit.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> <DependentUpon>Icons.xaml</DependentUpon> </Page> <Page Include="Icons\Icons.File.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> <DependentUpon>Icons.xaml</DependentUpon> </Page> </ItemGroup>
如图所示:

本文介绍如何通过编辑VS项目的配置文件(例如 *.csproj),来设置文件间的依赖关系,特别是针对WPF应用中的图标文件(Canvas)。这有助于提高代码的组织性和可读性。
1860

被折叠的 条评论
为什么被折叠?



