okoboji: a lake, a mythical university, kevin moore's blog

okoboji: a lake, a mythical university, kevin moore's blog welcome to msdn blogs sign in | join | help okoboji: a lake, a mythical university, kevin moore's blog kevin moore, program manager, windows presentation foundation (wpf), winfx this blog email syndication rss 2.0 atom 1.0 search go tags avalon internet longhorn oss pdc05 programming random teched 2006 windows tips and tricks winfx wpf archives april 2007 (1) february 2007 (4) january 2007 (1) december 2006 (5) november 2006 (2) september 2006 (6) august 2006 (4) july 2006 (12) june 2006 (2) may 2006 (3) april 2006 (1) march 2006 (2) february 2006 (5) january 2006 (2) december 2005 (4) november 2005 (1) october 2005 (1) september 2005 (5) august 2005 (3) june 2005 (1) may 2005 (2) april 2005 (4) march 2005 (3) february 2005 (1) january 2005 (1) december 2004 (1) november 2004 (1) october 2004 (2) may 2004 (3) april 2004 (1) march 2004 (2) january 2004 (1) november 2003 (11) october 2003 (7) other microsoft chris anderson karsten januszewski tim sneath wpf community robert ingebretsen wpf team members henry hahn lauren lavoie karen corby rob relyea mike hillberg ashish shetty saturday, april 28, 2007 6:37 pm update your bookmarks and blog readers--i'm moving lake okoboji is freezing over indefinitely. in an effort to unify all the random stuff i do, i've rolled my wpf blogging under my (vanity) domain. point your favorites and feed aggregators to work.j832.com. see you on the other side! posted by okoboji | 0 comments wednesday, february 21, 2007 4:27 pm updates to 2 must-have applications! both managed code! both free (as in beer)! paint.net rocks! i can't imagine ever paying for photoshop. now in version 3.0. the killer new feature: mdi. awesome. reflector .net rocks! (via chris, via chris.) take a look at the powerpoint deck for full details of v5.0. the killer new feature: full c# v3.0 support. awesome. posted by okoboji | 0 comments wednesday, february 21, 2007 10:13 am windows vista: what should website hosters do? check out rob's blog on instructions for isp's (or anyone that runs a server) on how to host wpf content (xbaps, xps docs, etc). if you're a wpf fan, link to this post. t'would be good to build awareness on this topic. posted by okoboji | 0 comments monday, february 12, 2007 11:33 pm on itemtemplate, contenttemplate, datatemplate a recent forum post asked how one could build out itemscontrol-like functionality in a custom control. let me start from the basics. contentpresenter presents content. if you give it a uielement (grid, button, border) it will just display it. easy enough. if you give it "data" (customer, order, int32) it will display it using a datatemplate. datatemplate is to data as controltemplate is to control. it lets one define a tree of visuals that represent a given datacontext. robby and i chatted about this just over a year ago. contentpresenter is the "thing" that does the work to realize the datatemplate. it has the magic. one can give contentpresenter a datatemplate in two ways: set the contenttemplate property. this is typeof(datatemplate) set the contenttemplateselector. this is typeof(datatemplateselector) the selector is used if the contenttemplate is null. in the end, it just returns a datatemplate. with me so far? now contentpresenter has no "chrome" to speak of. if you want to show content with some interactive chrome, use a contentcontrol. this way you can show some non-data state (like selection, focus) and have non-data behavior (like checking or clicking). this is what button, checkbox, and listboxitem do. all of these controls do very little. the own some purpose-specific state and rely on a contentpresenter in their control template to do the work of displaying content. contentcontrol also has a contenttemplate property and contenttemplateselector property (as well as, you guessed it, a content property). these are never really used directly by the control, they are simply used to alias values down to the templated contentpresenter. moving to itemscontrol (ic), we have a similar story. ic has two analogous properties: itemtemplate [typeof(datatemplate)] itemtemplateselector [typeof(datatemplateselector)] now ic does a very specific trick. it takes data items from a list, creates wrappers (or containers) for each data item, and places them in a specified panel. getcontainerforitemoverride is a virtual method on ic that is used to generate containers--listbox creates listboxitem, treeview creates treeviewitem, etc. preparecontainerforitemoverride is another virtual method on ic. this is the method that marries the generated container to the corresponding data item. in the process, it sets up the container with the right properties from the parent ic. it sets the contenttemplate of the container to be the itemtemplate of the ic. same with itemtemplateselector. when the container is a contentcontrol, these are once again proxied to an underlying contentpresenter. the question on the forum asks how this can be accomplished in a custom control. well, if one doesn't want to use ic, one can accomplish the same set of things. create code to generate either a contentpresenter or contentcontrol for each data item. expose template/templateselector properties on your parent control. when you generate child items, make sure you alias the properties from parent to child. that's about it. i do this trick in the graph control as part of the bag-o-tricks. i know that the itemtemplate, contenttemplate, datatemplate naming thing can be confusing. remember, at the end of the day, it all boils down to a contentpresenter + template to display data is a cool way. hope this answers the question and sheds some light on the workings of our more complicated controls. happy hacking! posted by okoboji | 0 comments monday, february 05, 2007 8:13 pm programmer don't like to code forgot what link brought me here, but i was quite impressed with the analysis. programmer's don't like to code ...they like problem solving. if programmers liked to code, we’d all be writing in machine language to this day. you can write that stuff all day and get precious little of the real problem solved. if programmers liked to code, they wouldn’t value a language by its libraries. if programmers liked to code, every last one of us would be overjoyed to write our own http client. interesting stuff... posted by okoboji | 0 comments filed under: programming thursday, january 11, 2007 4:10 pm updated bag-o-tricks for january in celebration of the availability of the january ctp of vs "orcas", i've updated the bag-o-tricks. (actually, it's because i'm stuck at home, but i wanted an excuse to mention the vs ctp.) download here: http://wpf.netfx3.com/files/folders/controls/entry8196.aspx have fun! new: zap scroller (cleaned up my christmas present for public consumption.) i've seen this trick done in flash quite a bit. i wanted to play with animating the "current item" in an itemscontrol. i also wanted to model a method for exposing a preview of all of the items in an itemscontrol. i steal and extend some of the command tricks i used it "list pager". let me know what you think. updated: graph a couple of bug fixes. when you set the center node to null, i clear out the lines right away. new nodes come in randomly instead of at the same spot. this post brought to you by: windows live writer, paint .net, and .net reflector posted by okoboji | 3 comments sunday, december 24, 2006 1:25 am a (super rough) christmas present it's 1:22 am. i think i'm getting sick. i'm flying out for california tomorrow. haven't packed yet. and i'm coding. some ideas you just have to get working before you can put them down. in no way is this beatiful code. the end-to-end is pretty interesting, though. when i'm back from cali, i'll clean it up and put it in the bag-o-tricks. in the mean time, have fun playing with zapscroller. playing with control templates + commands + custom animation. build. run. let me know if you think i'm crazy. in the mean time, have a safe new year. see you on the other side! posted by okoboji | 0 comments filed under: wpf attachment(s): zapscrollviewer.zip wednesday, december 20, 2006 4:57 pm chat with the wpf team tomorrow our holiday gift to you: listening. tomorrow (dec 21) 12:30 - 1:30 pm pacific time. details: http://msdn.microsoft.com/chats/ add to calendar (as always, tim is much more thorough than i.) posted by okoboji | 0 comments filed under: wpf monday, december 18, 2006 10:35 pm expression web - beautiful i'm working on an end-of-year letter as web site. (yeah, i'm a geek. i have way more email addresses for friends than mailing addresses.) anyway, i've been bought into css for a while. the start of my projcet aligned nicely with the shipment of expression web, so i've been giving it a go. amazing. the css experience is really nice. managing a site via ftp, dealing with syncing, etc. all very cool. give it a test run. you'll be happy. posted by okoboji | 0 comments sunday, december 17, 2006 11:37 pm business objects are cooler than you think i think it was paul stovell's article on validation in wpf that got me started. the article is amazing and has inspired a lot of my thoughts on what to do with binding in v-next. paul mentioned csla. i wasn't familiar. i dug in. found rockford lhotka. then i found expert c# 2005 business objects. great book! (at least as of page 53). i figured if we're going to build a foundation that allows easy use of business objects, i'd better understand them deeply. an interesting nugget from the book: the philosophical difference between a relational model and a object model (at least according to rockford). relational model: all about data. should always strive for data normalization--reduce duplication of data.object model: all about behavior. should always strive for behavior normalization--reduce duplication of behavior. things i rarely think about. i'll let you know if i get any other cool nuggets as i read. any other good resources on the topic that you know? hope ya'll had a good weekend. posted by okoboji | 3 comments wednesday, december 13, 2006 9:37 pm new hotness, random musings interacting with 2d on 3d in wpf holy hotness! check out details on the wpf3d blog check out the channel9 interview check out the codeplex project (and download the toys) go build games for your xbox too many links. a great write-up on fiercedeveloper. almost makes me want to buy a 360. (but then i wouldn't be coding wpf stuff, right?) diane: space-of-the-week because diane is female and we both work at microsoft, i cannot legally use the word "hot" in this section. diane and i met when we interned the summer of 2001. she's now out on the east coast evangelizing. check out her blog. send her a congrats comment and say kevin told you to do so. more teasing i've made some hints about working on hotness (well, i guess i said "goodness"). i guess a more accurate description would be that i'm coordinating hotness. let's just leave it at this: 3dtools is just the start on codeplex. an aside: praise for zune in wired? i love wired, but the mag/website tend not to love my company much. i was happily surprised to see this article: in praise of zune. yes, i'm posting a single positive article, while ignoring all of the negative articles from wired and others. still think it's nice to see our friends at wired aren't myopic in their reviews. full disclosure, i've only played with the device briefly. but it's nice. if i wasn't so happy with my phone-as-music-player, i'd probably get one. this post brought to you by windows live writer. yes, i made an attempt to proof-read this post. :-) posted by okoboji | 0 comments filed under: random, wpf saturday, november 25, 2006 10:04 pm what do i love about vista? everything chris loves mr. sells does a great job of listing the great features of vista. (including some things i don't use enough.) i had fun bringing my laptop back to iowa for christmas thanksgiving. everyone i showed just sayed said "wow". i'm proud to have shipped code on the dvd. i had to uninstall the games because i was playing free cell too much. it's just too beautiful. more wpf goodness coming soon, i promise. hope everyone had a good turkey day! (update: i'm also thankful for co-workers who aren't shy to tell me when i make a fool of myself.) posted by okoboji | 2 comments friday, november 10, 2006 12:03 am bag-o-tricks : rtm edition okay, i admit i should have a whole mountain of new and sexy stuff for the rtm release. i've been busy lately. busy with fun stuff. i'm hoping i'll get to talk about it soon. (yeah, i'm a huge tease. no, i won't be able to share anything with you even if you send me email. just be patient.) anyway, the download location: http://wpf.netfx3.com/files/folders/controls/entry7094.aspx the changes: new: listpageri've heard this request a lot: how do i add paging support to listbox? there are a number of ways to bake support into the control, but there are few ways to do it cleanly. one of the benefits of wpf is that we have great support for data. why not solve the problem in the data layer? more specifically, build a data component that can be used in xaml to provide paging services over any ilist. sound good? listpager has the magic. it takes an ilist as itemssource property and exposes a currentpage that is a page of items out of the source. uilistpager takes things a step further by exposing a set of commands that are easily bound to the ui via our command model. the result: a very clean, extensible model for paging through data. as a bonus, i built listbase<t>, since i was getting sick of doing all the work to implement ilist<t> and ilist. one should only have to provide an indexer and a count. i tried to build this class as clean and correct as possible, but a clr dev i am not. let me know how it works for you. update: graph i fixed some bugs in graph. all of the nodes should be cleanly and consistently recycled now. i also started playing with changing the location of the nodes using rendertransform instead of via arrange. now graph is not a standard control. it has children, but the size of the graph doesn’t affect the size of the children and vice versa. my goal: minimize the churning of layout when possible. my solution was a bit interesting. i overrode measure and arrange in graphcontentpresenter so they always return the same size. the effect: the parent layout is almost never invalidated (except when the number of items changes). now this is not a 100% blessed model for layout. i need to work through some details with the really smart people on my team. in the mean time, play with caution. update: infotextbox a couple of helpful customers pointed out a bug in my implementation. mouse input was being taken by the “info” and not getting to the textbox. a simple property set (ishittestvisible=”false”) was all it needed. posted by okoboji | 1 comments wednesday, september 27, 2006 12:08 am how you can tell the bolts are tightening i tested the latest rev of the bag-o-tricks on vista rc1 (which included the .net framework 3.0 rc1) with vs 2005 rtm. i just did an install of .net 3.0 september ctp + orcas tools ("cider") september ctp + vs 2005 sp1 beta on my xp machine at home. all of the samples still build and run fine. "cider" and the vs beta seem to play along nicely, too. hurray for locking down! (i'm pretty sure anyone can apply to be on the beta of vs 2005 sp1. go to connect.microsoft.com. click on visual studio and .net framework under available connections. fill out the nomination survey. at least that's what i did. no promises you'll get in.) posted by okoboji | 0 comments tuesday, september 26, 2006 6:28 pm the bag, the blogs, the betas the bag glad to see people are downloading the rc1 rev of the bag-o-tricks. thanks for the love. (always love to hear i have "nice code".) i've already gone down another level on some of the layout tricks i use to get the animation working with layout. i plan on more updates (and hopefully a code walk-through) in the near future. is there a particular demo in the bag-o-tricks that you'd like me to walk through? i was thinking a screen cast would be a good place to start. let me know. the blogs some great blogging happening in wpf land. rob's making me look bad. great info. now that i sit next door to him in building 10, maybe i can distract him from his constant posting. mike hillberg is a god. (not the god, just a god.) not only his he technically brilliant, he's amazingly thorough and a really nice guy. talk about team mates that make me look bad. (update: yes, that's mike, not hike.) the wpf blog. great use of xbap for demos. some...uh..."interesting" content. :-) the windows shell: revealed. not a wpf blog, but pretty darn cool. my buddy vinny put it together. great information about the face of windows vista. the betas the new york times reader beta goes public. an amazing demo of wpf. the best way to experience the new york times. check out the topic explorer in search if you want to see an example of how a graph control can be used in an app. "cider" (the wpf designer for vs "orcas") has been updated for the september ctp of .net 3.0. check out the release notes. happy tuesday. posted by okoboji | 0 comments more posts next page »  

