/* BeejBlog */

Richard Feynman (Nobel Physicist, 1918 - 1988)

Richard_Feynman

Just kinda catching up with how “fun smart” this guy was… worked on the Manhattan project, all kinds of creative physics problem solving, “Original Prophet of Nanotechnology”, Nobel prize in Physics 1965, liked strip clubs, art and bongo drums… there are at least two semi-auto biographies out there in public circulation… I’m reading “Surely You’re Joking, Mr. Feynman!” right now… also a few enjoyable BBC Horizon videos featuring a fair amount of direct interview content: “The Pleasure of Finding Things Out (1981)”, “The Quest for Tannu Tuva (1988)” and “No Ordinary Genius (1993)

My first real WPF exposure

Having a fairly “good time” getting up to speed on a WPF based app for my day job.

Highlights:

  • Coming from ASP.Net the last few years it’s nice to see so much similarity and convergence in how one thinks about building GUI’s in the two environments… specifically TEMPLATE based UI’ing in XAML… if you’re an ASP.Net head, think of a Repeater and how you can customize exactly what you want each row to look like via the ItemTemplate… WPF is like that on steroids… the template stuff gets pretty deep and thick pretty fast and i don’t ‘get it’ all just yet… but it’s coming as I go along looking for examples out in the wild for what I know can be done.
  • Laying out a UI in XAML as if it was HTML feels very intuitive… nesting element tags within tags, setting margins for pixel perfect whitespace aesthetics, using the various free flow containers that automatically stretch to fill in the size of the current window is all grand to see finally available over in Windows land.
  • Speaking of the free flowing UI… this can’t be understated… everything is finally geared towards this kind of layout… you actually have to work at it to “hard code” elements at a specific X,Y position… using the various panels Stack, Wrap, Dock, ‘Grid’ just makes sense after whipping up Web UI’s for years… very good stuff
  • The templating really opens up the guts of all the stock WPF controls to extensive tinkering way beyond any Microsoft based GUI building framework we’ve had to date… there are tons of annoying esoteric gotchas to be found in how all the little pieces of the stock controls hang together but one can rest with confidence that if you take the time to dissect, you will be able to force it to do whatever you want… there are tools like “snoop” which give you a full tree breakdown of a running UI’s widget hierarchy… then starting with a known element reference you can walk up or down the widget hierarchy in code to dial in on exactly which chunk needs to be tweaked.
  • The amount of flexibility in the syntax for databinding to various objects is mind boggling… binding to your own custom business objects is well covered… but also binding to .Net framework and UI elements is just as possible if the situation demands… I’m sticking with DataTable/DataView binding via thin BO property wrappers for now versus maintaining a BO property per field… i really abhor a full blown OO business object layer, especially if I have control over the database like in this situation.
  • This is a good example of h0w “elegantly” all of the current .Net stuff hangs together… targeting a specific WPF DataGrid column via Linq lambda function:

    static public void GridSort(DataGrid Grid, string ColumnName, ListSortDirection Direction)
    {
      Grid.Columns.Where(c => c.SortMemberPath == ColumnName).Single().SortDirection = Direction;
    }