Visual Studio Doesn’t Auto-Generate Code-Behind for XAML file
If you have a XAML file in a Visual Studio project, but for some reason, Visual Studio won’t auto-generate the code-behind for the XAML then make sure that the following line is in inside the <Project> tag of your project file:
<Import Project=”$(MSBuildBinPath)\Microsoft.WinFX.targets” />