欢迎来到天天文库
浏览记录
ID:12594405
大小:103.00 KB
页数:13页
时间:2018-07-18
《现代软件技术实验2》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、计算机科学与工程学院《现代软件技术》实验报告武汉工程大学计算机科学与工程学院《现代软件技术》实验报告[2]专业班级实验时间学生学号实验地点学生姓名指导教师实验项目UsingMVVMpatterntorealizeacustomermanagementsystem实验类别基本型实验实验学时6实验目的及要求实验要求:Windows7或以上操作系统、VisualStudio.Net2010或以上版本的应用程序,SQLServer2005数据库或以上版本、WindowsPhone7Toolkit7.0或以上版本。学生应按指导教师的要求独立完成实验,并按要求撰写实验报告(应包含实验
2、核心程序、实验过程和结果中的关键图片)。成绩评定表类别评分标准分值得分合计上机表现按时出勤、遵守纪律认真完成各项实验内容30分报告质量程序代码规范、功能正确填写内容完整、体现收获70分说明:评阅教师:日期:年月日13第13页共13页计算机科学与工程学院《现代软件技术》实验报告实验内容(1)CreatingtheDataModelThemodelisasingleclassnamedAccomplishment.TheAccomplishmentclassimplementstheINotifyPropertyChangedinterfaceandthePropertyCh
3、angedevent.Thisallowstheclasstonotifyitsviewswhenapropertyvaluechanges,andthentheviewscanupdatetheuserinterfacebasedonthatchange.Inthisapplication,theusercanonlychangetheCountandCompletedproperties,soyouonlyneedtoraisethePropertyChangedeventinthoseproperties.Youwilltestthedatabindinginthe
4、finalprocedure.(2)CreatingtheViewModelInthisprocedure,youcreatetheViewModel,whichisthelinkbetweentheModelandtheView.TheViewModelisacollectionthatcontainsobjectsfromtheModel,inthiscaseAccomplishmentobjects.TheViewModelusesanObservableCollection.Thisallowsittonotifyitsviewswhenitemsinthecol
5、lectionchangeandtheviewscanupdatetheuserinterfacebasedonthatchange.TheViewModelcontainsthecodetogetthecollectionofaccomplishments.First,youchecktheisolatedstoragetoseeiftheaccomplishmentsarealreadysaved.Ifyes,youuseisolatedstoragetopopulatethecollection.Ifnot,youpopulatethecollectionwithd
6、efaultaccomplishments.Inalaterprocedure,youwilladdthecodetosavetheaccomplishmentstoisolatedstorage.(3)CreatingtheFirstViewInthisprocedure,youcreateaviewtodisplaytheitemaccomplishments.Inalaterprocedure,youwilldisplaytheviewonapageandconnectittotheViewModelbysettingitsdatacontext.Notethatt
7、hereisnocodebehindthisview.TheviewisausercontrolthatcontainsaListBoxboundtothedata.EachitemintheListBoxhasthefollowingthreecolumns.(4)CreatingtheMainApplicationPageInthisprocedure,youcreatethemainapplicationpage.Themainpagecontainsthetwoviewsthatyoucreatedpreviously
此文档下载收益归作者所有