Use the ViewModelSource class to create a MainViewModel instance public static MainViewModel Create() Bindable SummaryName property will be created with validation Here’s a simple POCO that will be turned into a full-featured ViewModel at runtime by ViewModelSource using Reflection Emit. IDataErrorInfo can be added to POCO classes for validation by adding a class level attribute.There is an optional Command attribute and a fluent API to control the creation of the commands. Commands are generated for all public methods with 0 or 1 parameters.If specific logic is to be executed when a property changes, a method should be created with either of these formats: OnChanged() or OnChanging().All public virtual and auto properties with public getters and public/protected setters will have bindable properties generated.The following conventions define how ViewModelSource will create the resulting ViewModel from the provided POCO. The DevExpress MVVM Framework has one feature that sets it apart from many others.Ī developer can create a POCO (plain old CLR object), and turn it into a ViewModel based on convention and a call to the class. NET developers, including MVVM Light and Caliburn.Micro. There are a handful of popular MVVM frameworks available to. A reference to v14.2 is automatically added to the starting project.įeature Focus - MVVM Support with POCO ViewModels A complete UI ready to be hooked up to a view model with the DevExpress MVVM framework or any other MVVM framework. Completing the wizard with all of the selections above produces a main window that looks like this. Obviously, not every project requires all of these features, and every step is an optional selection. I’ve included the steps I have chosen in this gallery. Selecting the ‘Project Wizard’ option, guides the developer through a series of choices to build the best possible starting point for the project. When selecting WPF as the platform, the following templates are available. ![]() TemplatesĭevExpress Universal includes a template wizard to select the starting point that best suits your project based on platform, DX version, and programming language. This is a good example of a fully baked, line-of-business app that can be built with WPF and DevExpress. Here’s a diagram of the project dependencies. The ViewModels are broken out into their own project, with other projects for UI, Resources, and Data/Platform Services. The application makes use of some of the rich Office-style controls you might find in Outlook, including a ribbon-style toolbar, whose contents are context aware and change while navigating through the application. Here are a few screen shots of the application in action. It is a full-featured application for managing the operation of a video rental shop. One of the WPF sample applications provided with DevExpress Universal is the Video Rental application.
0 Comments
Leave a Reply. |