To add to what Ralf and Patrice have said ... The only way that the code you show could cause that error message is if this code
private void Window_Loaded(object sender, RoutedEventArgs e)
{
new HEAD_LST_FROOSH22().Show();
}
is part of the
HEAD_LST_FROOSH22
class, or the
HEAD_LST_FROOSH22
class creates an instance of the current class and unbounded recursion is the result.
Let me try to explain what "unbounded recursion" is: in the real world, you have a job to do - make a cup of tea. But in order to make a cup of tea, you have to boil water, and the person that owns the kettle will only let you have it when you give them ... a cup of tea.
Because you need a kettle to make a cup of tea in order to get a kettle to make a cup of tea, you can never finish the task.
In computing, the same thing happens: method A calls itself (direct recursion)
or it calls method B which calls method A (indirect recursion). Because each time you call a method it uses space on the application stack you very quickly exhaust the whole stack, and you get an "out of memory" error. Stacks are pretty small - only 1MB - so it's very easy to exceed that.
So start by looking at the "whole code" and work out what the relationship between the the calls that contains that code and the
HEAD_LST_FROOSH22
class is.