Xamarin Workbooks is a unique product which allows us to write documentation, with runnable code examples and provides a way to visualize the user interface. We can create these workbooks for Xamarin. Android, Xamarin.iOS, WPF, and Console.
Xamarin Workbook is open-source software. Xamarin Workbook provides the mixture of the documentation and code which is perfect for the experimentation, learning, creating guides, and for teaching purpose.
Xamarin Workbook Installation And Requirements
Requirements: To download the Xamarin Workbook, here are the following requirements:
Supported Operating Systems
To download the Xamarin Workbook, supported operating systems are:
Supported App Platforms
To download the Xamarin Workbook, click on this link: https://en.freedownloadmanager.org/Windows-PC/Xamarin-Workbooks-FREE.html.
After clicking on the link, downloading will start. Click on the download folder, a new screen will be opened as shown in the below screenshot:
Click on the Run button to start the installation.
Click on the next button to start the installation, after completing the installation, click on the finish button.
When we open Workbook, we choose which type of Workbook we want. Here we choose Android workbook.
A workbook will automatically open the emulator or simulator for us. For example, if we select Android, we will see the Simulator load with the Workbook.
Launching Emulator is:
When the Workbook opens, we will see a place where we can write and will see small buttons. Buttons are called cell. The one is open by default allows us to write the code; however, we can add more cells for code or documentation, as shown in the screenshot:
To add the package click on File->Add Package it will allow us to add the Nuget Packages to our Workbook.
When we added a package, it will show the imports at the top of the Workbook.
We can use Workbooks as a standalone application, separate from the IDE.
To create a new workbook, run the Workbooks app. We can create Workbook on our choice of platform, which will connect to an agent app and allows us to visualize the document in real-time.
If the Workbook is already running, we can create a new document by browsing to File-> New.
Workbooks can be saved and opened again within the application. We can then share them with others to demonstrate the ideas, explore the new APIs, or in teaching the new concepts.
The code editing window provides code completion, syntax coloring, inline-live diagnostic, and multi-line supports.
Code in the Workbook
Types of Files in Workbook
Plain Files: By default, Workbook saves as a plain text .workbook file containing the CommonMark-formatted text.
Packages: Workbook package is a directory which is named as.Workbook extension.
The directory must contain an index .Workbook file, it is the actual plain text workbook which will load in Xamarin Workbooks. The directory can also contain the resources which are required by index Workbook, includes the images and other files.
If a plain text .Workbook file which refers to the resources from its same directory it is opened in a workbook 0.99.3 or later, when it is saved, it will be converted to a .Workbook package.
Archives: As a directory, it is difficult to distribute the Workbook package over the internet. Solution for this is Archives.
The Workbook archive is a zip-compressed Workbook package, named with the .Workbook extension.
Workbook1.1, the Save dialog provides the option of saving as an archive when saving a Workbook package. There was no built-in way to create or save archives in Workbook 1.0. When the Workbook archive was opened, it was transparently changed to a Workbook package, and the zip file was lost.
We can manually create a Workbook archive by right-clicking the Workbook package and selecting Compress on a Mac or Send to Compressed (zipped) folder on Windows. Then rename the zip file to a .Workbook file extension. Archives works with workbook packages, not with plain Workbook files.