Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guorg/gu.wpf.tooltips
https://github.com/guorg/gu.wpf.tooltips
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/guorg/gu.wpf.tooltips
- Owner: GuOrg
- License: mit
- Created: 2014-11-29T15:30:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-25T13:09:45.000Z (11 months ago)
- Last Synced: 2024-11-05T15:52:53.291Z (15 days ago)
- Language: C#
- Size: 558 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gu.Wpf.ToolTips
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.ToolTips.svg)](https://www.nuget.org/packages/Gu.Wpf.ToolTips/)
[![Build status](https://ci.appveyor.com/api/projects/status/j4myy99it0now2gv/branch/master?svg=true)](https://ci.appveyor.com/project/JohanLarsson/gu-wpf-tooltips/branch/master)
[![Build Status](https://dev.azure.com/guorg/Gu.Wpf.ToolTips/_apis/build/status/GuOrg.Gu.Wpf.ToolTips?branchName=master)](https://dev.azure.com/guorg/Gu.Wpf.ToolTips/_build/latest?definitionId=15&branchName=master)Helpers for tool tips.
## TouchToolTipService
Tool tips for touch users. Setting `TouchToolTipService.Enabled="True"` on an element draws an OverlayAdorner over the element with an icon indicating that there is touch info.
Tapping opens/closes the tool tip.#### Simple sample:
```xaml
<Setter Property="Padding" Value="6" />
<Setter Property="toolTips:TouchToolTipService.IsEnabled" Value="False" />
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="toolTips:TouchToolTipService.IsEnabled" Value="True" />
</Trigger>
<Setter Property="toolTips:TouchToolTipService.IsEnabled" Value="True" />
<Setter Property="Padding" Value="6" />
<Setter Property="toolTips:TouchToolTipService.IsEnabled" Value="True" />
<Setter Property="Padding" Value="6" />
```
Renders:![Animation](https://user-images.githubusercontent.com/1640096/71777206-fdf02980-2f9c-11ea-85a4-92d0979a2ef0.gif)
#### OverlayAdorner
The default style for the overlay is:
```xaml
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Ellipse x:Name="TouchInfoIcon"
Height="{Binding RelativeSource={RelativeSource Self},
Path=ActualWidth}"
Width="12"
Canvas.Top="0"
Canvas.Right="0"
Margin="0,2,2,0"
HorizontalAlignment="Right"
VerticalAlignment="Top">
<Ellipse.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}">
<GeometryDrawing.Geometry>
<EllipseGeometry Center="50,50"
RadiusX="50"
RadiusY="50" />
</GeometryDrawing.Geometry>
</GeometryDrawing><GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="43,15,14,15" />
<RectangleGeometry Rect="43,36,14,50" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Ellipse.Fill>
</Ellipse>
</ControlTemplate>
</Setter.Value>
</Setter>```