1. Static creation - Loading UI elements from XAML files
This solution should be used in most of cases. It presents a lot of benifices than programming solution such as UI modification without application rebuild, possible to be changed via a visual designer by no-software engineer or directly by end-users, window generation during the execution, window generation based on template, patch modification of resource files by a program, etc.
2. Dynamic creation - Using the UPF API
This solution is very similary to traditional programming on Swing or SWT. This solution is in general rarely used. It could be helpful in some complexe trigger contexts to change dynamically the UI appareance and behaviors.
Rich markup language for declarative application programming.
A rich library of controls that support user interface (UI) development.
Data binding provides a simple and consistent way for applications to present and interact with data. Elements can be bound to data from a variety of data sources in the form of Java objects and XML.
Extensive support for the development of world-ready applications.