How do I create a XAML + CodeBehind pair in Rider?

(If it is even possible, of course, from the time of writing this, I am using EAP version 19, which is the latest version at the moment)

I have a WPF project where I am trying to merge the XAML and XAML.CS files, since they are both part of a partial class definition (as far as I understand, at least).

However, no matter what I do, I cannot get Ryder to understand that they are related.

Project explorer

Here you can see Details.xaml.cs, which are neatly nested in Details.xaml, as Ryder understands that they are dependent, but not cubes for CompendiumSearch.

Details and CompendiumSearch have almost identical code, except of course the class names.


PS: the app and details were created with VS, this is an old project that I imported into Rider to build on; why they are already neatly nested.

+3


source to share


1 answer


EDIT: Since this deprecated question has received more attention lately, I find it imperative to note that the issue was not only resolved last year in version 2017.1 (IIRC), but also set for visual preview in version 2018.1 (current state ready for EAP 3).


The only way I have found is to edit the .csproj file and add these:



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

      

However, as far as I know, editing the .csproj manually just takes a hassle, so I doubt this is the perfect solution.

+2


source







All Articles