Skip to content

Commit a1bd21e

Browse files
Merge pull request #1179 from telerik/new-kb-tooltip-toolbar-items-pdfviewer-dotnet-maui-66bcbe9489d147c68834c0927acaafa6
Added new kb article tooltip-toolbar-items-pdfviewer-dotnet-maui
2 parents ba1dca4 + 66c450c commit a1bd21e

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: Adding Tooltip to Toolbar Items in PDF Viewer for .NET MAUI
3+
description: Learn how to define a tooltip with text for the toolbar items in PDF Viewer for .NET MAUI.
4+
type: how-to
5+
page_title: Define Tooltip for PDF Viewer Toolbar Items in .NET MAUI
6+
meta_title: Define Tooltip for PDF Viewer Toolbar Items in .NET MAUI
7+
slug: tooltip-toolbar-items-pdfviewer-dotnet-maui
8+
tags: pdfviewer, .net-maui, tooltip, toolbaritems, buttontoolbaritemview, style, tooltipproperties.text
9+
res_type: kb
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| --- | --- | ---- |
16+
| 11.0.0 | Telerik UI for .NET MAUI PDF Toolbar | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova) |
17+
18+
## Description
19+
20+
I want to add tooltips to the toolbar items in the PDF Viewer for .NET MAUI. How can I define a tooltip for the toolbar buttons?
21+
22+
This knowledge base article also answers the following questions:
23+
- How to set tooltip text for toolbar buttons in PDF Viewer for .NET MAUI?
24+
- How to customize tooltips in the PDF Viewer toolbar?
25+
- How to apply tooltip properties to `RadToolbar` items?
26+
27+
## Solution
28+
29+
The PDF Viewer toolbar inherits from `RadToolbar`, which allows the use of tooltips for toolbar items. To define a tooltip for toolbar items, set the `Style` property with a `TargetType` as `ButtonToolbarItemView` and use the `ToolTipProperties.Text` property.
30+
31+
Here's an example:
32+
33+
```xml
34+
<ContentPage.Resources>
35+
<ResourceDictionary>
36+
<Style x:Key="fitstyle" TargetType="telerik:ButtonToolbarItemView">
37+
<Setter Property="ToolTipProperties.Text" Value="My text" />
38+
</Style>
39+
</ResourceDictionary>
40+
</ContentPage.Resources>
41+
42+
<Grid RowDefinitions="Auto, *">
43+
<telerik:RadPdfViewerToolbar OverflowMode="Scroll"
44+
PdfViewer="{Binding Source={x:Reference pdfViewer}}">
45+
<telerik:PdfViewerFitToWidthToolbarItem Style="{StaticResource fitstyle}" />
46+
<telerik:PdfViewerZoomInToolbarItem />
47+
<telerik:PdfViewerZoomOutToolbarItem />
48+
<telerik:PdfViewerToggleLayoutModeToolbarItem />
49+
<telerik:PdfViewerNavigateToPreviousPageToolbarItem />
50+
<telerik:PdfViewerNavigateToNextPageToolbarItem />
51+
<telerik:PdfViewerNavigateToPageToolbarItem />
52+
</telerik:RadPdfViewerToolbar>
53+
<telerik:RadPdfViewer x:Name="pdfViewer" Grid.Row="1" />
54+
</Grid>
55+
```
56+
57+
## See Also
58+
- [PDF Viewer for .NET MAUI](https://docs.telerik.com/devtools/maui/controls/pdfviewer/overview)
59+
- [Toolbar Control](https://docs.telerik.com/devtools/maui/controls/toolbar/overview)

0 commit comments

Comments
 (0)