Beispiel #1
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<Major> majorList = null;

            switch (e.RequestCode)
            {
                case RC_GET_ALL:
                    if (e.IsSuccess)
                    {
                        majorList = Parser.Serialize<List<Major>>();
                    }
                    break;
                default:
                    break;
            }

            if (MajorEvent != null)
            {
                MajorEventArgs majorEventArgs = new MajorEventArgs(majorList);
                majorEventArgs.LoadEventArgs(e);

                MajorEvent(this, majorEventArgs);
            }
        }
        private void MajorLoadedEvent(object sender, MajorEventArgs e)
        {
            if (ClassroomProvider.RC_CREATE == e.RequestCode && e.IsSuccess)
            {
                DialogHelper.Close();

                DialogHelper.Show("成功添加专业");

                DialogHelper.Dispatcher.Invoke(delegate
                {
                    BackToPreviousCommand.Execute(null);
                });

                return;
            }

            DialogHelper.Show("添加失败,请重试");
        }
Beispiel #3
0
 public void MajorLoadedEvent(object sender, MajorEventArgs e)
 {
     if (e.IsSuccess)
     {
         switch (e.RequestCode)
         {
             case ClassroomProvider.RC_GET_ALL:
                 MajorList = e.MajorList != null ?
                     new ObservableCollection<Major>(e.MajorList) : null;
                 break;
             case ClassroomProvider.RC_CREATE:
                 DialogHelper.Dispatcher.Invoke(delegate
                 {
                     GetAll();
                 });
                 break;
             default:
                 break;
         }
     }
 }