Michael Wolf

{Binding ME}

20080602 Monday June 02, 2008

Cynergy @ Microsoft Tech Fest Reston VA

We have been crazy busy here at the Cynergy Silverlight/WPF desk, but not too busy to share our knowledge with the community.

Come join us next friday in reston as we sponsor and present at the Microsoft Tech Fest.

Location: Microsoft Reston MTC
Event Date: June 13thth, 2008

REGISTRATION: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032379255&Culture=en-US

Heres quick abstracts on the sessions

Microsoft Web Technologies: What’s the Latest?
In this session, we will share with you the latest of Silverlight 2.0 and Expression 2.0 and Microsoft web technology roadmap. We will talk about the new features, the developer and designer productivity synergies and workflows. We will also talk about how Microsoft Silverlight compares with competing technologies.

Designing a Rich Interactive Silverlight Application with Expression
First impressions can make or kill any relationship, and nowhere is this more true than in software. In this session we will show how to use the “Look First” design pattern together with the Expression suite to develop a rich and engaging interactive Silverlight media player. Using the Expression suite we will show how to skin controls and design animations to best meet the user experience, and optimize the designer developer workflow.

Building a Rich Interactive Application with Silverlight and WCF
Now that the user interface has been created, the user experience fleshed out, it's time to transition from design to development and wire up logic and services. We'll provide the logic that makes the application tick, and the services that connect it to the larger infrastructure. We'll discuss the communications options available in Silverlight and delve into WCF service support, building out the application along the way.

Panel Discussion
At the panel discussion, you will be given a unique opportunity to ask questions and share comments on questions that have been raised by other attendees. The panel consists of speakers from the event and optionally guest speaker(s).


Come on out and make sure to come say Hi!!

Posted by michaelwolf | Jun 02 2008, 12:00:00 AM EDT

20080214 Thursday February 14, 2008

User group slides and Silverlight Example

Last weeks talk at cmap was great. We had some awesome discussions about what’s happening with silverlight and how to integrate RIA concepts into all layers. Was also great to see the community building up around us, ria + enterprise dev + alt.net ... its a powerful combination.

I promised I would post up the ppt and examples so get it while 1.1 is still hot.

Power Point:


For the silverlight player shy, here’s a quick screen cast of the example
Screen Cast of Example

Running mdi Example:

Posted by michaelwolf | Feb 14 2008, 09:00:54 PM EST

20080130 Wednesday January 30, 2008

Talk at maryland user group

I'll be talking at the next CMAP User Group main meeting Tuesday February 5th. The talk is half "a developer call to arms" and half "If silverlight doesn't have <insert .net goodness here />, then how do I do it".

Abstract:
UX is the new UI: It's not the framework, it's how you use it.

As developers we love our frameworks and the elegance of code. Yet we often spend so much time staring at code we forget the essential user centered problem were trying to solve. In addition, due to the amazing and ever evolving frameworks/ tools / controls we have at our disposal, we often forgo what's most usable for what's most available. In this talk we will delve into these problems using examples written in Microsoft Silverlight, including the winning solution from the Microsoft Phizzpop Design Challenge LA.

Tuesday, February 05, 2008 6:30 PM
6751 Columbia Gateway Drive
Columbia, MD 21046 (map)

CMAP is a great group, hope to see some of you there.

Posted by michaelwolf | Jan 30 2008, 03:35:26 PM EST

20071231 Monday December 31, 2007

one crazy year

It's been one crazy year, and the last couple months have been the craziest of them all. So crazy, that I've got at least 3 blog entries written in my head with on time to get them out. So this is just a quickie.

To think that silverlight was just officially announced less than a year ago now. Allot of people have spent allot of time blogging about the future of silverlight. I'm not going to spend a ton of time rehashing them all, but I will say, if the community has been able to do what we have with as little as we have, just look out post mix for what can be done.

On that note let’s leave the year with looking back a bit, while looking ahead to march 08.
Don’t forget to go out to CynergyTV and see our winning solution which mashed up a working silverlight app + silverlight gadget + silverlight / virtual earth mashup + media center.

and for further bragging, here's me Rick, Dmitry, Carson, and Dave at the Phizzpop LA party, thanks to Will Tschumy for posting the pics.

Posted by michaelwolf | Dec 31 2007, 01:45:49 AM EST

20071116 Friday November 16, 2007

