Beispiel #1
0
 protected override void OnParameterChanged(object parameter)
 {
     if (parameter != null && parameter is int)
     {
         categoryID = (int)parameter;
     }
     else if (parameter is Question)
     {
         Title      = "编辑问题";
         q          = parameter as Question;
         Question   = q.Question;
         KeyWord    = q.KeyWord;
         categoryID = q.CategoryID ?? 1;
         Answers    = q.faq_answer.Count > 0 ? q.faq_answer : Answers;
         Attachs    = q.Attachs.Select(l =>
         {
             var item = new Common.Controls.UploadItemInfo()
             {
                 Name = l.Path, State = Common.Controls.UploadDataState.Uploaded
             };
             item.Stream = l.Thumbnail == null ? null : new MemoryStream(l.Thumbnail);
             return(item);
         }).ToObservableCollection();
     }
 }
Beispiel #2
0
 protected override void OnParameterChanged(object parameter)
 {
     if (parameter is WrapMatch)
     {
         wrapMatch   = parameter as WrapMatch;
         MatchName   = wrapMatch.Match.Name;
         level       = wrapMatch.Match.Level;
         Sponsor     = wrapMatch.Match.Sponsor;
         Address     = wrapMatch.Match.Address;
         Description = wrapMatch.Match.Description;
         StartTime   = wrapMatch.Match.StartTime.Value;
         EndTime     = wrapMatch.Match.EndTime.Value;
         StartSign   = wrapMatch.Match.StartSign.Value;
         EndSign     = wrapMatch.Match.EndSign.Value;
         Attachs     = wrapMatch.Attaches.Select(l =>
         {
             var item = new Common.Controls.UploadItemInfo()
             {
                 Name = l.FileName, State = Common.Controls.UploadDataState.Uploaded
             };
             item.Stream = l.Thumbnail == null ? null : new MemoryStream(l.Thumbnail);
             return(item);
         }).ToObservableCollection();
     }
 }