Vincent Leung .NET Tech Clips

The latest tech clips from the .NET community

Skinning and Styling Silverlight Controls

 

To change a look of Silverlight controls the way that you want it to, you can style it by modifying default template of the control. Silverlight controls have XAML based templates that can easily be changed and saved as new template. You can change the look for entire control without writing any line of code in C#. It can be done completely in XAML. However if you want to do minor modifications to the look of control such as change background color or default font you can do it directly in XAML without need to change default template of the control.

For example we can simple change foreground color of text for TabItem control by setting foreground property directly in XAML of that control without need for changing template for that control :

<my:TabItem Header="Buy or earn chips" Foreground="#FF6A1D38">    <Grid>    </Grid></my:TabItem>

This article will show you how to build custom template for Silverlight 3 TabControl.

Easiest way to modify default template for control is to that in Expression Blend. In Expression Blend menus called Objects and Timeline locate your control for witch you want to modify template, right click on it and choose Edit Template –> Edit a Copy . After that Expression Blend will ask you where to save copy of template in UserControl.Resources or in Application.Resources. For this example I will save all templates in Application.Resources in App.xaml file.

EditTemplate

After that you will get a copy of template for TabControl. In this case we have few objects in the template: TemplateTop, TemplateBottom, TemplateLeft, TemplateRight. The objects in the template that are referenced by the code are called parts. We can view the parts in the Parts panel when you are editing a control template in Expression Blend.

TemplatePart

Via Skinning and Styling Silverlight Controls

November 10, 2009 Posted by Vincent Leung | Expression Blend, Silverlight | | 1 Comment

Microsoft SDK for Facebook Platform – Official Support by Microsoft & Facebook

Official support from Facebook & Microsoft: the Microsoft SDK for Facebook Platform.

Overview

To get started we recommend you download the SDK and refer to the "How to" guides and the Facebook Developer Wiki to get familiar with these new resources.

  1. Download the SDK.
  2. Refer to the detailed instructions on the Facebook Developer Wiki. Here are some important links to use as a starting point.

Facebook SDK Version 3.0 Notes

ASP.NET Development
ToolKit Content Folder
Facebook Platform
Other Platforms

 

November 10, 2009 Posted by Vincent Leung | Facebook | | No Comments Yet

What is the Windows Azure Platform?

 

There are various types of Cloud offerings that exist in the internet today. These offerings are Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). Figure 1 below shows each of these offerings and what they host. Understanding what each offering hosts, the relationship of the cloud vendor to the software owner, and the relationship of the cloud vendor to the end user is a good way to understand the differences between each of these offerings.

Figure 1 – Types of Cloud Offerings and what they host

image

Figure 2 – IaaS Vendors

image

Figure 3 – PaaS Vendors

image

Figure 4 – SaaS Vendors

What is a Software Platform?

When the word “Platform” is used in the context of software what is really meant is what is shown in Figure 5. The best way to visualize a software platform is to think of it as being composed of two parts. The first part is a runtime environment for your application or your custom code. The second part is a collection of tools that can be purchased (as opposed to built) that solve common problems.

Figure 5 – A Software Platform

Via What is the Windows Azure Platform?

November 10, 2009 Posted by Vincent Leung | Architecture, Azure | | No Comments Yet

The Top 10 Most Common API Pitfalls

 

A robust application programming interface (API) has become essential for today’s successful SaaS independent software vendors (ISVs). As a SaaS vendor, you should expect that a majority of your customers are going to require interoperability with other SaaS applications, web services, and legacy systems. As demonstrated by internet pioneers Google, Amazon, and Facebook, an open application strategy facilitates deeper customer usage and enables new revenue streams. Integration is critical for SaaS vendors, and developing a reliable API strategy is the first step toward achieving that goal.

After reviewing hundreds of actual SaaS APIs, many up to par and others distinctly subpar, it is clear that there are a number of common mistakes made when developing an API. Fortunately, each of them can be easily remedied by following best practices.

1. Exposing operations instead of objects

2. Assuming a WSDL contains everything necessary to describe your API

3. Developing a single version of your API which changes with each release of your SaaS application

4. Never batching or throttling the results of query calls against your API

5. Maintaining separate schemas for adding, updating, or removing your Customer object

… + more … The Top 10 Most Common API Pitfalls

November 10, 2009 Posted by Vincent Leung | Architecture | | No Comments Yet