When a window is initialized, the XAML is inflated in to real objects. Those real objects have their constructors called, which initializes them.
This line actually creates a new instance of MainWindow, instead of returning the existing instance:
<local:MainWindow />
So your XAML creates a new window, which sets the DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window, which sets its DataContext to a new window,
and so on, until the whole things crashes and burns.
What you probably meant to do, is this:
<Window DataContext="{Binding RelativeSource={RelativeSource Self}}">
</Window>
Which sets the DataContext to the current instance of the window, not a new window.