Git Product home page Git Product logo

wpfwindowslib's Introduction

Base WPF Window functionality for data entry

Table of content

About
Data Entry Samples Application
  Coding
  Further documentation
Build requirements
Structure WpfWindowsLib Solution
Project Status
Copyright

About

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.

Data Entry Samples Application

The project Samples shows the various controls available and demonstrates how the user will interact with them:

Samples

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.

User has changed data, cannot close 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.

Coding

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 OnICheckChangedor OnIsAvailableChanged as needed.

Further documentation

For a more detailed documentation see: CodeProject: Base WPF Window Functionality for Data Entry

Build requirements

.Net Core 3.1 or later

Structure WpfWindowsLib Solution

WpfWindowsLib

The only library needed to be referenced from other code, providing ICheck, IChecker and various WPF controls like TextBox or ComboBox supporting ICheck.

Samples

WPF Core application showing all WpfWindowsLib Controls

WpfWindowsLibTest

WpfWindowsLib unit tests

Project Status

Completed and stable

Copyright

Copyright 2020 Jürg Peter Huber, Singapore.

Licensed under the Creative Commons 0 license

wpfwindowslib's People

Contributors

peterhubersg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.