Ejemplo n.º 1
0
        private async void PostButton_OnClick(object sender, RoutedEventArgs e)
        {
            LoadingProgressBar.Visibility = Visibility.Visible;
            _vm.ForumReplyEntity.MapMessage(ReplyTextBox.Text);
            var  replyManager = new ReplyManager();
            bool result       = await replyManager.SendPost(_vm.ForumReplyEntity);

            if (result)
            {
                Frame.GoBack();
            }
            else
            {
                LoadingProgressBar.Visibility = Visibility.Collapsed;
                var msgDlg = new MessageDialog("Error making reply!");
                await msgDlg.ShowAsync();
            }
        }
 public async override void Execute(object parameter)
 {
     var replyManager = new ReplyManager();
     var vm = Locator.ViewModels.NewThreadReplyVm;
     vm.ForumReplyEntity.Message = vm.PostBody;
     vm.IsLoading = true;
     bool result = await replyManager.SendPost(vm.ForumReplyEntity);
     if (result)
     {
         Locator.ViewModels.ThreadPageVm.RefreshThreadPageCommand.Execute(string.Empty);
         App.RootFrame.GoBack();
     }
     else
     {
         vm.IsLoading = false;
         var msgDlg = new MessageDialog("Error making reply!");
         await msgDlg.ShowAsync();
     }
     vm.IsLoading = false;
 }
        public async override void Execute(object parameter)
        {
            var replyManager = new ReplyManager();
            var vm           = Locator.ViewModels.NewThreadReplyVm;

            vm.ForumReplyEntity.Message = vm.PostBody;
            vm.IsLoading = true;
            bool result = await replyManager.SendPost(vm.ForumReplyEntity);

            if (result)
            {
                Locator.ViewModels.ThreadPageVm.RefreshThreadPageCommand.Execute(string.Empty);
                App.RootFrame.GoBack();
            }
            else
            {
                vm.IsLoading = false;
                var msgDlg = new MessageDialog("Error making reply!");
                await msgDlg.ShowAsync();
            }
            vm.IsLoading = false;
        }