using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace SampleBrowser.Shared
{
    public class ApplicationHelper
    {
        internal static FrameworkElement RootVisual
        {
            get
            {
                if (Application.Current == null)
                {
                    return null;
                }
#if SILVERLIGHT
				return Application.Current.RootVisual as FrameworkElement;
#else
                return Application.Current.Windows.Cast<Window>().FirstOrDefault(w => w.IsActive);
#endif
            }
        }
    }
}
