How to Use MVVM Framework to Create Commands that Manage Documents in the Report Designer
This example demonstrates how to use the MVVM framework to create custom commands that have access to the ReportDesigner API. The user can click a button with a linked command to create or open a report, and switch tabs or document views.
The project defines the IReportDesignerAPIService
interface. The code contains the ReportDesignerAPIService
class that implements this interface and calls the ReportDesigner API methods. The ReportDesignerAPIService
class is specified as a custom MVVM Framework Behaviour element to get access to the RepotDesigner object in the window.
The MainViewModel
gets the IReportDesignerAPIService service from the service container and creates a set of POCO View Model commands whose code utilizes the IReportDesignerAPIService service methods.
Files to Look At
- MainWindow.xaml (MainWindow.xaml)
- MainViewModel.cs (MainViewModel.vb)
- IReportDesignerAPIService.cs (IReportDesignerAPIService.vb)