Page view counter

April 2008 - Posts

Solving Cross Domain Issues - Tim To the Rescue

TimI received an email today asking that I post a reference to Tim Heuer's excellent blog entry on Silverlight Cross Domain Policy File Helpers. My hope is that you are all subscribed to Tim's blog as it is excellent and he and I now share the job that is officially referred to as "Developer Community Liaison for Silverlight" (or something like that).

Tim's blog entries are great, and he and I will be co-authors on Programming Silverlight (O'Reilly).  He'll also be "specializing" in Line of Business questions as well as Silverlight Serialization, Network Issues and Web/Web Services issues.

  Oh! Don't forget to check out his podcasts!

Slides and Code from Presentation in Atlantic City

[The links have been fixed. Thank you for your patience, and I apologize for the inconvenience.] 

 I very much enjoyed my double presentation at the Microsoft Health and Life Sciences Conference in Atlantic City,

AtlanticCity

where I promised, as always, to post my slides and source code.

During the first session we covered adding controls to a form and events and event bubbling; here is the source code.

During the second session we did not cover all the material we hoped to. We did cover data binding in some detail, and here is the starter code and the completed application.

You may want to check the following videos and tutorials to supplement the presentation:

NB: I have videos coming in the next couple weeks on Styles and Templates as well

Thanks again,

User Controls: Tutorial Available

A quick announcement and some words of thanks. I'm pleased to say that Tutorial #5: Keyboard Input and User Controls is now available for reading on line or as a PDF.

UserControl

The thanks go first to Karen Corby whose amazing presentation at Mix I shamelessly stole as the basis for the tutorial (see my blog entry about Karen) and to Silverlight Cream for such a glowing review that my ego can not resist reproducing it here

Jesse Liberty posted this amazing Tutorial on User Controls ... it's like a treatise or something... wow... download the PDF and code and then run away somewhere for a weekend and try to absorb everything in this tutorial, and then I tell you... good luck! ... great material as usual

Reviews in Perspective

Which leads me to a quick story about writing. Shortly after I wrote my first book (Teach Yourself C++ In 21 Days) I received two emails. The first said

I have read 5 books on C++, and I always get stuck on pointers. Yours is  the first one I understand... 

The second said,

I don't know what it is you do for a living, but it isn't programming or writing, because you are incompetent at both.

  I hung them both up on my wall.

How do you know INotifyPropertyChanged is Working

Today I had the great enjoyment to make two presentations to the Microsoft Health and Life Sciences Conference here in Atlantic City.

While showing DataBinding, I became interested in demonstrating the effects of INotifyPropertyChanged, The basic mechanism is this; you add a PropertyChangedEventHandler to your business object and each time you set a bound property you invoke that event, passing in a reference to the business object and an instance of PropertyChangedEventArgs initialized with the name of the property

PropertyChanged

The bound Silverlight controls will respond to this event and update themselves to the new value. But how to test this?

We tried making a new browser, but no go; we suspected (correctly) that the UI was pointing to two different objects. I proved this to myself by modifying the constructor to generate a random number and store it in a member variable, which I display.

AddedID

 

When you attempt to create two views on the data (by hitting control N on the browser or by copying the URL to a new tab) you generate a new object as you can see by the new ID.

 

SideBySide

 

To ensure that we're seeing the UI update in response to changes to the same object, it is easiest to just add two new rows, one that shows the value of IsPublished and the other that shows Quantity on Hand. When you change the original, the duplicate should be informed through the event.

ReflectionOfBinding

 

We can now run the program again and when we change the isPublished or QuantityOnHand properties, we should see that immediately reflected in the second control. Turn off the notification and the reflection should stop.

 

ReflectedBindingRunning

Posted by jesseliberty | 5 comment(s)
Filed under:

What is coming in the next few weeks?

A couple readers of my blog and folks eager to learn more about Silverlight 2 have written to me asking for 2 things:

