ASP.NET WebForms OAuth2 multi-tenant resource and WPF client

Most published WebAPI samples (e.g. http://msdn.microsoft.com/en-us/library/azure/dn646737.aspx) are based on the MVC and OWin infrastructure, which is not available in WebForms applications. Following is a custom implementation of an OAuth2 access token handler presented by a WPF rich client application. The WPF is responsible for managing the OAuth code grant flow to obtain the token and present…

0

Using WS-Federation with Windows Store and .NET rich clients

In general, rich client apps use OAuth flow to obtain authorization tokens to a web service. However, that flow may not be available from the authentication servers. In the following I am using an alternative approach: WS-Federation, well supported by ASP.NET web services. The solution consists of a web service, often used to provide REST…

0

WPF Data Binding error 2: Cannot find governing FrameworkElement…

I got this error when trying to bind to a collection element, which was not derived from the FrameworkElement (just DependencyObject) and was thus not inheriting it’s container’s DataContext, e.g. <Grid>   <Grid.DataContext>      <loc:MyViewModel />   </Grid.DataContext>   <igRibbon:XamRibbon Grid.Row=”0″ x:Name=”ribbon”>      <igRibbon:XamRibbon.ContextualTabGroups>         <igRibbon:ContextualTabGroup Key=”SelectionGroup” Caption=”Contextual Tabs” IsVisible=”{Binding IsContextualTabVisible}”>             <igRibbon:ContextualTabGroup.Tabs> I tried replaing the binding with ElementName=ribbon,Path=DataContext.IsContextualTabVisible but that…

0

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…

1

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…

17

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. PresentationAndDemos.zip

0

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…

3

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…

5

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

Karsten Januszewski and Jaime Rodriguez in The New Iteration (http://windowsclient.net/wpf/white-papers/thenewiteration.aspx) 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….

1