void accountsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     AccountManager.SwitchToAccount(accountsList.SelectedItem as Account);
     SalesforceApplication.ResetClientManager();
     if (SalesforceApplication.GlobalClientManager.PeekRestClient() != null)
     {
         Frame.Navigate(SalesforceApplication.RootApplicationPage);
     }
 }
        private void addAccount_Click(object sender, RoutedEventArgs e)
        {
            SalesforceApplication.ServerConfiguration.SetSelectedServer(listboxServers.SelectedIndex);
            SalesforceApplication.ResetClientManager();
            ServerSetting    server  = listboxServers.SelectedItem as ServerSetting;
            SalesforceConfig config  = SalesforceApplication.ServerConfiguration;
            LoginOptions     options = new LoginOptions(server.ServerHost, config.ClientId, config.CallbackUrl, config.Scopes);

            StartLoginFlow(options);
        }