Silverlight Twitter Badge

Like allot of the web, a couple of us at Cynergy got addicted to twitter a while back. Yet, the only blog badges they supply are Flash based. So I decided to attempt to see how silverlight 1.1 would do in this very common scenario. So I present to you the Twitter Silverlight (skinnable!) Badge.



Plus, I couldn't help but make a mix branded silverlight twitter badge to celebrate the mix 08 announcements.

Silverlight for web Gadgets/Badges: the good and the bad
While I show how some of this is done, let’s look at 2 sets of roadblocks. We all know Silverlight 1.1 is in Alpha, so there are still allot of things in flux. Some of these things I'm hoping stay and get expanded , others get fixed.

BAD
Silverlight 1.1 restricts access to any resource, aside from media, to the site of origin aka no cross domain access. This is very restricting in several ways. First the most obvious, you can't connect to any web service json / xml / rest outside of your host, without creating a bridged service. So there is currently no way to hit the twitter api, or any other api for that matter, without deploying some asp.net/php/java/ror code to your web server. To solve this problem, for the Badge I just made up a simple http handler that did something like this (but obviously not this :) ).

       string content = string.Empty;
       string url = context.Request["url"].ToString();
       
       WebClient client = new WebClient();
       content = client.DownloadString(url);

       context.Response.ContentType = "text/xml";       
       context.Response.Write(content);        
Thus rewriting the twitter xml api as if it we're coming from our site. Simple enough, but obviously not something Johny can paste into his MySpace profile. Which leads us to the next complication of the cross domain issue. A silverlight 1.1 app must download the dll's which make up its meat from the same domain. So even if you got silverlight to hit a JavaScript proxy to then hit the api, I'm not sure you could get around the dll's being cross domain. So where as would normally drop in some javascript or an object tag for this kind of Badge/Gadget in flash or ajax, you know have to use an IFrame to embed the Silverlight Badge.
<IFRAME 
style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 0px; WIDTH: 200px; HEIGHT: 320px; BORDER-RIGHT-WIDTH: 0px" 
src="http://dotnet.cynergysystems.com/silverlight/twitter/Gadget.aspx?twitterid=mix08&version=mix" 
frameBorder="0" 
scrolling="no"
></IFRAME>
Most community sites will strip out iframes from content, for obvious security reasons. Thus limiting your potential audience to folks who can use your fancy new gadget. I'm fully expecting these cross domain issues to be sorted out before go time. Ideally we should be able to not only call Web services and content from trusted domains, but also the dll's and loose xaml.

Good!
Ok enough with the bad, let’s see some good. The way that the xaml is so separated from the logic of a user control is pretty sweet. It allows for very clean separation of concerns. Which then makes things like "skinning" pretty easy. So for example in the Twitter Badge, we can load in a skin based off of the version from the server.
	HttpWebRequest request = new BrowserHttpWebRequest(new Uri(string.Format("{0}Skins/{1}.xaml",AbsoluteUrl,version)));
	HttpWebResponse response = request.GetResponse();
	FrameworkElement element = this.InitializeFromXaml(new System.IO.StreamReader(response.GetResponseStream().FirefoxClean()).ReadToEnd());
	Root = element as Canvas;
This xaml could also be pulled from any place, database, webservice, seperate "skin" dll,even user input.

The designer of the skin needs only know what are the required object names and types. All they would need to do is open up the template in Blend, change the animations and over all experience, and Then pass it back to the producer of the gadget. They would just need to make the xaml available to the app, and Bada Bing new skin. This makes this process much cleaner, and opens up allot of possibilities.

Conclusion Silverlight 1.1 is shaping up to be a killer platform all around, not just for serious RIA work, but for the badge / gadget world.

Interested in using the badge or contributing a skin, give us a shout we'll see what we can do?

Posted by michaelwolf | Nov 16 2007, 05:24:00 AM EST

20071106 Tuesday November 06, 2007

Silverlight / WPF Ajaxworld Video

So I was pretty excited to see that the video that we had filmed about our AjaxWorld Demo , during our visit to Bldg. 20 for the WPF Lab, was posted up to Windowsclient.net. Yet I was sad to see that it had been posted as a plain old WMV, no silverlight version. So I figured I'd post one up myself. Using Expression Encoder, I created a silverlight player from their templates. Then opened it up in Blend, tweaked the xaml a bit, took out some bits, threw in our Cynergy Xaml, and in no time we have a media player. Couldn't have a video about WPF and Silverlight not be rendered with some xaml :).