1. Tutorials and Videos on the specific topics of interest to them (great, keep 'em coming) and

2. Greater transparency in my schedule of what I'll be releasing

Normally, I don't like to say "I'll be taping, or writing about this subject or that, because the schedule inevitably changes; for any number of reasons: other things rise on the priority list, something is about to change in the way it works so I decide to wait, someone else is about to cover that topic, etc. etc.

All of that said, since I've been asked, here is my tentative list of what I hope to release in the upcoming weeks

Tutorials

  • Keyboard input events on controls
  • User controls
  • Expression Blend for Silverlight Programmers

HDI Videos

  • Creating Controls Dyanmically (in code vs. XAML)
  • Styles
  • Templates
  • Keyboard input events
  • Creating User Controls
  • Expression Blend For Silverlight Programmers
  • Recreating ScottGu's tutorial on Blend as a video

I'll probably add some, and I can't guarantee the order, but that is the plan, at least right now.  My hope is to turn these out quickly to provide a good base of material.

Thanks for your patience and support.

 

-jesse

Binding Data How Do I Video Posted

I'm pleased to say that we've posted a new How Do I Video on Binding Data to Silverlight 2 Controls.

In the very beginning of this video I say it is about "wiring up events" but I'm confused and befuddled -- it is, of course, about binding UI objects to business objects. This is clarified quickly and there is no confusion once we get past the first few moments.

Update Saturday 4/19.  This video was not encoded properly. We've re-encoded it, and I took the opportunity to fix the beginning of the video and eliminate the confusion. The video should be up and correct no later than Monday or Tuesday in all formats. I very much appreciate your patience.

Posted by jesseliberty | 8 comment(s)
Filed under:

Podcast Part 2 Posted

Sparkling 

On April 9, I posted a link to my first interview on Sparkling Client. Today I'm happy to post a link to the second and final part of the interview.  Also, be sure to catch their terrific interview with Dave Campbell (Silverlight Cream).

 

 

Organizing Lots of Information

A very smart and frequent participant here wrote in today and said (paraphrasing)

 

...Why do you  organize the Learn section around type (video, quickstart, tutorial) instead of topic/task (data binding, layout, browser integration)?

Today I had a Data Binding question...I remember seeing what I wanted on Silverlight.net but not where. I looked at quick starts, then videos and finally found it in tutorials. Doesn't it make sense to have everything about Data Binding together?

Great question!  I have three parts to my answer at least:

1. We are going to be reorganizing this site in the coming months to make it more useful; that is certain. What I'm about to write, though, has nothing to do with that process.

2. What is useful for one person is not always useful for everyone else, and one reasonably difficult thing to agree on is categorization, though you wouldn't think so.

A quick social psych experiment: next time you are a party, ask someone to empty their pockets and to separate the contents into six logical piles. Refuse to provide further guidance.  Once they are done, ask them to explain their piles.  You'll find over time that everyone can do it, that everyone can explain in some detail why these are the logical mutually exclusive piles, but that everyone's criteria are different.

3. I have not discussed what I'm about to say with anyone else, nor am I sure that this way of organizing our tutorials and videos would be useful to anyone but me, but I did enjoy losing an hour thinking about it.

If I were using this site; I'd like total control of how I access the learning material. I'd want to be able to find the material by topic, by type or even by who created it. But I would want all these "boxes" to be transparent.  

I want to know what is in them before I open them, to minimize hunting around, and I want to be sure that whichever path I take I can always change my mind.

 

Step1

 

 

In this truly geeked out approach, I'm asked to choose if I want to see the available information by Topic, by Medium or by Presenter, but I don't have to guess what is under each of these choices.

Let's assume that I prefer the presentations by that incredibly talented chap Liberty, and so I click on his name. This opens up the sub-menu that displays the contributions he has made, but once again I can choose to see it organized by topic or by medium (of course, just the subset he created)

SubMenu

 

Clicking on his videos presents me with the topics he has videos on, and clicking on a topic presents a list of his videos on that topic.  Not bad.  Not perfect, but not bad.

Organization

 

But...

Where do I look if I want all the information available on using animation to display data?  

How do I find out what has been added since the last time I was here, since I've already seen everything that was available?

It would be nice to have a search... but open ended searches can be incredibly frustrating when you are searching through  a relatively small set of data. Guided searches might be better. Something like the Outlook or iTunes Search comes to mind. 

Search

 

In any case, please remember that these are the random ramblings of an idle mind, and have not even been discussed with anyone else, let alone planned for this or any other site. They are just how I think about finding all the info here. Today. For the moment.

 

Your mileage may vary. Void where prohibited. Contents are hot.

Webcast: Event Handling

Today's Webcast was intended to be a smooth presentation of a topic I know cold. Not uncharacteristically,  I went off on a tangent from which I never returned and ended up writing all my code spontaneously.

EventsWebCast

The good news was it was "fresher" the bad news was a few false starts; fortunately I was talking to pros who were very patient, and the key points were made:

  • You can set the container as the event handler for the contained objects (e.g., the stack panel can receive the click event for all the radio buttons
  • Some events bubble and some do not, and it is important to understand which do and which do not and what will happen accordingly
  • The rule of thumb is that events associated with a control (e.g, click) do not bubble but most events associated with mouse and keyboard do bubble; it's best to check the documentation.

The source code for the initial demo using radio buttons can be downloaded here and the source code for the two buttons can be downloaded here.

A complete walk-through of this idea is also covered in  Part 2 of my video on event handling which also has code available for downloading.

Thanks again for hanging in with me, and I have no idea what Microsoft does to me for running so far over-time. I'm sure I'll get a letter.

Tip of the Day Microblog Launches Today

As of today, I will attempt to add a brief Tip of the Day to the Silverlight Microblog every day.

If you would like to contribute (and I hope you will) please send your tips following the directions listed here.

Thanks!

 

-jesse

Small Software - Big Impact

First, a quick note that I'm rapidly posting tutorials and videos and as soon as they are through our production process, I'll turn my blog to announcing them and expanding upon them.

I do want, however, to mention one of my favorite utilities, Hypersnap which I've used for about the past 7 years to capture and annotate all of the images in my books, articles, tutorials and blog entries.

HyperSnap

It is an extraordinary utility with amazing capabilities, but the story I want to tell you is about customer service.  I wrote the following to customer service yesterday (abridged...)

...The one feature that makes me crazy  is the need to go through so many steps to switch between the two modes I use most often:

· Don’t capture cursor, set delay to 200ms
· Capture cursor, set delay to 4 seconds

It would be great to be able to....

62 minutes later I got back a message from Greg Kochaniak that said in part,

Hi Jesse,...I added a “hidden” command.... find “Include Cursor With Time Delay” – drag it and drop on the top main toolbar of HyperSnap... and you’ll have a one button click to enable cursor capture with extra 4 seconds delay, or disable it and no delay... I’ll leave this command there for future releases.

(The image above has the new button circled in red, taken of course in Hypersnap, by using that button!)

You just don't see customer service like that every day.  I have no connection to this company, but they do make a great shareware product. Every few months I'll mention some others, but here's a quick list of my current favorites:

  • Roboform - For IE. I don't know how anyone lives without this. Fill in your information and it fills forms for you. Can be password protected. Remembers login and password info for sites you visit, can provide password generation.
  • Exam Diff Pro - best software I know for examining differences in files and directories. Incredibly easy to use, to customize and very reliable.
  • Instant C# / Instant VB (Full Disclosure: They gave me an evaluation copy) I am blown away by how well this product works. Put in a fairly complex program in one language and in seconds you have a fully converted program. Highly recommended if you need and can afford it.
  • RegexBuddy - If you are creating regular expressions, nothing comes close to this utility for getting it right, fast and painless. $29.

.

Silverlight Gems

One of the reasons I took my job was the amazing people I met during my interview. It turns out, however, that the place is crawling with talent; it doesn't seem likely that an organization that large would not have regressed to the mean yet, but the dev-div continues to astound me.

I'd like to start pointing out some of the people who, I speculate, will have a lot to offer the Silverlight Developer community. These will be random "sightings" as I go, of folks who are actively presenting information to the community but who you may not yet have run across,  but who you want to watch for.

 

Karen Corby came to the attention of a lot of folks with her brilliant presentation at Mix,

KarenCorbyMix

It turns out she has a great blog where you will find some terrific information on a variety of topics ranging from the Silverlight HTTP Networking Stack to  her amazing photographs, to creating a FickrViewer app that nicely demonstrates the use of Styles, Templates, User Controls, Custom Controls and that also provides, ready for you to download, a Horizontal Wrap Panel, and Continuing Progress control and a Modal Dialog!

I met Karen when I was out in Redmond; and everyone I know who has met her agrees: "Amazingly  high signal to noise ratio combined with extremely high bit rate."  Plus she is very kind to strangers; she made a lot of time for Tim and me, and was an enormous help in our understanding the evolving Control/Template model.

Sparkling Client Podcasts On Silverlight

SparklingI'm pleased and proud to say that my first Sparkling Client interview is now available for download; and this gives me the opportunity to recommend subscribing to this excellent new podcast.

Sparkling Client focuses exclusively on Silverlight and related technologies. The first couple broadcasts show some growing pains, but the later interviews are excellent (check out the interview with Adam Kinney!)

New Look - Same Blog

Don't panic! It's the same blog; I just changed the look to make it easier to use and easier to read. Hope you like it.

 Stay tuned for lots of videos and tutorials over the next fortnight.

 -j

Tutorial: Data From a SQL DB via WCF (using LINQ)

My 4th tutorial Displaying SQL Database Data in a DataGrid using LINQ and WCF is now available, as is the source code and a version of the tutorial in PDF

For the moment, I recommend the PDF version as the images are clearer. We're fixing up the HTML versions of all the tutorials even as I write this.

LinqSQL

This tutorial walks through

  • Creating a LINQ query against your SQL Server database
  • Creating a WCF service to provide access to the results of your LINQ query
  • Binding Silverlight 2 controls against the WCF service

We will, over time have a way to provide direct feedback for each tutorial, but for now, please do send email or use the forums to ask questions about anything you read in the tutorials.

Thanks again,

 

-jese

Posted by jesseliberty | 17 comment(s)
Filed under:
Next