예제 #1
0
 private void processmsg_TakeEvaluation(msg_TakeEvaluation msg)
 {
     try
     {
         if (this.Activity == null || this.Activity.IsFinishing)
         {
             return;
         }
         //var viewfragment = new TakeEvaluationFragment(msg);
         //var ft = ChildFragmentManager.BeginTransaction();
         //ft.Replace(Resource.Id.dry_evalframelayout, viewfragment);
         //ft.Commit();
         var evalsfragment = new TakeEvaluationFragment(msg);
         var ft            = ChildFragmentManager.BeginTransaction();
         var fragment      = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_evalframelayout);
         if (fragment != null)
         {
             ft.Remove(fragment);
         }
         ft.Replace(Resource.Id.dry_evalframelayout, evalsfragment);
         ft.Commit();
     }
     catch (Exception ex)
     {
     }
 }
        private void Btntaketest_Click(object sender, EventArgs e)
        {
            Bundle args = new Bundle();

            args.PutInt("EvalID", msg_dto.evaluation_dto.Id);
            Vm.EvalId = msg_dto.evaluation_dto.Id;
            //Vm.OpenTakeEvaluationCommand.Execute(null);
            var newmsg = new msg_TakeEvaluation(msg_dto.evaluation_dto);

            try
            {
                if (this.Activity == null || this.Activity.IsFinishing)
                {
                    return;
                }
                if (this.ChildFragmentManager == null)
                {
                    return;
                }

                TakeEvaluationFragment frg = new TakeEvaluationFragment(newmsg);

                var ft2      = ChildFragmentManager.BeginTransaction();
                var fragment = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_evalframelayout);
                if (fragment != null)
                {
                    ft2.Remove(fragment);
                }
                ft2.Replace(Resource.Id.dry_evalframelayout, frg);
                ft2.Commit();
                //if (this.Activity == null || this.Activity.IsFinishing) return;
                //var viewfragment = new TakeEvaluationFragment();
                //var ft = ChildFragmentManager.BeginTransaction();
                //ft.Replace(Resource.Id.dry_evalframelayout, viewfragment);
                //ft.Commit();
            }
            catch (Exception ex)
            {
            }
        }