In This Article

Getting Started

Getting up and running with Docking & MDI controls is extremely easy.

This topic's information will assume you are using Visual Studio to write your XAML code for control that will contain docking windows and/or MDI.

Add NuGet Package

Docking & MDI is included with the ActiproSoftware.Controls.Avalonia.Pro package (view on nuget.org), so add a reference to that package. This should automatically include its transient dependencies as well.

For additional information on NuGet packages, please refer to the NuGet Packages and Feeds topic.

Configure Themes

Controls available in the Docking & MDI product rely on Actipro's themes.

Important

If the proper theme is not configured, Actipro controls may be empty, be completely invisible in the application, or raise exceptions about missing template parts!

Actipro's themes can be integrated by adding a special ModernTheme class, which inherits Avalonia's Styles class, to an application's Application.Styles collection.

The ModernTheme class has several settings that tell it which theme assets to dynamically load into the Application, making them available for use. By default, the "Pro" control themes are not loaded and must be explicitly included when defining the theme.

The following example demonstrates defining an instance of ModernTheme directly in Application.Styles in XAML with support for Pro controls:

<Application
	x:Class="MyCompany.App"
	xmlns="https://github.com/avaloniaui"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:actipro="http://schemas.actiprosoftware.com/avaloniaui"
	>
	<Application.Styles>

		<!-- NOTE: Any Styles included above the ModernTheme can be overwritten by the Actipro themes -->

		<actipro:ModernTheme Includes="Pro" />

		<!-- NOTE: Any Styles included below the ModernTheme cannot be overwritten by the Actipro themes -->

	</Application.Styles>
</Application>

See the Themes Getting Started topic for additional details on working with themes.

Evaluate or Register a License

Docking is a paid product that is included with a Pro license. During the evaluation phase, a popup will be shown the first time most Pro controls are used. Follow the "Hide This Prompt" steps on the prompt for details on how to temporarily suppress the prompt during evaluation.

Once a license is purchased (or a short-term evaluation license is obtained), the license must be registered during application startup to prevent the licensing prompt from being displayed.

See the section Licensing topic for more details on licensing, including how to apply a license.

Getting Started with Docking & MDI

This xmlns declaration in your root XAML control allows access to the various controls in this product:

xmlns:actipro="http://schemas.actiprosoftware.com/avaloniaui"

This code shows the base XAML that you can use to create a simple docking window layout with several windows:

<actipro:DockSite>
	<actipro:SplitContainer>
		<actipro:Workspace>
			<actipro:TabbedMdiHost>
				<actipro:TabbedMdiContainer>
					<actipro:DocumentWindow Title="Document1.txt" Description="Text document" FileName="Document1.rtf">
						<TextBox BorderThickness="0" TextWrapping="Wrap" Text="This is a document window." />
					</actipro:DocumentWindow>
				</actipro:TabbedMdiContainer>
			</actipro:TabbedMdiHost>
		</actipro:Workspace>
		<actipro:ToolWindowContainer>
			<actipro:ToolWindow Title="Tool Window 1" />
			<actipro:ToolWindow Title="Tool Window 2" />
		</actipro:ToolWindowContainer>
	</actipro:SplitContainer>
</actipro:DockSite>

This code shows the base XAML that you can use to create a simple docking window layout that leverages MVVM support:

<actipro:DockSite
	DocumentItemsSource="{Binding DocumentItems}"
	DocumentItemContainerTheme="..."
	ToolItemsSource="{Binding ToolItems}"
	ToolItemContainerTheme="...">
	<actipro:Workspace>
		<actipro:TabbedMdiHost />
	</actipro:Workspace>
</actipro:DockSite>

Several ways of opening the windows are shown in the MVVM examples found in our Sample Browser.

Further Study

There are fair number of controls and concepts to understand when working with this product. We encourage you to, at a minimum, read through the Term Definitions and Control Hierarchy topics since they cover some essential things to know.

Also, please run through the feature documentation and also look at the numerous QuickStarts located in the sample project. The documentation is very thorough and the sample project demonstrates almost every feature of the controls.

See the Samples topic for more information on accessing the sample project.

If you require further assistance after looking through those, please visit our support forum for the product.