# Getting Started with WPF Breadcrumb

This tutorial will walk you through the creation of a **RadBreadcrumb**.

## Adding Telerik Assemblies Using NuGet

To use **RadBreadcrumb** when working with NuGet packages, install the `Telerik.Windows.Controls.Navigation.for.Wpf.Xaml` package. The [package name may vary](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/nuget/available-packages) slightly based on the Telerik dlls set - [Xaml or NoXaml](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/xaml-vs-noxaml)

Read more about NuGet installation in the [Installing UI for WPF from NuGet Package](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/nuget/nuget-installation) article.

> tip With the 2025 Q1 release, the Telerik UI for WPF has a new licensing mechanism. You can learn more about it [here](https://www.telerik.com/products/wpf/documentation/installation/licensing/installing-license-key).

## Adding Assembly References Manually

If you are not using NuGet packages, you can add a reference to the following assemblies:

* **Telerik.Licensing.Runtime**
* **Telerik.Windows.Controls**
* **Telerik.Windows.Controls.Navigation**
* **Telerik.Windows.Data**

You can find the required assemblies for each control from the suite in the [Controls Dependencies](https://www.telerik.com/products/wpf/documentation/common-information/installation-installing-dependencies-wpf) help article.

## Define a Breadcrumb control

**Example 1** demonstrates a basic **RadBreadcrumb** definition.

**Example 1: Defining a RadBreadcrumb in XAML**

```XAML
<telerik:RadBreadcrumb x:Name="breadcrumb" Header="Breadcrumb Header" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
```

**Example 2: Defining a RadBreadcrumb in code**

```C#
RadBreadcrumb radBreadcrumb1 = new RadBreadcrumb();
radBreadcrumb1.Header = "Breadcrumb Header";
radBreadcrumb1.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
radBreadcrumb1.VerticalAlignment = System.Windows.VerticalAlignment.Top;
```

```VB.NET
Dim breadcrumb As New RadBreadcrumb()
breadcrumb.Header = "Breadcrumb Header"
breadcrumb.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
breadcrumb.VerticalAlignment = System.Windows.VerticalAlignment.Top
```

![WPF RadBreadcrumb from Code](https://www.telerik.com/products/wpf/documentation/assets/2d7b61fec4430b00b990689283608561/breadcrumb_gettingstarted_breadcrumb.png)

> The **RadBreadcrumb** control is a **HeaderedItemsControl** and its Header is used as a root element. Therefore the control always has one root element. If you don't set the **Breadcrumb.Header** property an empty root element will be created.

So far there is an empty **RadBreadcrumb** containing no items.

## Add and remove items (RadBreadcrumbItem controls) and set their Header and DropDownHeader properties

You can add items to the **RadBreadcrumb** control by defining **RadBreadcrumbItem** controls inside the **RadBreadcrumb** definition in XAML:

**Example 3: Adding RadBreadcrumbItems in XAML**

```XAML
<telerik:RadBreadcrumb Header="Breadcrumb Header" HorizontalAlignment="Stretch" VerticalAlignment="Top">
    <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1" DropDownHeader="DropDownItem 1">
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1.1" DropDownHeader="DropDownItem 1.1"/>
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1.2" DropDownHeader="DropDownItem 1.2" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1.3" DropDownHeader="DropDownItem 1.3" />
    </telerik:RadBreadcrumbItem>
    <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2" DropDownHeader="DropDownItem 2">
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2.1" DropDownHeader="DropDownItem 2.1" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2.2" DropDownHeader="DropDownItem 2.2" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2.3" DropDownHeader="DropDownItem 2.3" />
    </telerik:RadBreadcrumbItem>
    <telerik:RadBreadcrumbItem Header="BreadcrumbItem 3" DropDownHeader="DropDownItem 3" />
</telerik:RadBreadcrumb>
```

Or you can populate the **RadBreadcrumb.Items** collection in code-behind:

**Example 4: Adding RadBreadcrumbItems in code**

```C#
RadBreadcrumbItem item1 = new RadBreadcrumbItem() { Header = "BreadcrumbItem 1", DropDownHeader = "DropDownItem 1" };
item1.Items.Add(new RadBreadcrumbItem() { Header = "BreadcrumbItem 1.1", DropDownHeader = "DropDownItem 1.1" });
item1.Items.Add(new RadBreadcrumbItem() { Header = "BreadcrumbItem 1.2", DropDownHeader = "DropDownItem 1.2" });
item1.Items.Add(new RadBreadcrumbItem() { Header = "BreadcrumbItem 1.3", DropDownHeader = "DropDownItem 1.3" });
breadcrumb.Items.Add(item1);
RadBreadcrumbItem item2 = new RadBreadcrumbItem() { Header = "BreadcrumbItem 2", DropDownHeader = "DropDownItem 2" };
item2.Items.Add(new RadBreadcrumbItem() { Header = "BreadcrumbItem 2.1", DropDownHeader = "DropDownItem 2.1" });
item2.Items.Add(new RadBreadcrumbItem() { Header = "BreadcrumbItem 2.2", DropDownHeader = "DropDownItem 2.2" });
item2.Items.Add(new RadBreadcrumbItem() { Header = "BreadcrumbItem 2.3", DropDownHeader = "DropDownItem 2.3" });
breadcrumb.Items.Add(item2);
RadBreadcrumbItem item3 = new RadBreadcrumbItem() { Header = "BreadcrumbItem 3", DropDownHeader = "DropDownItem 3" };
breadcrumb.Items.Add(item3);
```

```VB.NET
Dim item1 As New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 1", 
        Key .DropDownHeader = "DropDownItem 1" 
}
item1.Items.Add(New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 1.1", 
        Key .DropDownHeader = "DropDownItem 1.1" 
})
item1.Items.Add(New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 1.2", 
        Key .DropDownHeader = "DropDownItem 1.2" 
})
item1.Items.Add(New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 1.3", 
        Key .DropDownHeader = "DropDownItem 1.3" 
})
breadcrumb.Items.Add(item1)

Dim item2 As New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 2", 
        Key .DropDownHeader = "DropDownItem 2" 
}
item2.Items.Add(New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 2.1", 
        Key .DropDownHeader = "DropDownItem 2.1" 
})
item2.Items.Add(New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 2.2", 
        Key .DropDownHeader = "DropDownItem 2.2" 
})
item2.Items.Add(New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 2.3", 
        Key .DropDownHeader = "DropDownItem 2.3" 
})
breadcrumb.Items.Add(item2)

Dim item3 As New RadBreadcrumbItem() With { 
        Key .Header = "BreadcrumbItem 3", 
        Key .DropDownHeader = "DropDownItem 3" 
}
breadcrumb.Items.Add(item3)
```

![WPF RadBreadcrumb Dropdown Items](https://www.telerik.com/products/wpf/documentation/assets/bfd388bba2336d0579afa2d48b6ab193/breadcrumb_gettingstarted_breadcrumb_items.png)

In order to remove items from the **RadBreadcrumb** control, you can remove them from the control's **Items** collection:

**Example 5: Removing RadBreadcrumbItems**

```C#
breadcrumb.Items.Remove(item2);
```

```VB.NET
breadcrumb.Items.Remove(item2)
```

![WPF RadBreadcrumb with Item Removed](https://www.telerik.com/products/wpf/documentation/assets/85ddb806f45866c26a4ab27f788840dc/breadcrumb_gettingstarted_items_remove.png)

## Enable LinearMode

By default the **RadBreadcrumb** control has two modes - normal and text mode. In the normal mode you can navigate through the **Breadcrumb.Items** using the BreadcrumbItems and their dropdown content, while in the text mode you can enter the path that you want to navigate to. The control also provides a **Linear** mode in which the **BreadcrumbItem DropDown Items** collection is hidden. In **Linear** mode you can navigate through the **Items** collection of the control by taking advantage of the text mode of the **RadBreadcrumb**, using its history, using the key navigation or setting the destination path from code-behind.

In order to enable the **Linear** mode of the **RadBreadcrumb** control, you have to set the **IsLinearMode** property to **True** :

**Example 6: Enabling linear mode in XAML**

```XAML
<telerik:RadBreadcrumb  Header="Breadcrumb Header" HorizontalAlignment="Stretch"
	        VerticalAlignment="Top" IsLinearMode="True">
    <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1" DropDownHeader="DropDownItem 1">
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1.1" DropDownHeader="DropDownItem 1.1" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1.2" DropDownHeader="DropDownItem 1.2" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 1.3" DropDownHeader="DropDownItem 1.3" />
    </telerik:RadBreadcrumbItem>
    <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2" DropDownHeader="DropDownItem 2">
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2.1" DropDownHeader="DropDownItem 2.1" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2.2" DropDownHeader="DropDownItem 2.2" />
        <telerik:RadBreadcrumbItem Header="BreadcrumbItem 2.3" DropDownHeader="DropDownItem 2.3" />
    </telerik:RadBreadcrumbItem>
    <telerik:RadBreadcrumbItem Header="BreadcrumbItem 3" DropDownHeader="DropDownItem 3" />
</telerik:RadBreadcrumb>
```

**Example 7: Enabling linear mode in code**

```C#
breadcrumb.IsLinearMode = true;
```

```VB.NET
breadcrumb.IsLinearMode = True
```

![WPF RadBreadcrumb Linear Mode](https://www.telerik.com/products/wpf/documentation/assets/e89c4e92227bd00124f100f054e79a42/breadcrumb_gettingstarted_linear_mode.png)

## Change the number of paths saved in the Breadcrumb history

By default the **RadBreadcrumb** control keeps a history of 10 visited paths. If you want to increase or decrease this number, you can set the **HistorySize** property:

**Example 8: Setting the history size in XAML**

```XAML
<telerik:RadBreadcrumb Header="Breadcrumb Header" HorizontalAlignment="Stretch"
	        VerticalAlignment="Top" HistorySize="15">
    ...
</telerik:RadBreadcrumb>
```

**Example 9: Setting the history size in code**

```C#
breadcrumb.HistorySize = 15;
```

```VB.NET
breadcrumb.HistorySize = 15
```

## Setting a Theme

The controls from our suite support different themes. You can see how to apply a theme different than the default one in the [Setting a Theme](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-setting-a-theme-overview) help article.

> important Changing the theme using implicit styles will affect all controls that have styles defined in the merged resource dictionaries. This is applicable only for the controls in the scope in which the resources are merged.

To change the theme, you can follow the steps below:

* Choose between the themes and add reference to the corresponding theme assembly (ex: **Telerik.Windows.Themes.Fluent.dll**). You can see the different themes applied in the **Theming** examples from our [WPF Controls Examples](https://demos.telerik.com/wpf/) application.

* Merge the ResourceDictionaries with the namespace required for the controls that you are using from the theme assembly. For the **RadBreadcrumb**, you will need to merge the following resources:

  * **Telerik.Windows.Controls**
  * **Telerik.Windows.Controls.Navigation**

**Example 2** demonstrates how to merge the ResourceDictionaries so that they are applied globally for the entire application.

**Example 2: Merge the ResourceDictionaries**

```XAML
<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml"/>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml"/>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
</ResourceDictionary.MergedDictionaries>
```

> Alternatively, you can use the theme of the control via the [StyleManager](https://docs.telerik.com/devtools/wpf/styling-and-appearance/stylemanager/common-styling-apperance-setting-theme-wpf).

**Figure 2** shows a **RadBreadcrumb** with the **Fluent** theme applied.

> caption RadBreadcrumb with the fluent theme

![RadBreadcrumb with Fluent theme](https://www.telerik.com/products/wpf/documentation/assets/44195f9efbf98db95a19d5b7bea3bb35/radbreadcrumb-setting-theme.png)

## Telerik UI for WPF Learning Resources

* [Telerik UI for WPF Breadcrumb Component](https://www.telerik.com/products/wpf/breadcrumb.aspx)
* [Getting Started with Telerik UI for WPF Components](https://www.telerik.com/products/wpf/documentation/getting-started/first-steps-nuget)
* [Telerik UI for WPF Installation](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/installation-guide)
* [Telerik UI for WPF and WinForms Integration](https://www.telerik.com/products/wpf/documentation/common-information/winforms-integration/overview)
* [Telerik UI for WPF Visual Studio Templates](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/visual-studio-templates)
* [Setting a Theme with Telerik UI for WPF](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-setting-a-theme-overview)
* [Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/16/telerik-ui-for-wpf)
* [Telerik UI for WPF License Agreement](https://www.telerik.com/purchase/license-agreement/wpf-dlw-s)

## See Also

* [Overview](https://www.telerik.com/products/wpf/documentation/controls/radbreadcrumb/overvew)
* [Features Overview](https://www.telerik.com/products/wpf/documentation/controls/radbreadcrumb/features/overview)
