Silverlight and basic authentication

Silverlight client does not support TransportCredentialOnly to enable Basic authentication. Here is some code to add the basic authentication http header to a standard Silverlight WCF proxy:                 ServiceReference1.ServiceClient svc = new ServiceReference1.ServiceClient(); // binding, new EndpointAddress(“any.txt://”));            svc.GetDataUsingDataContractCompleted += (s, a) =>      […]

Custom line caps in WPF

The attached project contains a custom element (FrameworkElement-derived), which allows definition of line paths (straight lines, Bezier curves, etc.) with custom-defined line caps. The following graphic contains two lines: a straight line with an arrow and filled rectangle at either end, and an irregular path with a circle and and arrow. (Note that this is […]

Displaying hierarchical data in the DataGrid

The attached project shows how to display data which is both tabular and hierarchical in nature in the Silverlight (or WPF) DataGrid. Employee list is an example of such data, where each employee is described using the same set of data column but there is also a reporting relationship between employees and their managers (also […]

WPF and Silverlight working together presentation

I recently gave a presentation to a number of ISV regarding use of WPF and Silverlight 2 for developing applications that can be deployed to both the desktop and the web. The attached presention and demos show the main similarities and differences between the two frameworks and provide an example of a shared application.

Custom data and dynamic templates in WPF

This blog describes how TemplateSelector in WPF can be used to dynamically modify contents of the UI. This is particularly useful in a common scenario many ISV’s need to support: ability of 3rd parties and users to extend the ISV’s data model with their own data columns. For example, the original application may include a […]

Editable ListBox using template

WPF Templates are useful for defining common themes and styles. They can also be used to extend the functionality of controls. Following is an example of a ListBoxItem template, which makes individual items in a listbox in-place editable (provided the listbox contains strings only). To achieve this effect, the standard ListBoxItem template is modified as […]

A role-based approach to architecting WPF (and Silverlight 2?) applications

Karsten Januszewski and Jaime Rodriguez in The New Iteration ( point out the ability of WPF infrastructure (framework and tools) to allow for clear separation between the roles of designers and programmers. They also describe various development workflows this separation supports. I have been experimenting with an approach that separates the roles further and provides more detailed workflow definition. […]