Question: I am trying to get the main Window of an application written C#.
Application.MainWindow Property does not work :(

uses: 

```
using System;
using System.Windows;

using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.Collections.Generic;

using My;
using MyDialogs;

using System.Xml.Serialization;
using System.Runtime.InteropServices;

using System.Windows.Input;
using System.Windows.Media;
using System.Threading;
using System.Windows.Interop;

```

Answer: 
Sorry, it was my fault. I registered area routes calling `context.Routes.MapRoute()` instead of `context.MapRoute()` method.
Have you created a folder with the same name as your controller (without the Controller bit) underneath Views and put your view in there?

So, not:

```
Areas
    AreaName
        Views
            MyView.aspx

```

but...

```
Areas
    AreaName
        Views
            ControllerNameWithoutControllerOnTheEnd
                MyView.aspx

```