internal static void Logout()
 {
     MyProfile = null;
     Password = string.Empty;
     Connected = false;
     Proxy = null;
     if (_uiClient != null)
     {
         _uiClient.LogOut();
         _applicationObject.Events.WindowEvents.WindowActivated -= WindowEvents_WindowActivated;
         _uiClient = null;
     }
     UILogin.Dispatcher.BeginInvoke(new Action(delegate()
         {
             _uiLogin.Opacity = 1f;
             _uiLogin.IsEnabled = true;
             ShowLoginPanel();
         }));
 }
 /// <summary>
 /// Show the panel for the Profile.
 /// </summary>
 public static void ShowMainPanel()
 {
     MyProfile = Proxy.GetUser(Setting.Default.UserName, Password);
     _uiClient = new Containers.UIClient();
     _applicationObject.Events.WindowEvents.WindowActivated += WindowEvents_WindowActivated;
     if (_mainPanel != null)
         MainGrid.Children.Remove(_mainPanel);
     _mainPanel = _uiClient;
     MainGrid.Children.Add(_mainPanel);
 }