A Chrome and Glass Theme

image  image

  1. In part 1 we covered creating style resources in a resource dictionary.
  2. In part 2 we covered editing control templates as part of a style, including states.
  3. In part 3 we knocked off a couple of the easier controls to style, although we added some extra elements to the control template.
  4. In part 4 we are going to dig down into a control that is made up of a collection of other controls: the ListBox. But we are going to begin by styling the other controls that make up the ListBox.

jLight – Interop between Silverlight and JS based on jQuery

 

Interop between Silverlight and the javascript based on jQuery. The syntax used in Silverlight is as close as posible to the jQuery syntax.

Examles of regular jQuery expressions:
jQuery:

    jQuery("span:last").offset({left : 10, top : 100}); 
    jQuery("div").css("border","3px solid red");

   jLight in Silvelight:

    jQuery.Select("span:last").Offset(new {left = 10, top = 100 }); 
    jQuery.Select("div").Css("border","3px solid red");

   But, with jLight you can interop between C# and javascipt. The code below runs thru each textbox and adds its value to a textbox.

    jQuery.Select("input:text").Each((a, b) =>
                    {
                        textBox1.Text += jQueryObject.FromObject(a).Val();
                        return false;
                    });

Via jLight

When do I get charged for compute hours on Windows Azure?

Windows Azure Pricing
image
Nothing deployed = NO charge
Deployed and running and being used = charge
Deployed and running but no one is using it = charge
Deployed but Stopped/Suspended = charge

The system use with Azure is similar to hotel reservations. If you book a room, you get charged whether you sleep in it or not – as the hotel reserved the room for you and could not use it for another guest.
With Azure they actually reserve the physical resources for you (CPU, memory etc) as soon as you deploy. Hence they pass on the costs of those resources. This model can make Azure an expensive choice for small, rarely busy sites, for which a shared hoster model is likely much more appropriate. Azure currently is simply not intended to compete with the shared hosting model.

 

Windows Azure Pricing

  • Compute = $0.12 / hour
  • Storage = $0.15 / GB stored / month
  • Storage transactions = $0.01 / 10K
  • Data transfers = $0.10 in / $0.15 out / GB – ($0.30 in / $0.45 out / GB in Asia)*
Measuring Windows Azure Consumption
  • Compute time, measured in service hours: Windows Azure compute hours are charged only for when your application is deployed. When developing and testing your application, developers will want to remove the compute instances that are not being used to minimize compute hour billing. Partial compute hours are billed as full hours.
  • Storage, measured in GB: Storage is metered in units of average daily amount of data stored (in GB) over a monthly period. For example, if a user uploaded 30GB of data and stored it on Windows Azure for a day, her monthly billed storage would be 1 GB. If the same user uploaded 30GB of data and stored it on Windows Azure for an entire billing period, her monthly billed storage would be 30GB. Storage is also metered in terms of storage transactions used to add, update, read and delete storage data. These are billed at a rate of $0.01 for 10,000 (10k) transaction requests
  • Data transfers measured in GB (transmissions to and from the Windows Azure datacenter): Data transfers are charged based on the total amount of data going in and out of the Azure services via the internet in a given 30-day period. Data transfers within a sub region are free.
  • Transactions, measured as application requests.

To get started: http://www.microsoft.com/windowsazure/offers/

MEF Programming Guide with Silverlight-specific functionality

MEF Programming Guide

  1. Hosting MEF in an application
  2. Defining Parts and Contracts
  3. Declaring Exports
  4. Declaring Imports
  5. Lazy Imports
  6. Exports and Metadata
  7. Using Catalogs
  8. Filtered Catalogs
  9. Part Lifetime
  10. Recomposition
  11. Querying the Composition Container
  12. Composition Batch
  13. Debugging and Diagnostics
  14. FAQ

Silverlight-specific functionality

  1. Hosting MEF in Silverlight using CompositionInitializer
  2. Overriding the default host configuration
  3. Dynamic Instantiation and ExportFactory<T>
  4. Application partitioning with DeploymentCatalog

Also MEF Programming Guide – pdf

Learning MEF in Silverlight 4 and .NET 4

MEF has shipped with Silverlight 4 and with .NET Framework 4.0 and there are versions on CodePlex targeting Silverlight 3 and .NET Framework V3.5 Sp1.

If you’re looking to get started with MEF then here’s some quick resources;

  1. Glenn Block’s new MSDN Magazine Overview Article and Glenn’s Blog
  2. The Overview on CodePlex
  3. The Programming Guide on CodePlex
  4. Mike Taulty’s Channel 9 Videos

but if you’re already up and running then want to know what’s new in the latest drop for the Silverlight developer?

  1. Updated samples!
  2. Renaming and changes to PartInitializer
  3. Renaming and moving of PartCreator
  4. Renaming and changes to CompositionHost.InitializeContainer
  5. A new DeploymentCatalog class, suport dynamically asyn load XAP files on demand!!!

For more check this out: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/02/17/new-mef-drop-preview-9-on-codeplex.aspx

 

Using WCF RIA Services in Windows Phone 7

Unfortunately, there is no “Rich Client Experience” built-in support for Windows Phone 7 in RIA Services V1.0

With that said, you can still enable a Windows Phone 7 application to communicate with a DomainService since Windows Phone 7 has support on talking to WCF Service and here is how…

A. Let get all the tools:

  1. Install the latest Silverlight Tools from here (contains RIAServices, SL4 Sdk, SL4 Runtime etc)
  2. Install the RIA Services March 2009 Toolkit from here
  3. Install the Mobile Tools CTP from here

B. Create a new DomainService on server-side

C. Expose WCF endpoints: http://blogs.msdn.com/brada/archive/2010/03/29/silverlight-4-ria-services-ready-for-business-exposing-wcf-wsdl-services.aspx

D. Consume the WCF endpoints. http://blogs.msdn.com/deepm/archive/2010/03/17/configuring-your-domainservice-for-a-windows-phone-application.aspx . An example explains how you can do CRUD operation with the SOAP endpoint of a DomainService. You can find it here.

 

Ten Cool Features in Visual Studio 2010

1. Pinning variables when debugging

image

2. Box selection

image

Brittany Behrens from the Visual Studio Editor Team has an excellent 3 minute video that shows off a few cool VS 2010 multi-line code editing scenarios with box selection

3. On-the-fly search

When pressing Crtl and , (comma) the new Navigate To window appears. This is a real-time search window offering basically the same functionality as the Find and Replace window (opened by Crtl + Shift + F) but doing it on-the fly

4. Zooming

image

5. View call hierarchy

image

6. Sequence diagrams

image

7. Dependency graphs

image

8. IntelliTrace and dump debugging

9. Multi-monitor support

Click on the document tab or tool window and drag outside the IDE to any location on any monitor.

image

10. Intellisense improvements

a. When selecting any variable, all instances of it are highlighted

b. Search is not limited to prefixes

Via http://www.scottlogic.co.uk/blog/gergely/2010/04/ten-cool-things-you-didnt-know-about-visual-studio-2010/