public virtual void Create() { if (string.IsNullOrEmpty(Title)) { MessageBox.Show(AppResources.PleaseEnterGroupSubject, AppResources.Error, MessageBoxButton.OK); return; } var participants = new TLVector <TLInputUserBase>(); foreach (var item in SelectedUsers) { participants.Add(item.ToInputUser()); } if (participants.Count == 0) { MessageBox.Show(AppResources.PleaseChooseAtLeastOneParticipant, AppResources.Error, MessageBoxButton.OK); return; } IsWorking = true; MTProtoService.CreateChatAsync(participants, new TLString(Title), statedMessage => { IsWorking = false; foreach (var item in Items) { item.IsSelected = false; } var updates = statedMessage as TLUpdates; if (updates != null) { StateService.With = updates.Chats.First(); StateService.RemoveBackEntry = true; BeginOnUIThread(() => NavigationService.UriFor <DialogDetailsViewModel>().Navigate()); } }, error => Execute.BeginOnUIThread(() => { IsWorking = false; if (error.CodeEquals(ErrorCode.FLOOD)) { MessageBox.Show(AppResources.FloodWaitString + Environment.NewLine + "(" + error.Message + ")", AppResources.Error, MessageBoxButton.OK); } })); }