private async void About_Click(object sender, RoutedEventArgs e)
        {
            var chat = ViewModel.Chat;

            if (chat == null)
            {
                return;
            }

            if (chat.Type is ChatTypePrivate privata)
            {
                var user = ViewModel.ProtoService.GetUserFull(privata.UserId);
                if (user == null)
                {
                    return;
                }

                var dialog = new EditYourAboutView(user.Bio);

                var confirm = await dialog.ShowQueuedAsync();

                if (confirm == ContentDialogResult.Primary)
                {
                    ViewModel.ProtoService.Send(new SetBio(dialog.About));
                }
            }
        }
Exemple #2
0
        private async void About_Click(object sender, RoutedEventArgs e)
        {
            var full = ViewModel.Full as TLUserFull;

            if (full == null)
            {
                return;
            }

            var dialog = new EditYourAboutView();

            dialog.About = full.About;

            var confirm = await dialog.ShowQueuedAsync();

            if (confirm == ContentDialogResult.Primary)
            {
                var about = dialog.About;

                var response = await ViewModel.ProtoService.UpdateProfileAsync(null, null, about);

                if (response.IsSucceeded)
                {
                    ViewModel.Full.About = about;
                    ViewModel.Full.RaisePropertyChanged(() => ViewModel.Full.About);
                }
            }
        }