A Simple Way to Make a Custom WPF Message Box

custommessageboxheaderimage

Overview

In my last piece (“A Simple Way to Make a WPF Chromeless Window”) I demonstrated how one could easily create a chromeless window using Microsoft’s “Windows Foundation Framework”, more commonly known as WPF.  This time around I will show you how to make a customized WPF message box.

The reason for this is that the WPF default message box uses the same chrome that the default WPF window does.  As a result, if you are going to develop a custom window you will also have to do the same with your message boxes or the contrasts between the two will not look symmetrical.

And being deficient in the graphic arts like many software engineers I found this out the hard way when my own commercial product was well reviewed except for the interface.  Hence, my recent work to refine the interface to something much more aesthetically pleasing.

Limitations With Your Own Message Box We Can Work With

The first thing to realize is that developing your own message box will constrain you to a certain extent as to what you can provide with it as the default WPF message box comes with a number of configurable options that you can select to produce certain results.  The only problem is that you cannot change how the default message box is displayed since it is reliant on the Win API.

Essentially, a message box will request a user to do one of two things, read the provided information and move on, or ask a questions, which is in practically all cases a “yes” or “no” question.

Luckily, with the WPF modal dialogue, which is the type of window we will use for our message box, we can easily return a “true” or “false” value allowing us to handle the second scenario noted previously.

Read more of this post

2010: The Deconstruction…

2010 - The Deconstruction

Initial notes…

The following piece is a sociological analysis of the state of professional software development today. As one who is not just a senior software engineer but a military historian\analyst as well, I have brought together the skills of both these areas of expertise to demonstrate to the technical community at large that what is happening to our profession has nothing to do with innovation or new opportunities in application development but instead is an ongoing process of terrible, deleterious, degradation that has professionals everywhere concentrating on abstract concepts, useless paradigms, and redundantly, new tool introductions without any analysis as to the benefit of their application to the development of new applications. In fact, little has been reported on the success (or failure) of application development itself, as this aspect of reporting has been pushed aside for the less relevant aspects of our profession. Is it not the final product that is important and not what makes it?

The negative results of this process are staggering and are not simply the result of a software profession overwhelmed by marketing hype and vendor misdirection both supported by an avalanche of “me too” groups of young professionals trying to insert their own ideas but is as much also a symptom of what is happening to societies in general.

To understand that this deterioration is not isolated to our profession alone, one should take a look at the article at Russia Insider at

http://russia-insider.com/en/military/epic-fail-heres-why-most-us-weapons-systems-are-worse-russias/ri11097. The article is written by a US military analyst and provides some in-depth details as to the state of the US Armed Forces and intelligence agencies. You will also find some of my own historical notes in the comments section below it.

To add to this, one may also want to see John Oliver’s piece on the state of US nuclear arsenals, which is both hilarious and terrifying at the same time (https://www.youtube.com/watch?v=1Y1ya-yF35g). Much of what Oliver reports has already been reported in the mainstream news outlets.

Cognizant functionality in life today is quickly deteriorating in all areas of industrialized societies into nothing but a cacophony of gibberish and nonsense, not to mention the terrible social and political traumas being afflicted on citizens across the globe along with horrific conflicts and their affects. The software development profession has not been immune to these trends…

Read more of this post

Best Text Editor Component for .NET WPF Developers

AvalonEdit

Overview of The Solutions Available…

For those software professionals creating desktop applications for distribution and\or sale there situations where there is a requirement to present edited text to the user or allow the user of an application to enter text as they would source-code in one of the many current IDEs available.

Most often such applications would be directed at other technical professionals thus proving a need for a quality text-editor control that can be configured to the application’s requirements without having to develop one from scratch.

There are several options in this regard that are available to .NET WPF developers who need to incorporate such a component into their applications. One of the popular open-source components is “ScintillaNET”, which can be found in its most current form at https://github.com/jacobslusser/ScintillaNET

Read more of this post

Disciplined Application State for WPF

WPFApplicationState

In the last article a concept for implementing an organized technique for managing session and application state for an ASP.NET application was proposed.

The same can actually be done for a WPF application, though such global properties would be most likely be on the minimal side of things.  Nonetheless, there are times where having access to a property at application level can be quite convenient.

Read more of this post

Simple Page Navigation With WPF

Abstract WPF Simple Page Navigation Image

Navigating between pages in a WPF application is actually a very simple process, though made much more confusing both by the many articles that stress use of MVVM and the inference by others that this is much like navigating web-pages in an ASP.NET Internet application. As to the first, the use of MVVM, there is no requirement to use this design paradigm. However for those that like to follow such paradigms, there is no reason not to as it is quite a good one. For the second, that WPF page navigation is akin to web-page navigation, it is and it isn’t…

Read more of this post

%d bloggers like this: