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

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: