System.Windows.Application is a special class dedicated to the application. Using it you can get a few useful references one of which is the RootVisual.
C#
UIElement applicationRoot = Application.Current.RootVisual;
That's it!