2011-02-27 6 views

답변

18

나는 Visual Studio에서 그것을 할 수있는 방법을 알고하지 않습니다,하지만 당신은 텍스트 편집기에서 .csproj 파일을 편집 할 수 있습니다.

<Page Include="MainWindow.xaml"> 
    <Generator>MSBuild:Compile</Generator> 
    <SubType>Designer</SubType> 
</Page> 
<Compile Include="MainWindow.xaml.cs"> 
    <DependentUpon>MainWindow.xaml</DependentUpon> 
    <SubType>Code</SubType> 
</Compile> 

두 개의 태그가 파일에서 서로 오른쪽에 있지 않을 수 있습니다. 중요한 부분은 <DependantUpon> 태그입니다.

파일에 include="ViewModel.cs" 속성이있는 태그를 찾으십시오. 이 태그 안에는 자식 요소로 <DependantUpon>View.xaml</DependantUpon>을 추가하십시오. 이제 ViewModel.cs 파일은 항상 View.xaml 파일 안에 있습니다.

<Page Include="View.xaml"> 
    <SubType>Designer</SubType> 
    <Generator>MSBuild:Compile</Generator> 
</Page> 
<Compile Include="ViewModel.cs"> 
    <DependentUpon>View.xaml</DependentUpon> 
</Compile> 
+2

참조 http://stackoverflow.com/questions/3621345/how-to-group-partial-class-files-in-solution- : 결국, 파일이 조각과 유사한이 무엇인가를해야한다 explorer-vs2010이 GUI를 수행하는 방법 –

+0

기본 GUI 방법이 있다면 여전히 좋을 것입니다. 가야할 길은 분명한 것 같습니다. –