Exemplo n.º 1
0
 private async void OnLogOn()
 {
     var client = new ChatClient();
     await client.StartAsync();
     try
     {
         var info = await client.LogOn(int.Parse(_userIdInput));
         var current = Application.Current.MainWindow;
         var mainVM = new MainViewModel(client, info);
         var mainWindow = new MainWindow();
         Application.Current.MainWindow = mainWindow;
         mainWindow.DataContext = mainVM;
         current.Close();
         mainWindow.Show();
     }
     catch (DuplicateIdException)
     {
     }
 }