Just added a MVVM pattern. Demo can be switched between UserControl and MVVM mode by using the startPage WebPart property. Use 'mvvm' for MVVM demo and 'uc' for UserControl demo:
Parts to register themselves for interaction with the bridge. If only Silverlight to Silverlight communication is required, local messaging could be used as an alternative mechanism, however this technique allows interaction from both Silverlight and ASP.Net
web parts which is more flexible for SharePoint applications. A Web Part using the base classes has the following properties required for JS Bridge connection:
* JSUniqueClientID - JSClientSourceID indicates to the JS Bridge the real ID of the component on the page. It is derived from the WebParts’s ClientID with an ‘SL’ suffix.
When a client Web Part loads, it registers itself with the JS Bridge using the registerClient method, this allows the bridge to locate the Web Part on the page and lets it know where to route data.
Writing to JS Bridge
When a client WebPart wants to send something, it calls the JS Bridge using the JSBridgeWrite method, which looks at the ClientID and multicasts the data to any WebPart with a corresponding ClientSourceID.