Acceuil

suivante

okoboji: a lake, a mythical university, kevin moore's blog  Fiche de Kevin de Narthoux  Quad Infos Actualit Gants MANDRAGO Kevin  kevin  kvin: Blogs, Photos, Videos and more on Technorati  Kevin Michael - Kevin Michael - critique funk sur Lisabuzz.com  Kevin Bacon : toutes les informations sur Yahoo! Cinma - Yahoo ...  Dyke Kvin  Kevin Costner - Tous les films de Kevin Costner en location de DVD ...  Blog de kevin-87 - ŦŚĤŐŃ... - Skyrock.com  kevin, prnom garcon, ses origines, son etymologie, sa popularit ...  Kevin Spacey : tous les DVD  Acheter KEVIN MICHAEL : KEVIN MICHAEL - Comparateur de Prix et ...  Kevin Kuranyi -  Kevin Fisher @ Soap-Passion.com  Kevin Roberts - CEO Worldwide of Saatchi & Saatchi, the hottest ...  Video Kevin Michael It don't make any difference - Clip Kevin ...  Kevin Saunderson - Biographie, interviews, chroniques, clips ...  Support Kevin Kjonaas and the SHAC 7  Questions et rponses de Wesley Kevin Smith - Yahoo! Questions ...  In Contempt: Political Cartoons by Kevin Moore  Jade et Kevin remportent Koh-Lanta - News tl - Programme TV .net  Litteul Kvin T. 7 par Coyote, N&B, chez Fluide Glacial, une ...  Kevin MacDonald : filmographie & biographie de Kevin MacDonald  Kevin Bacon : infos, photos, bio - Fan-club - TeeMix.com  Digg the Blog Kevin Rose  Quarante-Deux XLII/exliibris/Kevin J. Anderson & Brian Herbert ...  Blog de kevin-botti - Kvin Botti, un des futurs espoirs du tennis ...  Video La lettre de Kevin - guy, moquet, lettre, parodie ...  Bon pour les oreilles: Broken Social Scene presents: Kevin Drew - TBTF  De weblog van Kevin Nugter!  Kevin J. Anderson - Comics VF  Kevin Mc Nulty - Boutique, librairie chrtienne, ma librairie ...  Kevin Ayers. Rsurrection - PlanetGong : Rock'n'roll et mauvaise foi.  Kevin MACHTELINCK - Jeu de dames - Fdration Franaise  Cyberportfolio Ah! - le cyberportfolio de M. Kevin  kevin - Vidos - Wideo  Tournois de l'ICGA : Kevin O'Connel  Kevin Froissard sur Ziki.com  Kevin Federline - Photos, Vidos, Biographie, Fan club, Site ...  Kevin Garnett - Fluctuat.net  Blog de kevin-ma-petite-vie - LE BLOG DE KEVIN - Skyrock.com  Kevin Michael : 4 Paroles, clips, mp3, cd, album  Kevin Parent: SEIGNEUR LYRICS  Jade et Kvin, doubles vainqueurs de Koh-Lanta - Jade et Kvin ...  USA - Alexandria - Assassinat de Kevin Shifflett  KEVIN-POLLAK - Acteur/Actrice - Achat DVD  :: CATSUKA :: Focus On - BD / Illustration - Kvin "Trantkat" Hrault  Forum Kevin Michael  Le Blog Photo Exposition : Enfants du Monde de Kevin Kling  Tous les DVD de Kevin Reynolds petit prix  Kevin De Cock Directeur Dpartement du VIH/SIDA  Voila Sports - NBA - Kevin Garnett (Ailier) - Boston  Kevin Costner - Biosstars  Kissing the rain - Kevin Brooks : Encore une page  Kevin Ces et Fabien Dugrip - Vidos Sport - Ma-Tvideo France2  Gagnants Koh Lanta 7 : Kevin et Jade remportent laventure  Kevin GOSSELIN - IMPRIMERIE CORLET - Parcours Pro et CV  DVD ou film : Kevin Costner (Acteur) - Cinetroc  La BNU selon Kevin Kelly - faits et chiffres bibliothcaire  Kevin Smith - DvdToile