Budgeter 5000 - A Budgeting Prism 6 Windows Application Part 5, Register View

Register

Budgeter 5000 will have a register page to enter the transactions over time.

 

Layout

The top has a button area for saving the records.  There is a filter drop down for displaying only certain account type transactions.  And there is a data grid to display the records.

Register control

 

Custom Xaml

The register page contains a bunch of custom Xaml in order to show the combobox values.  

 

Enum Combobox - Type

The Xaml below creates a resource with an Enum named ModifierType.

 Enum

This resource is used in the data grid.  

Type Combobox

 

Dynamic Combobox Account Name

The Account Name combobox uses the view model to populate it's drop down values.  The AccountList contains the values and returns an ID which is bound to (Transaction.)AccountID.

Originally I tried to return the Account object, but through a few weeks of attempting different ways, I think it may be impossible.

Account name Xaml

Here is the definition for the AccountList. 

 Account list definition

 

DatePicker

I utilize the built in data picker control for proper data formatting and selection.

Datepicker

 

DataGridTextColumn

I bind the text based fields with a normal binding.

DataGridTextColumn

 

Register View Model 

The register view model is initialized with two services injected with it.  A delegate command is created to call the save transaction method when the save button is pressed from the Register view.

Register view model constructor

 

Get Transactions

We use the Prism 6 navigation interface and the transaction service to get the transaction data.  We attach to an event to capture when a new record is added.

Register OnNavigateTo

 

CollectionChanged

The collection changed event listens for new records and then adds a unique Guid and the current date.

CollectionChanged

 

Register Page Running

Here is the Register page running with a few records entered.

Register page

 

The complete source code for this project is located on Github.

https://github.com/twodawg/Budgeter5000

 

If you found this article helpful use the tweet button below to spread the word.  Thank you.

 

Leave your comment