Examples

You can learn more by seeing a Visual Studio solution with the full list of examples divided into separate projects that complements this documentation. To open the examples, it is possible to build the entire solution, copy the output files to the POS installation directory and register only one initiating module POSUsageExample.dll (you can find registration instructions in the README.txt file of the solution). Alternatively, it is possible to build each project separately (depending on which one you want to analyze) and register only the selected library in POS application. The projects are divided into three categories: examples of using controls, examples of entire views, and examples of the extensibility of existing views.

Example of using POS controls

Examples of using the ComboBox2 control

These examples present the use of the control with a standard modal view of the selection list and a non-standard presentation. Available in the ComboBox2Example project.

Example of using the ButtonSpinner control

This example presents the use of the control with a TextBox for managing numerical values entered by the user. Available in the ButtonSpinnerExample project.

Example of using the ComboBoxButton control

Available in the ComboBoxButtonExample project.

Example of using the MultiButton control

This example presents the use of the control with full manageability in the application. Available in the MultiButtonExample project.

Examples of using the ItemsContainer control

These examples present the use of the control with full manageability in the application. The first example involves the definition of elements in xaml; the second example presents a dynamically asynchronous content built in code. Available in the ItemsContainerExample project.

Example of using the Grid control

This example presents the structure of a fully manageable view based on a grid. Available in the GridExample project.

Examples of using the FieldControl control

These examples present the use of the control with full manageability and validation support. Available in the FieldControlExample project.

Example of using the TabControl and TabControlItem controls

This example presents the use of the TabControl and TabControlItem controls for creating view tabs. Available in the TabControlExample project.

Example of using the DatePicker2 control

The example in the DatePicker2Example project presents the use of the control with validation.

Examples of creating views

Simple module with a new empty view

This example presents how to create extending modules in POS application. Available in the EmptyViewExample project. It consists of a Module class allowing the registration of a module and an empty view (SimpleView, SimpleViewModel), along with the layout management mode (DesignSimpleViewModel). The view has been registered as a tile in the main menu of POS application.

Typical view of the document list

This example presents the structure of a typical view with a list that retrieves data asynchronously, supports sorting and paging, and contains a search box and filters. It consists of a Module class (responsible for the registration of the extending module and the view as a tile in the main menu of POS application) and the view and view-model classes of the list – SimpleListView, SimpleListViewModel, and DesignSimpleListViewModel. Available in the DataGridCompleteExample project.

Typical trade document view

This example presents the structure of a typical trade document view, containing a DataGrid and a SearchBox. Available in the DocumentExample project.

Trade document view handling attributes

This example presents the structure of a trade document view, enriched with the support of attributes for the list and as dynamically generated controls in the view container. Available in the DocumentAttributesExample project.

Examples of the extensibility of existing POS views

How to add a control to the container of an existing view

The ControlExtensionsExamples project contains an example described in this document and a second one that presents how to add buttons, both to the ItemsContainer container and to the Grid of an existing view created in the same project.

How to add a column to the DataGrid of an existing view

The DataGridColumnExtensionExample presents the full example of DataGrid column extensibility described in this document.

How to implement a custom data aggregation method in a DataGrid

The DataGridAggregationExample project presents how to implement median aggregation.

How to extend the status bar

The StatusBarExtensionExample project adds two buttons to the status bar area. One is a shortcut opening a new trade document, and the other uses a ComboBoxButton control.

Czy ten artykuł był pomocny?