Damon Payne: Hand waving Silverlight Architect

103db signal to noise ratio at < .03% total harmonic distortion
Solution Architect, software developer, geek
Damon Payne at Blogged
2009 Microsoft MVP - Client App Dev
2007 Microsoft MVP - Solution Architecture
 Friday, January 09, 2009

Next week, January 13th, is the MSDN Dev Con in Chicago.  I will be going, as will some other Milwaukee area folks.  I am looking into the parking situation and organizing a carpool, but I am also organizing a trip to Fogo de Chao afterwards.  I'll probably be taking the car seats out of the DamonMobile and driving, so leave me a comment or an email if you'd like a ride.

I'll be bouncing around, not sticking to any particular track, and doing some socializing since I know some of the speakers. 



Friday, January 09, 2009 10:56:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Friday, January 02, 2009

So here I am in 2009 starting off the year horribly sick and unemployed in a terrible economy.  Still, I have very high hopes that I can make some good things happen for me and my family this year.

Last year I posted some goals, and I only hit 40% of them.  This year the 2009 goals are much more personal and private.  Still, it's pretty interesting looking at the posts from January 2008 to see how myself and the world have changed in a year.  Here are some thoughts on year old topics:

Warner Goes Blu-Ray exclusive:  Even a broken clock is right sometimes, and I'm still glad BD won the day.  A year later, HD optical media is still where I said it would be; the infrastructure is not there yet for downloads to rule the universe.  Since I will most likely end 2009 with 1.5mb DSL (come on, U-verse...) I don't see this changing in 2009.

