MindFusion.Wpf Pack Programmer's Guide
Workbook

The workbook consists of a set of worksheets. In addition, the workbook contains a list of named ranges, manages undo/redo and provides formula calculations.

The workbooks are represented by the Workbook class. The worksheets in the workbook can be accessed and managed through the Worksheets collection of the Workbook class. New worksheets are created and added to the workbook indirectly, through the Add method of this collection. The NamedRange objects of the workbook are managed through the NamedRanges collection.

The workbook acts as a model and do not provide visualization directly. To display a workbook on a form, use the WorkbookView control. To print or preview a workbook, use the WorkbookPrinter class. For more information about this, see Workbook View.

Serialization

Workbooks can be imported from and exported to a variety of formats. To import a workbook, use the appropriate importer class - CsvImporter, CalcImporter, ExcelImporter and so on. Alternatively, to export a workbook, use an instance of the one of the exporter classes - PdfExporter, CsvExporter and so on. The workbook can be serialized to and deserialized from a stream or a file through the respective SaveTo* and LoadFrom* methods. For example, to save the workbook to an XML, use one of the SaveToXml overloads. To read more about serialization, check the Serialization and Output topic.

Undo and Redo

The Workbook class provides automatic undo and redo of changes. The undo and redo can be enabled and disabled through the UndoEnabled property. To undo or redo an action, use the Undo and Redo methods. To check if there is an action to be undone or redone, use the CanUndo and CanRedo properties. When an action is undone or redone, the ActionUndone or ActionRedone events are raised. For more information about this, check the Undo and Redo topic.

Localization

To specify the culture of the workbook and its associated worksheets, use the Locale property. This culture is used when parsing and formatting data in the worksheets. The default of this property is the culture of the current thread.