Enjoy the video, it showcases a demo Kellen Styler and I did for AjaxWorld West 2007. The demo highlights one of the least talked about features of WPF/Silverlight, true reuse. The demo shows how you can not only share Xaml between WPF and Silverlight (in fact that same xaml is used in this player), but also a Business Layer that could be used in Silverlight / WPF / WCF / Asp.Net / WinForms / Windows Services etc. Plus thanks to Kellen's handy work its pretty easy on the eyes.

Thanks to karsten for the interview.

Posted by michaelwolf | Nov 06 2007, 03:36:48 AM EST

20071105 Monday November 05, 2007

Silverlight, no routed events... no problem.

One of the things I miss in Silverlight which we have in WPF is routed events and routed commands. Language features, are a funny thing... when you first encounter them, you think do I need this? Then once you use them you can't imagine developing without them. This is the classic silverlight story. As a .net developer we come to love the framework and all it has, but the simple physics of fitting all the power of full blown 3.5 framework in the size of the agclr(4.5mb)... is like fitting a hummer into a space designed for a smart car. Just won’t fit. So we lose stuff, like routed commands and events. Which sadly means the ability for 1 element to bubble an event up or down the visual tree becomes allot more complicated. You’re left with just standard .net events.

While working on some silverlight projects, this became pretty frustrating to build out custom controls which can act independently but work seamlessly together.

Yet due to the power for that same trimmed down framework, nothing stops us from making our own event model to help us along. So I created a silverlight message bus, somewhat modeled on how we deal with events in our Flex projects. The Bus allows you to publish and subscribe to events, without having to be aware of the objects who fired or are subscribed to them. To highlight its use I created a simple game, well because everyone loves a game (especially a simple one written in silverlight 1.1 alpha using ms blend/ ms design / and orcas beta 2).

screenshot
running example: Launch in new window

try not to laugh at the animations or my little xaml duckies, look to Rick to wow you with silverlight ux stuff soon.

Basic idea, is that each duck can publish out an event that it was hit. The individual ducks are not aware of each other. So when you click on a duck we can fire an event to the other ducks and the main canvas, telling them there was a hit.

EventDispatcher.Publish(this, new CynergyEventArgs("Hit", this));
Then the page and each duck gets a message telling them there was a hit. In this case, the ducks then will do their little flip.
...
EventDispatcher.Subscribe(FlipOut);
...
[Action("Hit")]
private void FlipOut(object sender, CynergyEventArgs e)
{
OthersHit.Begin();
}
...
Now the page or the duck doesnt have to know that the hit was caused by a duck, or a dog or any object in particular. It just needs to listen for a hit event to be published through the bus.

The bus it's self is very lightweight and very simple, based on a simple pub / sub pattern, which keeps track of all the subscribed delegates and keys. The addition of linq into the 3.5 framework makes this a breeze. In the following snippet "events" is a generic List<> of events and "e" is the specific event to be fired.
...
IEnumerable results = from ev in events where ev.Action.Equals(e.Action) select ev.Handler;

foreach (CynergyEventHandler d in results)
{
   d.Invoke(sender, e);
}
...
It’s really helped me simplify the process of making lots of different objects all talk to one another. The cool thing about this method is, it’s not just silverlight specific. I didn’t just recreate routed events/commands , I’ll wait for msft to do that... this is just yet another way to skin the event cat. So becuase of that you can, and I do :), take the exact same code recompile it against the full clr and work with in a wpf application with no changes. Silverlight and WPF really do allow true write once run anywhere... but thats a story for another blog post.

Posted by michaelwolf | Nov 05 2007, 11:13:51 AM EST

20071104 Sunday November 04, 2007

First Post

Obligatory first post! Allow me to introduce myself (insert soundtrack here). My name is Michael Wolf, and I work with in the WPF and Silverlight practice here at Cynergy. We’ve been real busy here and I have been chomping at the bit to share stuff, so this will be my place to get it out there. Over the coming weeks and months my goals is to help contribute to the growing dialogue around WPF and Silverlight. It’s going to be a fun ride.

Posted by michaelwolf | Nov 04 2007, 10:58:07 PM EST
XML