Program Control: Man, I continue to be somewhat disappointed in the entire Windows Mobile/Compact Framework universe.  I will not shed a tear if I never do mobile development again.  I have a post coming out regarding what I think (whatever that's worth) MSFT could do to use its strengths to Win in the post iPhone world.

Task Parallel Library: I went on do do a LOT more parallel programming in 2008, my favorite being getting xUnit.Net to run my unit tests in parallel.  I have a lot more stuff coming this year, including a re-working of the tree-based scheme.

New Office: Hard to believe, but Wednesday was my last day in the aforementioned new office.

 

I think 2009 is going to be a great year.  I don't think it's too pessimistic to think that in terms of the economy there are areas where we might not have hit bottom yet, but in general I think America is still free enough to pull ourselves out of this.  A lot of people are excited about the new president, who seems to be settling into Reality and his economic team has promised to lower taxes across the board which is what we need; definitely not the platform he was elected on though.  Markets are driven heavily by Expectations, and a lot of folks expect great things from this guy, so at the least I'm glad to see some positive energy out there.



Friday, January 02, 2009 10:39:50 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, December 31, 2008

It's had to believe it's been more than two weeks since I last posted, especially since there's so much going on in DamonLand.

 

Professional

Today was my last day at CarSpot, a place I'll really miss.  I've been consulting most of my career and mostly had shorter assignments - always ready to ride off into the sunset and tackle the next challenge.  My time with CarSpot both as a consultant and full-time employee represents my longest and most serious commitment to any business venture.   I grew a lot during these years, and I met a lot of great folks I hope to keep in contact with.  I've never seen such a large group of people all of whom were loving their job and work environment and so loathe to split the team up.  I met some fabulous folks at our parent company, AutoTrader.com, and I hope they stay in touch too.  I owe several of them a tour of my wine collection and some hearing loss in my home theater.

It's somewhat hard to get business of any kind done during this time of year with all the vacations and such going on; but I expect next week to be fairly busy. I'll be co-working from various locations in downtown Milwaukee, Brookfield, and Delafield next week if anyone is interested in meeting up.  Watch Twitter.

As for what I'm doing next, I will only say at this point that my Round 1 and 2 meetings are mostly done and that I have several things I'm excited about.

The Argentum Tela design surface project is going well, the currently working article [19] is about Undo/Redo support and Commands in Silverlight and is somewhat complicated but also a lot of fun. 

I'm also working on an entry for the Silverlight Write and Win contest.  I was going to just write some new articles and submit AGT in its current state but I thought that was kinda cheap and would require slight re-work to fit the contest rules.  My submission will be in the vein of Visual Tools though and I think it's pretty slick.  We'll see what the judges think.

I also have some other things to keep me busy, potentially related to my next steps: some heavy Entity Framework development coupled with a bunch of Dependency Injection refactoring, a purpose for HandWaver.com, coming up to speed on SharePoint, and other refactoring of side-project code and article writing.

 

Personal

We had an awesome christmas.  On christmas eve I shoveled snow for hours on end, on christmas day I cooked boeuff ala mode (French style pot roast in red wine sauce) which is at minimum a four hour task.  My daughter, who is incredibly awesome and creative (especially considering she's 5), got her daddy a true chef's hat as a gift.  Pictures of this will be coming as soon as my kitchen is presentable enough to take photographs in.

It's New Year's Eve and I'm sick as hell and so is my son.  This has ultimately resulted in us staying in tonight, I'm about to make a nice dinner for my wife and I to be followed by Champagne and some Kabinet style Riesling - I expect I'll be crashing right after the ball drops.  I love Champagne.  I often use Champagne, considered by many to be a special-occasion-only drink, to celebrate (wait for it) my love of Champagne.

Despite having a brand new house I find myself running around caulking little cracks here and there to keep the house warm.  It has snowed an outrageous amount this winter, and since I have been too stubborn to buy a snow thrower as of yet I've lost a non-trivial amount of weight through shoveling it all.  My neighbors, who totally rock, occasionally have pity on me and help me out when things get really rough.

Jen and I met seven years ago tonight!  My totally awesome Queen among Wives and I now have two kids and we're looking forward to a great 2009.  We consider New Year's Eve to be our real anniversary despite getting married on June 9th.  We met at a dinner party I threw involving me cooking and serving Champagne.  Some things never change!



Wednesday, December 31, 2008 9:32:06 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, December 14, 2008

So, this weekend involved a road trip to Missouri for some family business - namely seeing my grandfather while he's still see-able.  A fringe benefit of making this trip was that my mother had received an iPhone from my uncle (confused yet?) and she didn't want to pay for the data plan.  So, guess who has an iPhone now?

I bleed Microsoft red.  I chuckle at the fantastic claims of Mac addicts.  Still, I've seen the iPhone in action and it seemed to be a nice little device. 

Inflammatory statement #1: Unlike many of the Microsoft-hating Mac-worshipers and Java fiends, I still have a solid core of objective thought and rational epistemology.  By this I mean merely to say that I'm not going to forego what may be a really nice gadget just because Apple makes it.

First Impressions

Obviously the thing is sexy.  It's curvy; it's sleek; it's reassuringly heavy for such a small and fragile looking item.  The sexiness is the first clue that this is a different thing made for different people than, say, my AT&T Tilt.  I can't remove or replace the battery.  I don't see a place to add a storage card.  I can't insert my SIM card without surgical tools.  Apple does not make products for "Tweakers".  This is meant to be a "finished product"; future be damned.  Still, towards this goal it's clear the device isn't cheap.  It's got 16gb of internal storage and feels like it's well made. 

From initially playing around, it seems easy enough to find settings and launch programs.  Like Windows Mobile, it takes some getting used to not needing to "close" a program, just hit the Square button to return home and move on to the next thing.  While I maintain I'm objective in terms of technology, I can't claim to be objective in terms of Gadget Discoverability.  I have used far too many gadgets for far too long and written too much software to have a good sense of how usable the Average Dude would find the iPhone, but I expect it's very usable.

Since this was "gently used" before landing in my hands, the first thing I did was look into some kind of Ultimate Cold Boot so I didn't have to manually remove my uncle's bizarre mix of Dragonball Z soundtracks and bad 80s metal or contacts and text messages.  To my delight there is in fact a "Totally erase everything" button, which I did.

Setting Up

I have become very dependant upon Outlook synchronization for my Tilt (and 3 smartphones before that) so I did make sure there was some way to sync Outlook contacts & calendar to this thing before accepting it.  This is done through iTunes.

Huh? iTunes?

Yes, Outlook synchronization on vista is accomplished via iTunes.  I'm not sure why this would be.  Is iTunes the only foothold Apple has on Windows?  Are they trying to trick me into using iTunes?  Do they assume anyone with an iPhone must be using Vista only because of some dire need and they're trying to supply a pleasant all-in-phone experience?  I'm not sure.  What I am sure of is this is where my double-standard detector started going apeshit.  This "Duh, you need to have iTunes to move contacts to your phone" type of thing is precisely the sort of behavior that Microsoft has routinely been crucified for no matter what explanation is offered.  I chuckled to myself, chose not to go to the iTunes store on launch, and plugged in the iPhone.

I was greeting with an appropriate settings screen asking me when and what and how much I wanted to move from Outlook to the iPhone.  I expected as much based on Active Sync Mobile Device Center and chose not to move anything yet until I'd felt my way around.  I also see that I need to download a new iPhone software version which is not surprising since my family elders previously owned this gadget.  I was shocked and amazed at how long it took me to grab this and maybe I'm mentally fried from the long car ride today but it wasn't easy to see where I could find the download status of this 250MB update.  I've managed to have two glasses of wine and write this entire article up to this point while waiting for something to happen.   I just downloaded 67MB of iTunes and I'd say this was about 10x slower byte for byte.

I now have a progress bar on the iPhone.  It's moving as slow as paint drying but I've done phone updates before so this comes as no surprise.

On to the past

While I wait on the update, some more early impressions. 

From my hotel in SmallTown, USA I was able to get on WiFi and mess around with this thing even though I had not yet moved a SIM card to it.  Based on the commercials, two things immediately struck me.  First, even on 10MB WiFi, the thing is not remotely as fast as you see on TV.  This, in fact, resulted in a huge "truth in advertising" lawsuit in the UK when a magazine showed that what takes 20 seconds on TV in fact takes nearly 3 minutes with a 3G iPhone.  Here in America, though, Apple can do no wrong so I doubt any such challenges are coming.  The second thing I noticed was that I expected nearly everything to respond with screen orientation changes when I tilted the thing, but found only Safari gratifies this and only after thinking about it for a while. 

Speaking of Safari, this is one of the places where this device shines.  While there's certainly no reason for me to run Safari on my desktop, the rendering and scaling of web content on the iPhone is top notch so far.  I just re-did my blog skin with a lot of painful CSS work to appease both Firefox 2 and IE7, and was very pleased to see DamonPayne.com show up perfectly on the iPhone.  The previous owner did not have DamonPayne.com bookmarked (WTF? Does he live under a rock?)  so getting there involved some typing.  As someone who's used and evaluated eleventeen-brazilian mobile devices in the past ten years I was pleasantly surprised at the near-usability of the on-screen keyboard.  Tactile-response is still king in my book but the iPhone keyboard was tolerable.

Back to Freedom Zero

My iPhone has finally updated itself and, though I have been playing with the damned thing for two days with no SIM card in it, I am now met with a screen which won't let me do anything until I insert a SIM card.  Jeff Atwood's Freedom Zero post is appropriate here.  It's getting late and I need my beloved Tilt for meetings tomorrow, so I'll try quitting the Tilt cold-turkey tomorrow afternoon and see what happens.

My wife is drooling over my Tilt (she has various Medical software for WinMobile) and my Zune so I need to make this transition happen stat.  I haven't told her she's not getting the Zune because I'll use iTunes when it's the last way to listen to music on planet earth.  One thing at a time.



Sunday, December 14, 2008 11:31:55 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Thursday, December 11, 2008

The AGT (Argentum Tela) series of articles is an effort to do two things. Usually an idea is presented only in its finished form. The first goal is to do some Reality Blogging, to show an idea evolve over time without pulling any punches. The second goal, and the example vehicle for the evolution aspect, is an extensible Design Surface for Silverlight similar to what we have in Visual Studio 2008. This type of application has all sorts of interesting uses. My example is a Home Theater layout tool. Read the entire saga: http://www.damonpayne.com/2008/09/14/RunTimeIsDesignTimeForAGT0.aspx

Yes, I changed the name of the article.  Here at the 19th step, I decided to ditch the old tagline.

Visual and Code Refactoring

After letting Property Editing sit for too long, I have a list of questions to answer and things I've been meaning to fix or refactor.  I publish these Refactoring articles as part of the Reality Blogging commitment but also in case some of the random code is useful to anyone.  Let's get started.

 

Visual Lasso

I don't know why I had a corner radius on the Visual Lasso, I was probably suffering from some Web2.0itus which I am now over.  I change this and changed the colors:

Vision18

The lasso was also crashable by drawing diagonally until the lasso size would involve negative numbers.  This is fixed.

 

Some Questions

I have gotten some questions from interested parties, which I'll answer here.

  • How about a better constructor for LogMessage?
    • Sure.  More constructors provided
  • Where is IDragDropmanager.RemoveDropTarget?
    • Missing.  I can be very focused trying to get these articles out sometimes.  This has been added.
  • In Page.xaml.cs in the example application, why are you resolving IRegionManager when the Page is the IRegionManager implementation?
    • Force of habit, and I was unsure how I was going to leave that.  And there's nothing wrong with talking to yourself using a Contract...
  • Why are the names inconsistent between IPageView and RootPresenter ?
    • Shameful inconsistency.  IPageView has been renamed to IRootView.
  • Why are the names of the Region Controls in Page.xaml not the same as the Regions themselves?
    • More inconsistency.  They are all named XXXRegion now.  As I looked at this I also wondered why I was using Canvas and not a ContentPresenter, possibly something to do with how much ContentPresenter was chaning in Beta2-->RC0.  At any rate, the regions have good names and I've switched to ContentPresenter.
  • In IRegionManager, what is the difference between RootVisual and TopLevelContainer?  Why do you need both of them?
    • RootVisual is meant so that IRegionManager could provide something to System.Windows.Application.RootVisual, and matches its type of UIElement.  I could probably rename this to ApplicationRootVisual since that is the only reason to have this.  TopLevelContainer is used as the main Playground of services that need to do something visually, like DragDropManager.  This isn't as bad as it first seems, for example the built-in "Popup" class must do something very similar.  Comments have been added.

The Border on DesignSite

When is five minus five not zero?  When you have applied a RenderTransform to a FrameworkElement.  For the border on DesignSite, I would move the control by the border thickness (5px) when I would hide or show the border.  Once you have applied a RenderTransform, though, changing a Canvas.XXXProperty by 5px no longer means 5px.  I fixed this by using a transparent and normal border rather than by changing the border thickness from 0 to 5 to show selection.

 

~Creative Commons

Since I had to choose from a list of licenses on Codeplex (I chose MS-PL) I am removing the creative commons snippets from the code as I see them.

 

Clipping

The Canvas does not clip its children.  This means you can drag controls all over the place outside of the Design surface which is obviously undesirable.

Refactor: I extracted a MouseMoveSelection method and made it virtual so the logic was not totally hidden inside an EventHandler.  This method ultimately calls MoveSelection

I needed to make a decision here, to either create a class that extends Canvas or Panel and does perform some form of clipping on its Children, or to simply implement boundaries within the DesignSurface class.  For now I went with enforcing the bounds in code and snapping the selection back to a valid value.

Floating Properties

I went back and finished implementing my original intention for the PropertyGrid, namely that it would float around with the selection and not be statically docked to the right of the surface.

Refactor: I had a TODO item to un-hack the relationship between IDesigner and DesignSite.  Since IDesigner defines a Surface property of type Canvas this was mostly already done.  DesignSite.DesignParent is now of type IDesigner.

Refactor: Some methods, like GetSelectionBounds(), seemed to belong more on IDesigner than DesignSite after the above change was made.

What I sought to do next was pretty vanilla: if IDesignEditorService.Visual currently had a parent, I would remove it from its parent and add it to IDesigner.Surface or IRegionManager.TopLevelContainer in a location close to the right bounds of the current selection.  Control.Parent and VisualTreeHelper.GetParent both have a return type of DependencyObject.  It seems there is no generic way to remove a FrameworkElement from its visual parent.

DamonPayne.AG.IoC.ControlExtensions  now has a RemoveFromParent() extension method.

The PropertyGrid now floats around to be close to the current selection.

Vision19

 

Bigger Surface

In order to set things up for some future articles, I have change the default size of the DesignSurface and the sample application.  Yes, this means it won't fit on a 1024x768 screen, which apparently some people still have even in this late hour.  We'll fix this in a future article but for now I wanted more room to play.

 

A better Toolbox

The way gestures worked in the toolbox had been bothering me, and I thought I could make it better looking anyway, a little more like Visio perhaps.  I nearly introduced an external dependency on the Silverlight Toolkit, but wanted to see how to do this myself instead.  Given the amount of space I'm working with, I needed to add some more furniture.  I have created an area rug, which I feel really ties the room together.

I created a Control extending Panel, WrapLayoutPanel, to property postion them items in my new and improved toolbox.  The MSDN documentation for MeasureOverride and ArrangeOverride was simple, but surprisingly helpful.

Here's the new and improved toolbox:

Vision20

 

  Conclusion

I've finally gotten around to fixing a number of things that have been bothering me, and I think the application looks a little better too.  I am having a hard time deciding what to do next, and I'm afraid the next two installments are not going to be very sexy, but will be very necessary to tie all the concepts together.

The changes in this article are published as version 0.7.18, Codeplex change set 8710.  While things are still very rough, I did go ahead and make this the default public release on Codeplex.

The live demo has been updated at http://www.damonpayne.com/agt



Thursday, December 11, 2008 6:26:42 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, December 06, 2008

Reggie Burnett of MySQL fame has finally spoken out on the oft-promised, never-delivered Entity Framework support coming in the 6.0 version of MySQL connector .NET.  You can comment here.

I wanted to post this as I am sure there are many people here who feel like they have been mislead. I can assure you that you have not been intentionally mislead. The 6.0 release that will have entity framework support was supposed to be out over 1 month ago. It was been delayed mainly for licensing reasons. There is a large chunk of code that we are planning to include in that release that is licensed as MS-PL and the MS-PL is not compatible with the GPL. I have some program managers and our legal department working on it and hope we can find an answer very soon.
I am very sorry for the delay and appreciate your patience. I am very committed to the .NET/Mono community and have been given full support from Sun. I have also been told that I will perhaps be getting some additional developer support in the near future. That will certainly help to speed things up.
Again, I apologize for the delay. I am not trying to duck your questions in this forum but have just been working hard on the 6.0 release. Even with the delay I think everyone will be pleased with it. The main features are:
1. Completely rewritten visual studio integration with improved table editing including change script generation
2. Improved performance of the connector in many scenarios (faster than libmysql in some cases). This is a _very_ big deal.
3. Entity framework support

That's good news!  Working for corporations with legal departments often means being extremely careful of what one says in the public forum so I'm willing to give Reggie the benefit of the doubt for his radio silence on certain topics.   This means I can actually start moving ahead on some personal projects of mine that use MySQL for $$ reasons.  MySQL should be ready to rock before I am done fighting with CSS.



Saturday, December 06, 2008 11:37:34 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, December 05, 2008

I have removed my previous comments regarding certain events.

Myself as well as some other folks, were impacted by a reorganization.

At this point I'm looking to start networking; I'm looking for my next opportunity.  I have posted my resume below.  If you need a Software Architect, technical team lead, or a Web/Silverlight/WPF/WinForms/parallelism/Mobile developer I'm available in January.

I am also collecting the personal contact information of my current teammates in order to hopefully help them make connections.  If you are looking for some great graphic designers, a Scrum Master, support & fulfillment personnel, or expert LAMP-stack developers, I can put you in touch with some great folks that I can vouch for.

Resume posted here.



Friday, December 05, 2008 2:22:44 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, December 04, 2008

I will be at the "Mini PDC" MSDN developer conference on January 13th in Chicago, IL. 

http://msdndevcon.com/Pages/Chicago.aspx

It looks like I know several of the speakers and some of the content has likely already been seen online, but I'm eager to see this stuff in person and getting Windows 7 Beta is worth the train ride down!  The PDC was huge this year and it's nice to have a chance to hit the highlights.

I'm thinking a reservation at Fogo de Chão will be in order for after the show...



Thursday, December 04, 2008 2:23:30 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback