Saturday, March 31, 2007

VSLive, Day 4, .NET 3.0 & ASP.NET 2.0

More WPF today and a little bit on ASP.NET

WPF Keynote:

WPF = The best of the Web + The best of the desktop

Powerfull Graphics:

  • Scalable
  • Persisted, you draw something once and it stays on the screen.
  • 2D
  • 3D
  • Media
  • Animation

Next Generation Reading:

  • Pagination
  • Columnization (automatically and dynamically layout for best reader experience, seen new york time, seattle ...)
  • Cleartype
  • Rich content integration

Rich UI Framework

  • Databinding, but not the way we know it from pre-WPF times
  • Layout, trough panels
  • Controls, set of basic controls is available (free grid from XCeed)
  • Templates, The controls don't know what they look like, but ask the parent instead. If nothing specified then a default is being used.

Demo "Allscripts Patient Monitoring" shows WPF in Full power. It can be found at the PDC2005 page of Rob Relyea

"Power of Design, use design for better User Experience."

WPF is targetted to be used by 3 roles:

  • Developer
  • Designer
  • Integrator


What can be animated:

  • Size
  • Position
  • Rotation
  • Color
  • ...

Why do you need animation? Animation fits the way the Human Brain works!

What technology should be chosen?

  • HTML: Online browser based, multiplatform, simple UI
  • WPF/e: Online browser based, multiplatform, (Flash alike) (small download, like Flash, targetted around 2 MB or so)
  • WPF in browser: Online browser, single platform, 3D etc. (requires .NET 3.0)
  • WPF locally: Installed locally with or without online capbilities (requires .NET 3.0)
  • Microsoft Blend (designer for XAML) visual design tool for designing UI.

WPF Examples WPF Application Portofolio

Datatemplate is a piece of XAML (segments) that describes how te represent the data. Switching at runtime of datatemplate is possible!!!

Demo cancer application:

Demo (from Microsoft site):
ExpenseIT, WPF/e demo, extension is .xbap

Evolution Media Center

UniveRSS A cool Reader!

Best reference book at the moment:
WPF Unleashed

Windows forms is at it's end-of-life. It will not being taken very further more.
WPF is in the early stages and will be primarly focussed by Microsoft to improve.

On BIG teams a dedicated developer for creating designs.

Some answers to questions from the audience:

  • XNA for gaming.
  • Deploying WPF is simple, the problem is the integrated video card.
  • XPS is killer for PDF.


ASP.Live track: Building a Custom Membership and Role Provider

It's posible to use all the standard ASP.NET controls for login, loginstatus and so forth by implementing your own Custom Membership Provider. By also implementing a Custom Role Provider even the ASP.NET Web Site Administration tool works for managing users and roles.

By default ASPNET.MDF contains the user info. However what to do if you already have a database with user and/or role info. The following figure shows that the Proider Model allows you to replace an existing default provider with your own one in order to accomplish this:

Source: Building a Custom Membership and Role Provider, presented by Chris Franz at VSLive

Override every single method. The following methods are most important:

  • ValidateUser
  • CheckPassword
  • GetUser
  • CreateUser

All "MemberShip Provider Properties" must be overriden.

What about Password protection:

  • Hashed is most secure, other options are Encrypted or Clear.
  • Use Password SALT (this attaches a known string to the password, before encryption and therefore increasing the password length to a fixed length)
  • It requires a Machine Key within the Web.Config. This can not be autogenerated, because of webfarms where each machine needs the same key ...

4GuysFromRolla has a very good book about customizing the Membership with additional information for the user (like address, telephone, ...)

Role Provider Properties and Methods needs to be implemented (more needs to be implemented as with Membership Provider, but not all)

Web.config can exists per directory!

Microsoft provides an example provider: Introduction to the Provider Model on MSDN

Writing a Custom Membership Provider for the Login Control in ASP.NET 2.0, by Dina Fleet Berry


Plain Old Windows Forms tricks:

The tricks being presented by
Billy Hollis were:

  • Tooltips containing custom drawing including images
  • Implementing dynamic resizing without 1 line of code, by using the TableLayoutPanel and FlowLayoutPanel
  • Oval buttons
  • A tutorial form within a grid, trough the controls collection that every control (including grid) has.
  • Field-level security with one line of code.
  • Checking for unsaved data with 2 lines of code, through the DirtyChecker

All examples and sheets will be made available trough

No comments: