public NoticeDetailsPage(Model.Response.Notice item) { InitializeComponent(); BindingContext = model = new NoticeDetailsViewModel() { Notice = item }; }
public ActionResult ShowNoticeDetails(int noticeId) { var categoryRepo = new CategoryRepository(); var allCategory = categoryRepo.GetAllCategory(); var noticeRepo = new NoticeRepository(); var currentNotice = noticeRepo.GetNoticeById(noticeId); var result = new NoticeDetailsViewModel(); result.CategoriesList = allCategory; result.Notice = currentNotice; return(View(result)); }