About
Data Entry Samples Application
Coding
Further documentation
Build requirements
Structure WpfWindowsLib Solution
Project Status
Copyright
To support data entry on a Window, quite a bit of code is needed
to decide if any data has been changed, i.e. the save button should be
enabled and to check if all required data is entered. The controls in
WpfWindowsLib
detect themselves if there was a change and inform the window
automatically.
The project Samples
shows the various controls available and demonstrates
how the user will interact with them:
There are 3 columns. The first shows controls with no data, the second controls with no data, but the user has to fill in some data because they are required for saving (note the different background color) and the third column shows controls with some initial data.
The Save button gets only enabled once the user has entered some data for all required controls. If he tries to close the window before doing so, a warning message gets displayed. If everything is saved, but 1 control gets changed again, the same thing happens. The user needs to save before he can close the window.
A warning message shows him which data has changed and asks if he really wants to lose that change by closing or save it by clicking the Save button. This warning message can be surpressed by setting CheckedWindow.IsNoCheckOnCLosing = true.
To support automatic detection of changes and autoregistration to the host window, a
control can use IChecker
, which implements the ICheck
functionality. It
can then be placed in a Window inheriting from CheckedWindow
. The initial value and
setting IsRequired
is done from XAML or code behind:
RequiredDecimalTextBox.Initialise(1.23, isRequired: true);
The controls using IChecker
will automatically search for the parent
CheckedWindow
, register with it and inform it if their HasChanged
or
IsAvailable
property (true if the user has entered a value in a required control)
has changed. CheckedWindow
checks all other controls
and calls OnICheckChanged
or OnIsAvailableChanged
as needed.
For a more detailed documentation see: CodeProject: Base WPF Window Functionality for Data Entry
.Net Core 3.1 or later
The only library needed to be referenced from other code, providing
ICheck
, IChecker
and various WPF controls like TextBox or ComboBox
supporting ICheck.
WPF Core application showing all WpfWindowsLib Controls
WpfWindowsLib unit tests
Completed and stable
Copyright 2020 Jürg Peter Huber, Singapore.
Licensed under the Creative Commons 0 license