I need to separate code from a single code behind to multiple partial classes, but didn't know how I can achieve this, I saw in one msdn code sample that this is possible, could you please tell me how I can achieve this.
I know I can move to MVVM, but for now I just need to organize code through partial classes.
Please have a look at the below screenshot.
You can do that by creating the additional files in the naming convention you like and adding the partial class to them. code will compile and work same as before.
MainPage.xaml.cs:
public partial class MainPage : Page {...}
MainPage.Flash.xaml.cs:
public partial class MainPage {...}
To get what you show in the attached image will involve manually editing the project file. Open you project file in a text editor and look at how it is done for your current code behind and the process is the same
Here is an example of what the image you provided would look like in the project file
<ItemGroup>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="MainPage.ExposureValue.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.Flash.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.Focus.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.IsoSpeed.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.Shutter.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.WhiteBalance.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.Zoom.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
</ItemGroup>