i think may have found bug in webmatrix's pagedata, not sure. concerns how pass data partial page calling page. in webmatrix documentation (tutorials, e.g. " 3 - creating consistent look ", , example code), pagedata recommended mechanism pass data between pages (e.g. content page layout page, or partial page). however have found not work other way, pass data partial page calling page. modifying or adding entries in pagedata in partial page, not seem calling page. cutting right down simplest possible example, in test page may have this: @{ pagedata["test"] = "initial entry"; } <p>before calling partial page, test value @pagedata["test"]</p> @renderpage("_testpartial.cshtml") <p>after returning calling page, test value @pagedata["test"]</p> and in _testpartial.cshtml page might have this: @{ pagedata["test"] = "modified entry"; } <p>in partial page...
how set z-index drawing object when using drawingcontext.drawxxx() methods? the object drawn last have higher z index. can't change index of drawn objects. way draw in order. if using wpf (as placed tag), can use, example, canvas control. create shapes need like polyline obj = new polyline(); //... // ... set properties of obj and add them canvas uielementcollection: yourcanvasname.children.add(obj); //or yourcanvasname.children.insert(i, obj); first items of collection have higher z index. advantages in way: no need redraw on window changes, can anytime move objects , change order.
the situation my custom controller class has following method: - (void)requestviewcontrollerwithidentifier:(nsstring *)identifier fromobject:(id)object; this causes object receive message: - (uiviewcontroller *)viewcontrollerwithidentifier:(nsstring *)identifier; the problem right now, object id there's no guarantee implements method, , compiler warning when send message. the solution i came 2 solutions myself: use protocol. make id nsobject , create category nsobject . they both fine solutions , don't mind choosing 1 of them, but... the question ...i noticed apple doing odd in gamekit api. gksession has following method: - (void)setdatareceivehandler:(id)handler withcontext:(void *)context handler id , apple requires implement method: - (void) receivedata:(nsdata *)data frompeer:(nsstring *)peer insession: (gksession *)session context:(void *)context; without making use of protocol or category! i'm wondering how , why thi...
Comments
Post a Comment