A Simple Way to Make a WPF Chromeless Window

wpfchromelesswindow

Introduction

Microsoft introduced the “Windows Presentation Foundation” or WPF to align desktop development with similar experiences developers have with developing web applications.  With the exception of possible a rather weak graphical interface for creating windows and pages, WPF for the most part offers desktop developers a quality foundation for delivering desktop and desktop-styled applications into production environments as well as multiple mobile platforms.

Like with web development that now has it’s interface and coding constructs more or less separated between HTML/CSS and client\server side coding (though the client side coding model is merely a throwback to “Classic ASP”), WPF provides a similar format.

In WPF you have both Window and Page objects similar to the original WinForms environment where one could have a Window and page-like controls whereby both can have Windows displaying Pages within them.

Unlike web development, Microsoft for some reason has chosen to make styling WPF Windows and Pages an utter nightmare for developers to wrap their heads around.  Though CSS, which can become awfully complex in the hands of a skilled web developer, CSS still retains a sense of simplicity that most web developers can attain skills with in order to make their web pages acceptable.

WPF on the other hand takes CSS simplicity and turns it on it’s head by implementing templates that provide base styling for every one of the WPF controls provided by either Microsoft or third-party vendors.  For many what would be considered minor styling options with CSS, WPF presents an array of complexity for developers that has many throwing up their hands in disgust.

One would think that having the need for a completely separate application from Visual Studio to design WPF styles in the Guise of “Blend”, such a process would have been made much easier.  And it would have been had the styling terminology used would have been turned into simplistic language that everyone could understand instead of the ambiguous terminology that has most turning to the Help systems for clarification.

Making a simple styling change such as the color of the selection highlighting in a WPF list-box could have one implementing the entirety of an updated list-box style template into a page, which is extremely verbose or finding a way to add styling resources to the same.  In either case, the research needed to find quality information on such processes can be quite extensive as there are really few quality manuals that deal with WPF styling in a simplistic and straightforward manner.

One of the things that many developers would like to be able to provide their clients and users are Windows without the ugly chrome that surrounds them that is similarly ever present with web browsers.  Interestingly enough, most developers are under the impression that to do this they require an expensive tool suite that provides for chromeless windows as well as advanced styling.

Admittedly, I was under the same impression and my own commercial product has suffered the same visual detriment that many have… until recently.  After doing a lot of research on the subject with the intent of avoiding an expenditure for a tool suite I did not believe justified I found enough information to put together such an interface finding it far easier than one would believe once I sifted through the various documents others had put up on technical sites.

Read more of this post

%d bloggers like this: