stackOverFlow 's answer
I've encountered this a couple times and keep forgetting what causes it. I ran into this when I renamed the namespace on my code behind file but not in my XAML.
So check if you've done the same. They need to match since they are both part of a partial class
namespace ZZZ
{/// <summary>/// Interaction logic for MainWindow.xaml/// </summary>publicpartialclassMainWindow{//...}}<!-- XAML --><Window x:Class="ZZZ.MainWindow">