public void CloseApplications()
 {
     if (this.Child != null)
     {
         ContentPresenter   item        = ContentContainer as ContentPresenter;
         IHostedApplication application = item.Tag as IHostedApplication;
         if (application != null)
         {
             IDesktopUserActions desktop = AifServiceContainer.Instance.GetService <IDesktopUserActions>();
             if (desktop != null)
             {
                 desktop.CloseDynamicApplication(application.ApplicationName);
             }
         }
         ContentContainer = null;
     }
 }
        public void CloseApplications()
        {
            List <IHostedApplication> tabApps = new List <IHostedApplication>();

            if (floatingWindows.Count > 0)
            {
                foreach (Window item in floatingWindows)
                {
                    IHostedApplication tabApp = item.Tag as IHostedApplication;
                    if (tabApp != null)
                    {
                        IDesktopUserActions desktop = AifServiceContainer.Instance.GetService <IDesktopUserActions>();
                        if (desktop != null)
                        {
                            desktop.CloseDynamicApplication(tabApp.ApplicationName);
                        }
                    }
                }
                floatingWindows.Clear();
            }
        }